Conversation API
The full endpoint reference is generated from the OpenAPI definition at /conversation-api/index.html. This guide covers the parts that the reference does not explain: authentication, starting a conversation, waiting and streaming, tags, files, notification channels, tracing and routes.
Authentication
Send the API key token as a bearer token. The token is shown once, when you create the key. The API key needs the scope Converse with meshes. Every example in this guide uses this form:
curl -H "Authorization: Bearer <API_KEY_TOKEN>" https://api.partite.ai/conversations/<CONVERSATION_ID>To let people or other systems call with their own tokens, use an access point. Its callers send their token the same way, to the same paths under the access point’s URL.
Start a conversation
Send POST /conversations with a JSON body. The mesh object names the mesh and exactly one of its versions:
"version": 3uses version 3."version_label": "prod"uses the version with the labelprod."draft": trueuses the draft. The draft is never used by default.
With input, the same call also sends the first message. Name the intent when the mesh has more than one.
curl -H "Authorization: Bearer <API_KEY_TOKEN>" \
-X POST https://api.partite.ai/conversations \
-H "Content-Type: application/json" \
-d '{
"mesh": {"id": "<MESH_ID>", "version_label": "prod"},
"intent": "AnalyzeIssue",
"input": {"issueText": "App crashes when saving after upgrade to v2.3"}
}'The response is 201. It has the conversation: id, external_id, mesh (id and version_id), tags, created_at and updated_at. When you sent input, it also has the request that the message started. The Location header points to the conversation.
To list the intents of a conversation, with the schemas of their inputs and responses, send GET /conversations/{conversation_id}/intents. The list leaves out the intents that a boundary doesn’t let the caller use.
Send a message
Send POST /conversations/{conversation_id}/requests. The body has input, and optionally intent and tags.
curl -H "Authorization: Bearer <API_KEY_TOKEN>" \
-X POST https://api.partite.ai/conversations/<CONVERSATION_ID>/requests \
-H "Content-Type: application/json" \
-d '{"input": {"issueText": "It also crashes on export"}}'The response is 201 with the request. A request has these fields: id, status, input, tags and created_at. It also has one of these fields, depending on the status:
| Status | Field |
|---|---|
running | none |
waiting | tasks: the open tasks. See Client tasks. |
completed | response |
failed | error |
cancelled | none |
GET /conversations/{conversation_id}/requests/{request_id} returns a request. GET /conversations/{conversation_id}/requests returns all requests of the conversation, oldest first.
To cancel a request, send POST .../requests/{request_id}/cancel.
Conversation identity
Set external_id when you start a conversation. Use your own ticket ID or thread ID. The external ID follows these rules:
- It has 1 to 255 bytes.
- It is immutable.
- It is unique in your organization. A duplicate returns 409.
Every path that takes {conversation_id} also takes extid= followed by the percent-encoded external ID.
curl -H "Authorization: Bearer <API_KEY_TOKEN>" \
https://api.partite.ai/conversations/extid=ticket-4821Waiting and streaming
By default, the POSTs and GET on a request return JSON at once. A new request is usually still running.
To wait for the result, add ?wait=N. The call returns when the request leaves running, or after N seconds. The maximum is 50 seconds. wait works on POST /conversations, on POST .../requests and on GET .../requests/{request_id}.
curl -H "Authorization: Bearer <API_KEY_TOKEN>" \
"https://api.partite.ai/conversations/<CONVERSATION_ID>/requests/<REQUEST_ID>?wait=30"To stream the events of a request, send GET .../requests/{request_id}/events. You can also stream from the POST that starts the request: send a streaming Accept header on it. The Accept header sets the format:
| Accept | Result |
|---|---|
text/event-stream | Server-sent events (SSE). This is the default for GET .../events. |
application/jsonl | JSON lines. application/x-ndjson also works. |
curl -N -H "Authorization: Bearer <API_KEY_TOKEN>" \
-H "Accept: application/jsonl" \
https://api.partite.ai/conversations/<CONVERSATION_ID>/requests/<REQUEST_ID>/eventsEvery stream starts with a started event. It has the conversation_id and the request_id. The other event types are thinking, message, task, task_response, response, error, cancelled and server_error.
The events response, error and cancelled end the request and the stream. A stream stays open while the request waits on a task.
When no event has come for 15 seconds, a stream sends a keepalive so the connection stays open: an SSE comment, or an empty line in JSON lines. Skip empty lines when you read JSON lines.
In SSE, the event name is the event type. The exception is error, which is named request_error, because a browser’s EventSource fires error when the connection fails.
A server_error event means the server could not read the stream further. To resume a stream, send GET .../events again with Last-Event-ID set to the last event ID that you received. Never repeat the POST to resume.
Tags
Tags are name and value pairs. Set them in the body:
tagsonPOST /conversationssets the conversation tags.tagsonPOST .../requestssets the request tags.
"tags": [{"name": "env", "value": "dev"}, {"name": "developer", "value": "bob"}]Tags can’t be changed after they are set. Tags drive these features:
- Conversation tags route MCP tunnel subscriptions.
- Memory reads the conversation tags and the request tags together, to select whose memories apply and to identify speakers.
- Boundaries read and set tags.
- Schedules add the tags
schedule_idandscheduled_for.
A caller can send any tags. When a tag decides whose data an agent reads, set it with a boundary instead. See Tags.
Files
To attach files to one message, send multipart/form-data. Put the JSON body in a part named params. Put each file in a part named attachments. The input refers to a file as {"$ref": "attachment://<filename>"}.
curl -H "Authorization: Bearer <API_KEY_TOKEN>" \
-X POST https://api.partite.ai/conversations/<CONVERSATION_ID>/requests \
-F 'params={"input": {"report": {"$ref": "attachment://crash.log"}}};type=application/json' \
-F 'attachments=@crash.log'To give the conversation files that later messages can use, send them to POST /conversations/{conversation_id}/resources in parts named files. GET .../resources lists everything the conversation holds, including what MCP servers added. Each entry has a reference, such as {"$ref": "resource://r1"}. Put the reference in an input to refer to the resource. To download the content of a resource, send GET .../resources/{handle}/content.
A JSON body can be at most 4 MiB. A multipart body can be at most 32 MiB, files included.
Notification channels
A notification channel is one feed for many conversations. Every request output of every conversation that is bound to the channel appears in the channel. The outputs appear in one ordered sequence.
To create a channel, send PUT /notification-channels/{id}. The response is 201 for a new channel and 200 if the channel existed. Then bind conversations to it: set notification_channel to the channel ID in the body when you start a conversation. A channel that doesn’t exist is an error.
curl -H "Authorization: Bearer <API_KEY_TOKEN>" \
-X PUT https://api.partite.ai/notification-channels/support-inboxTo read a channel, send GET /notification-channels/{id}/events. The Accept header sets the format:
| Accept | Result |
|---|---|
text/event-stream | Streams server-sent events (SSE). This is the default. |
application/jsonl | Streams JSON lines. application/x-ndjson also works. |
application/json | Returns one page. Use limit (default 100, maximum 1000). The response has a next cursor. |
A channel’s stream sends the same keepalives as a request’s: an SSE comment, or an empty line in JSON lines.
If the Accept header allows none of these formats, the response is 406.
curl -H "Authorization: Bearer <API_KEY_TOKEN>" \
-H "Accept: application/json" \
"https://api.partite.ai/notification-channels/support-inbox/events?limit=100"To resume a stream, set Last-Event-ID to an event ID from the channel.
Tracing
Set "tracing": false when you start a conversation to turn tracing off for the whole conversation. Tracing is on by default. You cannot change the setting later.
curl -H "Authorization: Bearer <API_KEY_TOKEN>" \
-X POST https://api.partite.ai/conversations \
-H "Content-Type: application/json" \
-d '{"mesh": {"id": "<MESH_ID>", "version_label": "prod"}, "tracing": false}'Routes
A Route picks a Mesh version for a new conversation. To use a Route, set route_id instead of mesh when you start a conversation.
{"route_id": "<ROUTE_ID>", "input": {"issueText": "..."}}The Route picks a version at random, by weight. For the Route settings, see Routes.
Errors
Errors are application/problem+json documents (RFC 9457). The param field names the input that the problem is with. A body field that the API does not know is an error.
When a boundary refuses a new conversation or request, the response is 403. The detail is the message of the rule that refused, and decision_id is the ID of the decision. An admin can look the decision up under Access > Decisions. The response also has the boundary and rule names, unless the caller came through an access point.
If your organization is on hold, for example because it reached a usage limit, the response is 429. The Retry-After header gives the number of seconds to wait before you try again.