SynapDocs
Hub REST API

Threads

The Threads operations of the Hub REST API (10 operations).

For BuildersOpen-source podSynap Cloud

Generated from Synap-core/backend main at 24fabe7, which can be newer than the stable release self-hosters install.

GET
/threads

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Query Parameters

userId*string
workspaceId?string
limit?string

Response Body

Threads list

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://pod.example.com/api/hub/threads?userId=string'
Example Response
[  {    "id": "string",    "title": "string",    "assignedAgentId": "string",    "parentChannelId": "string",    "branchPurpose": "string",    "contextSummary": "string",    "createdAt": "string",    "updatedAt": "string"  }]
POST
/threads

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Request Body

application/json
  1. body
userId*string
workspaceId*string
title?string
parentChannelId?string
agentId?string
branchPurpose?string
contextObjectType?string
contextObjectId?string
externalSource?string
externalId?string

Response Body

Thread created or reused

application/json
  1. response
id*string
title?string|null
reused?boolean
Example Request
curl -X POST 'https://pod.example.com/api/hub/threads' \  -H 'Content-Type: application/json' \  -d '{  "userId": "string",  "workspaceId": "string"}'
Example Response
{  "id": "string",  "title": "string",  "reused": true}
GET
/threads/{threadId}/context

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Response Body

Success

Example Request
curl -X GET 'https://pod.example.com/api/hub/threads/{threadId}/context'
Example Response
Empty
PATCH
/threads/{threadId}/context

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Response Body

Success

Example Request
curl -X PATCH 'https://pod.example.com/api/hub/threads/{threadId}/context'
Example Response
Empty
POST
/threads/{threadId}/link-entity

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Response Body

Success

Example Request
curl -X POST 'https://pod.example.com/api/hub/threads/{threadId}/link-entity'
Example Response
Empty
POST
/threads/{threadId}/link-document

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Response Body

Success

Example Request
curl -X POST 'https://pod.example.com/api/hub/threads/{threadId}/link-document'
Example Response
Empty
GET
/threads/{threadId}/branches

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Path Parameters

threadId*string

Response Body

Branches

application/json
  1. response
branches*array<>
Example Request
curl -X GET 'https://pod.example.com/api/hub/threads/string/branches'
Example Response
{  "branches": [    {      "channelId": "string",      "branchPurpose": "string",      "status": "string"    }  ]}
GET
/threads/{threadId}/messages

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Path Parameters

threadId*string

Query Parameters

limit?integer

Return the newest N messages (oldest first). Omit for every message.

Range1 <= value <= 200
before?string

ISO time: only messages strictly before it.

Formatdate-time
beforeId?string

The id of the message a page ended on: pages exactly before it (breaks a tie of instants).

Response Body

Messages

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://pod.example.com/api/hub/threads/string/messages'
Example Response
[  {    "id": "string",    "role": "system",    "content": "string",    "userId": "string",    "timestamp": "string",    "sessionId": "string",    "authorType": "string",    "metadata": {      "property1": null,      "property2": null    },    "direction": "inbound",    "deliveryStatus": "sent",    "externalSource": "string",    "externalMessageId": "string"  }]
POST
/threads/{threadId}/messages

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Path Parameters

threadId*string

Request Body

application/json
  1. body
role*string
Value in"system""assistant""user"
content*string
userId*string
metadata?
autoRespond?boolean

If true and role=user, schedules an A2AI agent reply via pg-boss.

kind?string

An AGENT's post only: 'question' when the person is needed (in a session room it pushes them, once per session window); 'update' (default) for progress/results — in-app only, never a push.

Value in"question""update"
slotLabel?string

With kind 'question' (agent posts only): the label of the session output the question is about. The question is filed ON that output (the owner's, with the question as its why), and the owner's answer is recorded as its answer and hands it back to the agent.

Lengthlength <= 500
ask?||||

With kind 'question' + slotLabel (agent posts only): HOW the person answers — the output's typed ask (confirm | choose | form | act | provide). Omit for a free-text answer.

intent?string

An AGENT's message to ANOTHER session — the session whose room this thread is: blocked_on_you | handoff (may wake its agent) | done | fyi (never wake). The pod stamps the sender session and the target; it never notifies the person.

Value in"blocked_on_you""handoff""done""fyi"
fromSessionId?string

With intent: YOUR session, when it is not the one this conversation is bound to. It must be yours.

Formatuuid
refs?array<>

With intent: the state behind the message (a blocked_by session, a delegated slot, a proposal).

Itemsitems <= 10
cause?string

With intent: the id of the session_message that woke you, when this replies to it.

Formatuuid

Response Body

Inserted message id

application/json
  1. response
success*true
Value intrue
messageId*string
slot?

An agent's question naming a slotLabel: 'blocked' when the question is now that output's ask; otherwise why not (unknown_label, already_done, no_session, not_found, failed).

sessionPost?

With intent: what the pod stamped — the sender and target sessions, and whether the delivery may wake the target's agent.

note?string

With intent: why a wake-worthy message was delivered without waking anyone.

Example Request
curl -X POST 'https://pod.example.com/api/hub/threads/string/messages' \  -H 'Content-Type: application/json' \  -d '{  "role": "system",  "content": "string",  "userId": "string"}'
Example Response
{  "success": true,  "messageId": "string",  "slot": {    "status": "string"  },  "sessionPost": {    "intent": "blocked_on_you",    "from": {      "sessionId": "string"    },    "to": {      "sessionId": "string"    },    "hop": 0,    "wake": true,    "wakeHeld": "hop_limit"  },  "note": "string"}
POST
/threads/{threadId}/messages.batch

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Path Parameters

threadId*string

Request Body

application/json
  1. body
messages*array<>
Items1 <= items <= 100
autoRespond?boolean

If true, the LAST user message in the batch fires an A2AI reply.

Response Body

Inserted message ids

application/json
  1. response
messageIds*array<string>
Example Request
curl -X POST 'https://pod.example.com/api/hub/threads/string/messages.batch' \  -H 'Content-Type: application/json' \  -d '{  "messages": [    {      "role": "system",      "content": "string",      "userId": "string"    }  ]}'
Example Response
{  "messageIds": [    "string"  ]}

On this page