SynapSynapDocs
Hub REST API

Threads

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

For BuildersOpen-source podSynap CloudGenerated from Synap-core/backend@c31e261ab (main)
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

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    }  }]
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.

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).

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"  }}
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"  ]}