FruxonDocs
ApiAgent topics

Get why a topic was opened, with the main-conversation turn that opened it.

A topic opened from inside a conversation — handed to the team, opened by the agent, or a customer coming back about a closed case — was opened by a run in the participant's main conversation, so the customer's message and the agent's reply that caused it are not in the topic's own thread. This returns how the topic was opened (`kind`), the agent's `reason` and what it `tried`, the customer's words, the earlier topic a continuation `continues`, the `case` it belongs to, the `handoff` made in the same run, and that run's rows as `openingTurn.messages` — shaped like the thread's messages, oldest first. A topic created before origins were recorded is worked out at read time and flagged `derived`: its opening run is the one on its origin session that was in flight when it was created. `openingTurn` is null when that run is not known (its record was purged, or none matched) or saved no rows; `kind` is null when it cannot be told. Returns 404 for a home topic and when no topic with that id belongs to the agent.

GET
/v1/tenants/{tenant}/agents/{agent}/topics/{topic}/origin
AuthorizationBearer <token>

JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.

In: header

Path Parameters

agent*string

The unique identifier of the agent.

topic*string

The unique identifier of the topic.

Formatuuid
tenant*string

The tenant identifier

Response Body

curl -X GET "https://api.fruxon.com/v1/tenants/string/agents/string/topics/497f6eca-6276-4993-bfeb-53cbbbba6f08/origin"
{
  "kind": "ESCALATION",
  "derived": false,
  "openedAt": 0,
  "goal": "string",
  "reason": "string",
  "tried": "string",
  "customerWords": [
    "string"
  ],
  "continues": {
    "topicId": "00000000-0000-0000-0000-000000000000",
    "goal": "string",
    "resolvedAt": 0,
    "outcomeOneLiner": "string"
  },
  "case": {
    "workItemId": "00000000-0000-0000-0000-000000000000",
    "sequence": 0,
    "roleKey": "string"
  },
  "handoff": {
    "reason": "string",
    "openedAt": 0
  },
  "openingTurn": {
    "executionRecordId": "00000000-0000-0000-0000-000000000000",
    "sessionId": "string",
    "topicId": "00000000-0000-0000-0000-000000000000",
    "messages": [
      {
        "id": "string",
        "role": "string",
        "agentId": "string",
        "content": "string",
        "createdAt": 0,
        "occurredAt": null,
        "sessionId": "string",
        "topicId": null,
        "internal": false,
        "executionRecordId": null,
        "traceStepId": "string",
        "origin": "UNSPECIFIED",
        "author": "UNSPECIFIED",
        "attachments": [],
        "withheldReason": null,
        "withheldOwnership": null
      }
    ]
  },
  "reopens": [
    {
      "at": 0,
      "executionRecordId": "00000000-0000-0000-0000-000000000000",
      "reason": "string",
      "customerWords": [
        "string"
      ]
    }
  ]
}
Empty
Empty
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}