Agent Thread

The agent thread resource.

Basehttps://rest.carbon.ms/agentThread
GET/agentThread

List agent threads

Retrieve a paginated list of agent threads. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GEThttps://rest.carbon.ms/agentThread
curl --request GET \
  --url 'https://rest.carbon.ms/agentThread?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "companyId": "xyz789",
    "userId": "xyz789",
    "modelId": "xyz789",
    "createdBy": "string",
    "createdAt": "2026-01-01T00:00:00Z",
    "title": "string",
    "lastContext": "string"
  }
]
GET/agentThread

Retrieve a agent thread

Fetch a single agent thread by filtering on `id`.

Query parameters

idstring

Match on the agent thread's `id`, e.g. `eq.{id}`.

GEThttps://rest.carbon.ms/agentThread
curl --request GET \
  --url 'https://rest.carbon.ms/agentThread?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "userId": "xyz789",
  "modelId": "xyz789",
  "createdBy": "string",
  "createdAt": "2026-01-01T00:00:00Z",
  "title": "string",
  "lastContext": "string"
}
POST/agentThread

Create a agent thread

Create a new agent thread.

Body parameters

userIdstringrequired

References user.id

titlestring
modelIdstringrequired
lastContextobject
archivedAttimestamp
POSThttps://rest.carbon.ms/agentThread
curl --request POST \
  --url https://rest.carbon.ms/agentThread \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"userId":"xyz789","modelId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "userId": "xyz789",
  "modelId": "xyz789",
  "createdBy": "string",
  "createdAt": "2026-01-01T00:00:00Z",
  "title": "string",
  "lastContext": "string"
}
PATCH/agentThread

Update a agent thread

Update an existing agent thread, matched on `id`.

Body parameters

userIdstringrequired

References user.id

titlestring
modelIdstringrequired
lastContextobject
archivedAttimestamp
PATCHhttps://rest.carbon.ms/agentThread
curl --request PATCH \
  --url 'https://rest.carbon.ms/agentThread?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"userId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "userId": "xyz789",
  "modelId": "xyz789",
  "createdBy": "string",
  "createdAt": "2026-01-01T00:00:00Z",
  "title": "string",
  "lastContext": "string"
}
DELETE/agentThread

Delete a agent thread

Delete a agent thread, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the agent thread to delete, e.g. `eq.{id}`.

DELETEhttps://rest.carbon.ms/agentThread
curl --request DELETE \
  --url 'https://rest.carbon.ms/agentThread?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content