~/docs/api-reference / chats
Chats
Create, list, and retrieve chats via the v1 API.
Chats represent conversations with the orchestrator. Each chat belongs to a workspace and contains a sequence of user and assistant messages.
POST /api/v1/chats
Create a new chat
shell
curl -X POST http://localhost:3000/api/v1/chats \
-H "Authorization: Bearer op_api_your_key_here" \
-H "Content-Type: application/json" \
-d '{"agentType": "orchestrator"}'| Field | Type | Description |
|---|---|---|
| agentType | string | Defaults to orchestrator. |
Response: 201 with the created chat object.
GET /api/v1/chats
List chats in a workspace
shell
curl http://localhost:3000/api/v1/chats?page=1&pageSize=20 \
-H "Authorization: Bearer op_api_your_key_here"Query params: page, pageSize, agentType.
Response: {"data": [...], "total": number} — where data is an array of chat objects.
GET /api/v1/chats/:chatId
Get a single chat by ID
shell
curl http://localhost:3000/api/v1/chats/f216fd8d-43b6-48aa-976b-af88227f86c3 \
-H "Authorization: Bearer op_api_your_key_here"Response: {"chat": {...}} — the chat object contains:
id: the unique identifier of the chat.title: the generated title of the conversation.status: tracks the overall state of the chat ("idle","pending","processing","completed","failed", or"stopped").createdAt&updatedAt: timestamps of when the chat was created and last updated.
Error Responses
| Code | Meaning |
|---|---|
| 401 | Invalid or missing API key. |
Send messages and trigger the orchestrator.Messages