SynapSynapDocs
Hub REST API

Sessions

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

For BuildersOpen-source podSynap CloudGenerated from Synap-core/backend@c31e261ab (main)
POST
/sessions/getOrCreate

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
channelId*string
bootstrapStateId?string

Compacted-state ID to bootstrap the session from.

Response Body

Session

application/json
  1. response
id*string
channelId*string
userId?string
workspaceId?string|null
bootstrapStateId?string|null
producedStateId?string|null
closedAt?string||null
createdAt?string|
updatedAt?string|
metadata?
[key: string]?unknown
Example Request
curl -X POST 'https://pod.example.com/api/hub/sessions/getOrCreate' \  -H 'Content-Type: application/json' \  -d '{  "channelId": "string"}'
Example Response
{  "id": "string",  "channelId": "string",  "userId": "string",  "workspaceId": "string",  "bootstrapStateId": "string",  "producedStateId": "string",  "closedAt": "string",  "createdAt": "string",  "updatedAt": "string",  "metadata": {    "property1": null,    "property2": null  },  "property1": null,  "property2": null}
GET
/sessions/active

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

channelId*string

Response Body

Active session, or null if none is open

application/json
  1. response
id*string
channelId*string
userId?string
workspaceId?string|null
bootstrapStateId?string|null
producedStateId?string|null
closedAt?string||null
createdAt?string|
updatedAt?string|
metadata?
[key: string]?unknown
Example Request
curl -X GET 'https://pod.example.com/api/hub/sessions/active?channelId=string'
Example Response
{  "id": "string",  "channelId": "string",  "userId": "string",  "workspaceId": "string",  "bootstrapStateId": "string",  "producedStateId": "string",  "closedAt": "string",  "createdAt": "string",  "updatedAt": "string",  "metadata": {    "property1": null,    "property2": null  },  "property1": null,  "property2": null}

Get a session by id

GET
/sessions/{sessionId}

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

sessionId*string

Response Body

Session

application/json
  1. response
id*string
channelId*string
userId?string
workspaceId?string|null
bootstrapStateId?string|null
producedStateId?string|null
closedAt?string||null
createdAt?string|
updatedAt?string|
metadata?
[key: string]?unknown
Example Request
curl -X GET 'https://pod.example.com/api/hub/sessions/string'
Example Response
{  "id": "string",  "channelId": "string",  "userId": "string",  "workspaceId": "string",  "bootstrapStateId": "string",  "producedStateId": "string",  "closedAt": "string",  "createdAt": "string",  "updatedAt": "string",  "metadata": {    "property1": null,    "property2": null  },  "property1": null,  "property2": null}

Update a session

PATCH
/sessions/{sessionId}

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

sessionId*string

Request Body

application/json
  1. body
metadata?
bootstrapStateId?string
producedStateId?string
[key: string]?unknown

Response Body

Updated session

application/json
  1. response
id*string
channelId*string
userId?string
workspaceId?string|null
bootstrapStateId?string|null
producedStateId?string|null
closedAt?string||null
createdAt?string|
updatedAt?string|
metadata?
[key: string]?unknown
Example Request
curl -X PATCH 'https://pod.example.com/api/hub/sessions/string' \  -H 'Content-Type: application/json' \  -d '{  "property1": null,  "property2": null}'
Example Response
{  "id": "string",  "channelId": "string",  "userId": "string",  "workspaceId": "string",  "bootstrapStateId": "string",  "producedStateId": "string",  "closedAt": "string",  "createdAt": "string",  "updatedAt": "string",  "metadata": {    "property1": null,    "property2": null  },  "property1": null,  "property2": null}
GET
/sessions

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

channelId*string
limit?string

Response Body

Sessions

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://pod.example.com/api/hub/sessions?channelId=string'
Example Response
[  {    "id": "string",    "channelId": "string",    "userId": "string",    "workspaceId": "string",    "bootstrapStateId": "string",    "producedStateId": "string",    "closedAt": "string",    "createdAt": "string",    "updatedAt": "string",    "metadata": {      "property1": null,      "property2": null    },    "property1": null,    "property2": null  }]

Close a session

POST
/sessions/{sessionId}/close

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

sessionId*string

Request Body

application/json
  1. body
producedStateId?string

Compacted-state ID written at session close.

Response Body

Closed session

application/json
  1. response
id*string
channelId*string
userId?string
workspaceId?string|null
bootstrapStateId?string|null
producedStateId?string|null
closedAt?string||null
createdAt?string|
updatedAt?string|
metadata?
[key: string]?unknown
Example Request
curl -X POST 'https://pod.example.com/api/hub/sessions/string/close' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "channelId": "string",  "userId": "string",  "workspaceId": "string",  "bootstrapStateId": "string",  "producedStateId": "string",  "closedAt": "string",  "createdAt": "string",  "updatedAt": "string",  "metadata": {    "property1": null,    "property2": null  },  "property1": null,  "property2": null}
GET
/compacted-states

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

channelId*string
limit?string

Response Body

Compacted states (newest first)

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://pod.example.com/api/hub/compacted-states?channelId=string'
Example Response
[  {    "id": "string",    "channelId": "string",    "summary": "string",    "facts": [      null    ],    "createdAt": "string",    "property1": null,    "property2": null  }]

Create a compacted state

POST
/compacted-states

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
channelId*string
sessionId?string
summary?string
facts?array<unknown>
metadata?
[key: string]?unknown

Response Body

Created compacted state

application/json
  1. response
id*string
channelId*string
summary?string
facts?array<unknown>
createdAt?string|
[key: string]?unknown
Example Request
curl -X POST 'https://pod.example.com/api/hub/compacted-states' \  -H 'Content-Type: application/json' \  -d '{  "channelId": "string",  "property1": null,  "property2": null}'
Example Response
{  "id": "string",  "channelId": "string",  "summary": "string",  "facts": [    null  ],  "createdAt": "string",  "property1": null,  "property2": null}
GET
/compacted-states/latest

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

channelId*string

Response Body

Latest compacted state, or null

application/json
  1. response
id*string
channelId*string
summary?string
facts?array<unknown>
createdAt?string|
[key: string]?unknown
Example Request
curl -X GET 'https://pod.example.com/api/hub/compacted-states/latest?channelId=string'
Example Response
{  "id": "string",  "channelId": "string",  "summary": "string",  "facts": [    null  ],  "createdAt": "string",  "property1": null,  "property2": null}
GET
/compacted-states/{stateId}

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

stateId*string

Response Body

Compacted state

application/json
  1. response
id*string
channelId*string
summary?string
facts?array<unknown>
createdAt?string|
[key: string]?unknown
Example Request
curl -X GET 'https://pod.example.com/api/hub/compacted-states/string'
Example Response
{  "id": "string",  "channelId": "string",  "summary": "string",  "facts": [    null  ],  "createdAt": "string",  "property1": null,  "property2": null}