> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.hrizn.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Content Intelligence

> Automate content gap analysis and act on AI-generated recommendations via the API

Hrizn's Content Intelligence system analyzes your dealership's inventory, search performance, competitive landscape, and seasonal trends every night to surface actionable content recommendations. This guide explains how the system works and how to build automations around it using the API.

## How it works

Every night at 4:00 AM ET, the content intelligence pipeline runs a multi-stage analysis:

1. **Snapshot** -- Aggregates your site's inventory, articles, IdeaClouds, search console data, and analytics into a unified snapshot.
2. **Gap analysis** -- Compares your snapshot against network benchmarks and runs 20+ analyzers to identify content gaps.
3. **Scoring** -- Each recommendation is assigned a priority score (0-100) based on estimated traffic impact, competitive urgency, and timeliness.
4. **Deduplication** -- Semantic similarity and fingerprint matching prevent duplicate recommendations across nightly runs.

The pipeline produces up to 200 active recommendations per site, covering everything from missing model pages to seasonal events.

## Recommendation types

Each recommendation has a `suggestion_type` that indicates the kind of content opportunity. Use the [content intelligence types reference](/api-reference/reference/content-intelligence-types) for a full list, or call `GET /reference/content-intelligence-types` to get types with their `actionable_via` field.

### Inventory-driven

| Type                    | Description                                             | Action endpoint             |
| ----------------------- | ------------------------------------------------------- | --------------------------- |
| `missing_model_page`    | Vehicle in inventory with no model research page        | `POST /model-landing-pages` |
| `inventory_move`        | Aging stock, high volume, or price segment opportunity  | `POST /model-landing-pages` |
| `model_year_transition` | New model year arriving, needs updated content          | `POST /model-landing-pages` |
| `price_segment_content` | Price segment (e.g. "SUVs under \$35k") with no content | `POST /ideaclouds`          |

### Search and performance

| Type                          | Description                                    | Action endpoint               |
| ----------------------------- | ---------------------------------------------- | ----------------------------- |
| `search_gap`                  | High-impression query with no matching content | `POST /ideaclouds`            |
| `search_position_opportunity` | Page 2 query that could move to page 1         | `POST /ideaclouds`            |
| `keyword_cannibalization`     | Multiple pages competing for same keyword      | `POST /ideaclouds`            |
| `content_refresh`             | Article declining in traffic, needs refresh    | `POST /content/{id}/generate` |
| `trending_topic`              | Trending topic in search with no coverage      | `POST /ideaclouds`            |

### Competitive and network

| Type                      | Description                                        | Action endpoint     |
| ------------------------- | -------------------------------------------------- | ------------------- |
| `comparison_opportunity`  | Cross-shopped vehicles for comparison article      | `POST /comparisons` |
| `network_benchmark`       | Peer dealerships have content this site is missing | `POST /ideaclouds`  |
| `network_winning_pattern` | Pattern performing well across peer network        | `POST /ideaclouds`  |

### IdeaCloud and content

| Type                 | Description                                 | Action endpoint    |
| -------------------- | ------------------------------------------- | ------------------ |
| `ideacloud_content`  | IdeaCloud with unanswered questions         | `POST /ideaclouds` |
| `ideacloud_question` | Specific uncovered question in an IdeaCloud | `POST /ideaclouds` |
| `seasonal_content`   | Seasonal topic timely for current period    | `POST /ideaclouds` |

### Events

| Type                 | Description                                    | Action endpoint      |
| -------------------- | ---------------------------------------------- | -------------------- |
| `oem_event`          | OEM campaign or incentive event                | `POST /sales-events` |
| `seasonal_event`     | Seasonal sales event (e.g. year-end clearance) | `POST /sales-events` |
| `model_launch_event` | New model launch or reveal event               | `POST /sales-events` |
| `community_event`    | Community engagement event                     | `POST /sales-events` |
| `local_event`        | Local community event                          | `POST /sales-events` |

### Safety and service

| Type              | Description                                  | Action endpoint    |
| ----------------- | -------------------------------------------- | ------------------ |
| `recall_content`  | NHTSA recall for vehicle in inventory        | `POST /ideaclouds` |
| `service_content` | Service interval milestone for popular model | `POST /ideaclouds` |

## Priority scoring

Every recommendation includes a `priority_score` from 0 to 100:

| Tier       | Score range | Meaning                                                           |
| ---------- | ----------- | ----------------------------------------------------------------- |
| **High**   | 80-100      | High-impact opportunity -- significant traffic or competitive gap |
| **Medium** | 60-79       | Moderate opportunity worth considering                            |
| **Low**    | 0-59        | Lower urgency, still a valid gap                                  |

