SynapDocs
Hub REST API

Messaging

The Messaging operations of the Hub REST API (15 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.

POST
/messaging/inbound

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
provider*string
Length1 <= length
text?string
Lengthlength <= 50000
Default""
messageId*string
Length1 <= length
externalId?string
Length1 <= length
participantEmail?string
Formatemail
participant?string
Length1 <= length
participantExternalId?string
Length1 <= length
subject?string
Lengthlength <= 2000
sentAt?string
workspaceId?string
Formatuuid
projectId?string
Formatuuid
userId?string
Formatuuid
attachments?array<>
Itemsitems <= 8
headerMessageId?string
Lengthlength <= 998
inReplyTo?string
Lengthlength <= 998
references?array<>
Itemsitems <= 50

Response Body

Record result

application/json
  1. response
recorded*boolean
channelId*string
deduped*boolean
Example Request
curl -X POST 'https://pod.example.com/api/hub/messaging/inbound' \  -H 'Content-Type: application/json' \  -d '{  "provider": "string",  "messageId": "string"}'
Example Response
{  "recorded": true,  "channelId": "string",  "deduped": true}
GET
/messaging/accounts

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

List of connected accounts

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://pod.example.com/api/hub/messaging/accounts'
Example Response
[  {    "id": "string",    "externalId": "string",    "provider": "string",    "displayName": "string",    "status": "connected"  }]
GET
/messaging/auth-url

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

redirectUrl*string
provider?string

Response Body

Auth URL

application/json
  1. response
url*string
Example Request
curl -X GET 'https://pod.example.com/api/hub/messaging/auth-url?redirectUrl=string'
Example Response
{  "url": "string"}
POST
/messaging/accounts/sync

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

Sync result

application/json
  1. response
synced*number
Example Request
curl -X POST 'https://pod.example.com/api/hub/messaging/accounts/sync'
Example Response
{  "synced": 0}
GET
/messaging/service-config

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

Connection state

application/json
  1. response
configured*boolean
capabilityKey*string
capabilityId*string|null
problem*|
Value in"not-installed""no-key""unreadable"null
message*string|null
webhook*
Example Request
curl -X GET 'https://pod.example.com/api/hub/messaging/service-config'
Example Response200
{  "configured": true,  "capabilityKey": "string",  "capabilityId": "string",  "problem": "not-installed",  "message": "string",  "webhook": {    "state": "registered",    "url": "string",    "missingEvents": [      "string"    ],    "error": "string",    "checkedAt": "string"  }}
POST
/messaging/accounts/{accountId}/import-history

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

accountId*string

Response Body

Import queued — or, for an agent, proposed for the person's review ({ status: 'proposed', proposalId, reviewUrl })

application/json
  1. response
queued*boolean
accountId*string
progress*|null
Example Request
curl -X POST 'https://pod.example.com/api/hub/messaging/accounts/string/import-history'
Example Response
{  "queued": true,  "accountId": "string",  "progress": {    "status": "running",    "cursor": "string",    "updatedAt": "string",    "chatsImported": 0,    "messagesRecorded": 0,    "reason": "string"  }}
DELETE
/messaging/accounts/{accountId}

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

accountId*string

Response Body

Account disconnected

application/json
  1. response
success*boolean
Example Request
curl -X DELETE 'https://pod.example.com/api/hub/messaging/accounts/string'
Example Response
{  "success": true}
GET
/messaging/conversations

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

entityId?string
contactEntityId?string

Response Body

Conversations

application/json
  1. response
conversations*array<|>
Example Request
curl -X GET 'https://pod.example.com/api/hub/messaging/conversations'
Example Response
{  "conversations": [    {      "channelId": "string",      "externalThreadId": "string",      "provider": "string",      "participantName": "string",      "participantExternalId": "string",      "lastMessageAt": "string",      "lastMessagePreview": "string",      "unread": true,      "accountId": "string",      "readOnly": true    }  ]}
POST
/messaging/channels/connect

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
entityId?string
externalThreadId*string
accountId*string
provider*string
participantName?string

Response Body

Channel created, upgraded, or already exists

application/json
  1. response
channelId*string
Example Request
curl -X POST 'https://pod.example.com/api/hub/messaging/channels/connect' \  -H 'Content-Type: application/json' \  -d '{  "externalThreadId": "string",  "accountId": "string",  "provider": "string"}'
Example Response
{  "channelId": "string"}
DELETE
/messaging/channels/{channelId}

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

channelId*string

Response Body

Channel unlinked

application/json
  1. response
success*boolean
Example Request
curl -X DELETE 'https://pod.example.com/api/hub/messaging/channels/string'
Example Response
{  "success": true}
POST
/messaging/channels/{channelId}/mark-read

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

channelId*string

Response Body

Marked as read

application/json
  1. response
success*boolean
Example Request
curl -X POST 'https://pod.example.com/api/hub/messaging/channels/string/mark-read'
Example Response
{  "success": true}
GET
/messaging/linked-unread

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

Unread linked conversations

application/json
  1. response
items*array<>
Example Request
curl -X GET 'https://pod.example.com/api/hub/messaging/linked-unread'
Example Response
{  "items": [    {      "entityId": "string",      "channelId": "string",      "externalThreadId": "string",      "provider": "string",      "participantName": "string",      "lastMessagePreview": "string",      "lastMessageAt": "string"    }  ]}
GET
/messaging/conversations/{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

accountId*string

Response Body

Messages

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://pod.example.com/api/hub/messaging/conversations/string/messages?accountId=string'
Example Response
[  {    "externalMessageId": "string",    "threadId": "string",    "senderName": "string",    "body": "string",    "sentAt": "string",    "direction": "inbound",    "attachments": [      {        "name": "string",        "url": "string"      }    ]  }]
POST
/messaging/conversations/{threadId}/send

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
accountId*string
body*string

Response Body

Message sent

application/json
  1. response
success*boolean
Example Request
curl -X POST 'https://pod.example.com/api/hub/messaging/conversations/string/send' \  -H 'Content-Type: application/json' \  -d '{  "accountId": "string",  "body": "string"}'
Example Response
{  "success": true}
GET
/messaging/channels

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

provider?string
unreadOnly?string
Value in"true""false"

Response Body

External channels list

application/json
  1. response
channels*array<>
Example Request
curl -X GET 'https://pod.example.com/api/hub/messaging/channels'
Example Response
{  "channels": [    {      "channelId": "string",      "provider": "string",      "threadId": "string",      "title": "string",      "participantName": "string",      "lastMessageAt": "string",      "lastMessagePreview": "string",      "unread": true,      "entityId": "string",      "messageCount": 0    }  ]}

On this page