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

# Manual conversation-intelligence re-run for inbox threads

> POST /conversations/:id/analyze-intelligence re-scores an inbox thread on demand: sentiment, intent, topics, and language, persisted onto the conversation record. When to use it, who can call it, and the exact request and response.

# Manual conversation-intelligence re-run for inbox threads

Orbit scores conversations in the background as customer messages accumulate. The automatic loop over agent conversations is described in [Conversation intelligence](/concepts/conversation-intelligence); inbox threads are scored by the same classifier, and this guide covers the on-demand path: `POST /conversations/:id/analyze-intelligence`, which re-scores one inbox thread at the moment you call it.

## What the endpoint does

`POST /conversations/:id/analyze-intelligence` runs the conversation-intelligence classifier over the thread's message history and writes the fresh scores back onto that conversation's record: a sentiment score and label, the primary intent with confidence and entities, the topic list, and the detected language. The response echoes exactly what was persisted, plus an `intelligence_analyzed_at` timestamp.

The call is repeatable. Each run overwrites the intelligence fields with newly computed values and refreshes the timestamp; everything else stored on the conversation (custom fields, tags, escalation state) is preserved.

## When to use it

* **Messages arrived after the automatic pass.** A channel delivered part of the history late, or ingestion stalled, and the stored scores describe only part of the thread. Re-run once the thread is complete.
* **An update hook did not fire.** Your integration drives re-analysis from a `thread.update` event and one thread was missed. Force the pass yourself instead of waiting for the next automatic scan.
* **You edited the thread.** You adjusted tags or custom fields during a QA review and want a fresh analysis pass recorded against the thread in its current state.

## Who can call it

The endpoint writes to the conversation record, so it carries the same gate as the other conversation write routes: an `owner`, `admin`, or `developer` role, and the `conversations:write` scope for API-key callers. Viewer and agent seats receive a 403, as do keys without the scope. Like the other conversation writes, it is rate-limited per authenticated caller.

## Request and response

No request body is required; the conversation id travels in the path.

```bash theme={null}
curl -X POST "https://api.orbit.devotel.io/api/v1/conversations/<conversation-id>/analyze-intelligence" \
  -H "X-API-Key: dv_live_..."
```

A successful run returns the standard envelope with the persisted fields under `data`:

```json theme={null}
{
  "data": {
    "conversation_id": "<conversation-id>",
    "sentiment": 0.42,
    "sentiment_label": "positive",
    "sentiment_trajectory": [
      { "index": 0, "label": "neutral", "score": 0 },
      { "index": 1, "label": "positive", "score": 0.84 }
    ],
    "primary_intent": "refund request",
    "intent_confidence": 0.91,
    "intent_entities": ["order 1042"],
    "primary_topic": "billing dispute",
    "topics": ["billing dispute", "refund"],
    "language": "en",
    "intelligence_analyzed_at": "2026-10-07T09:14:02.183Z"
  },
  "meta": {
    "request_id": "<request-id>",
    "timestamp": "2026-10-07T09:14:02.210Z"
  }
}
```

The fields you will read most often: `sentiment_label` (`positive` / `neutral` / `negative`) with the numeric `sentiment` score behind it, `primary_intent` with `intent_confidence`, `topics` with `primary_topic`, and `language`. `sentiment_trajectory` is the per-customer-turn breakdown the overall score is averaged from.

## What persists on the conversation

The same fields returned in the response are merged into the conversation's `metadata`, alongside `intelligence_analyzed_at`. The merge touches only the intelligence keys, so other metadata you have written (custom fields, escalation state, translation pins) survives a re-run. Because the results live on the conversation record in your tenant schema, every read surface that shows conversation metadata (the Inbox, `GET /conversations/:id`, your warehouse sync) sees the re-run's values, and the scores inherit the same tenant data-residency posture as the rest of your message traffic.

## The same classifier as agent conversations

The endpoint invokes the exact classifier the agent-conversation endpoint (`POST /agents/conversations/:conversationId/analyze-intelligence`) uses; inbox messages are normalised into the same role/content transcript (inbound messages count as the customer turns) before scoring. The output shape is therefore identical to the scores recorded on automatically analyzed agent threads, and the dashboard aggregates read both without distinction.

Long threads are bounded the same way on both paths: the pass reads at most the 500 most recent messages, and the sentiment trajectory covers the last 12 customer turns.

## Errors

| Status | When you get it | What to do |
| - | - | - |
| 403 | The caller's role or key scope does not cover conversation writes. | Use an owner/admin/developer session, or a key with `conversations:write`. |
| 404 | No conversation with that id exists in your tenant. | Check the id against `GET /conversations`. |
| 422 | The thread has no inbound customer messages. | The classifier needs at least one customer turn; outbound-only threads cannot be scored. |
| 503 | The conversation-intelligence classifier is not configured on the API. | Scoring is unavailable until the classifier is enabled; no partial results are written. |

<Note>
  A re-run replaces the stored intelligence fields with the new pass's values. If
  you need the previous scores for an audit trail, export them before calling the
  endpoint.
</Note>

## Related reading

* [Conversation intelligence](/concepts/conversation-intelligence) — what the automatic loop computes, and how the aggregates read it.
* [Read the Conversation Intelligence panel](/guides/conversation-intelligence) — the aggregate dashboard view across all threads.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.