Use `priority_min` when listing recommendations to focus on the most impactful opportunities:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://api.app.hrizn.io/v1/public/content-intelligence?priority_min=80" \
  -H "X-API-Key: hzk_your_key_here"
```

## Metadata

Each recommendation includes a `metadata` object with type-specific context. The shape varies by `suggestion_type`:

### Vehicle metadata (model pages, comparisons, transitions)

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "make": "Toyota",
  "model": "Camry",
  "year": 2026,
  "inventory_count": 14,
  "estimated_monthly_searches": 8400
}
```

### Comparison metadata

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "vehicles": [
    { "make": "Toyota", "model": "Camry", "year": 2026 },
    { "make": "Honda", "model": "Accord", "year": 2026 }
  ],
  "search_overlap_score": 0.78
}
```

### Search metadata (search gaps, position opportunities)

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "query": "2026 toyota camry towing capacity",
  "impressions": 12500,
  "position": 14.2,
  "clicks": 340
}
```

### Event metadata

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "eventName": "Year-End Clearance Sale",
  "category": "Sales Event",
  "startDate": "2026-12-26",
  "endDate": "2026-12-31",
  "description": "End of year clearance pricing on all remaining 2026 models"
}
```

### Traffic estimate (when available)

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "trafficEstimate": {
    "estimatedMonthlyViews": 2400,
    "confidence": "high",
    "basis": "search_console_data"
  }
}
```

## Recommendation lifecycle

Recommendations follow a four-state lifecycle:

| Status      | Meaning                                                              |
| ----------- | -------------------------------------------------------------------- |
| `active`    | Surfaced to the site, ready to be acted on or dismissed              |
| `dismissed` | Reviewed and declined; stays in DB to prevent re-suggesting          |
| `acted_on`  | Content was created; linked to the article via `acted_on_article_id` |
| `expired`   | Superseded by a newer batch or past the `expires_at` date            |

The nightly pipeline automatically expires old recommendations and generates fresh ones. Dismissed recommendations are kept so the pipeline can use fingerprint deduplication to avoid re-suggesting the same gap.

## Full automation workflow

Here's how to build an end-to-end automation that monitors recommendations and creates content:

<Steps>
  <Step title="Get the summary">
    Call `GET /content-intelligence/summary` to check how many active recommendations exist and which types are most common.

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl "https://api.app.hrizn.io/v1/public/content-intelligence/summary" \
      -H "X-API-Key: hzk_your_key_here"
    ```
  </Step>

  <Step title="List high-priority recommendations">
    Fetch the top recommendations, optionally filtering by type or article type.

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl "https://api.app.hrizn.io/v1/public/content-intelligence?priority_min=80&types=missing_model_page,comparison_opportunity" \
      -H "X-API-Key: hzk_your_key_here"
    ```
  </Step>

  <Step title="Create content from a recommendation">
    Use the `suggestion_type` and `actionable_via` fields to determine which endpoint to call. For example, for `missing_model_page`, extract the vehicle info from `metadata` and create a model landing page:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl -X POST "https://api.app.hrizn.io/v1/public/model-landing-pages" \
      -H "X-API-Key: hzk_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "year": 2026,
        "make": "Toyota",
        "model": "Camry"
      }'
    ```

    The response includes the new article `id`.
  </Step>

  <Step title="Link the recommendation to the article">
    Close the feedback loop by marking the recommendation as acted on:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl -X POST "https://api.app.hrizn.io/v1/public/content-intelligence/c3a1f8b2.../act" \
      -H "X-API-Key: hzk_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{"article_id": "a1b2c3d4..."}'
    ```
  </Step>

  <Step title="Dismiss irrelevant recommendations">
    For recommendations you don't want to act on, dismiss them individually or in bulk:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl -X POST "https://api.app.hrizn.io/v1/public/content-intelligence/bulk-dismiss" \
      -H "X-API-Key: hzk_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{"ids": ["id1", "id2", "id3"]}'
    ```
  </Step>
</Steps>

## Required scopes

| Scope                        | Grants access to                          |
| ---------------------------- | ----------------------------------------- |
| `content_intelligence:read`  | List, get, dismiss, and summary endpoints |
| `content_intelligence:write` | Act-on and bulk-dismiss endpoints         |

For the full automation workflow you'll also need `content:write` or `ideaclouds:write` (depending on which content creation endpoints you call).
