API essentials
Call your deployment's API to chat with agents and process Cases from your own systems.
Everything the platform does runs through an HTTP API under /v1 on your
deployment's host. This page covers the parts customers integrate against
most. Interactive endpoint documentation is served by your deployment at
/docs on the API host.
Authentication
Two kinds of bearer keys, created in the platform and shown once:
| Key | Prefix | Scope |
|---|---|---|
| Agent API key | sak_ | One agent, for chat integrations |
| Workspace API key | sk-ws- | One workspace, for builder and Case automation |
Send the key on every request:
curl https://<your-deployment-host>/v1/... \
-H "Authorization: Bearer sak_..."Keys are hashed at rest, revocable from the platform, and never expand beyond their scope: the workspace and agent come from the key, not from the request.
Chat with an agent
Start a run with an agent API key. The body carries messages in the AI SDK UI message shape; with an agent key you don't name the agent, the key implies it:
curl -X POST https://<your-deployment-host>/v1/chat \
-H "Authorization: Bearer sak_..." \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"id": "msg-1",
"role": "user",
"parts": [
{ "type": "text", "text": "Summarize the policy changes for branch managers." }
]
}
]
}'The response carries the run id and the conversation id (also surfaced as
the X-Conversation-Id header). Stream results as server-sent events from
GET /v1/chat/{runId}/stream, and pass the conversationId in your next
request to continue the same conversation with full context. Runs can be
cancelled or steered mid-flight through their run endpoints.
Drive a Case
Cases make Sebati a processing layer under your own product: your system submits work, Sebati runs the agent, your system reads results. The loop:
- Create a task on the Case with its input field values.
- Poll status or subscribe to callbacks as the task moves through its states (pending, in progress, review, done, failed).
- Read the outputs when the task completes: field values plus any produced artifacts.
Configure callbacks in the workspace to push task completions to your endpoint instead of polling. Inbound webhook channels cover the other direction, letting your system's events create tasks.
Practical notes
- Scope keys tightly. An integration that only chats needs an agent key, not a workspace key. Rotate on personnel or vendor changes.
- Handle the review state. Tasks configured for human approval sit in review until someone decides; build your consumer to treat that as a normal, sometimes long-lived state.
- Consult the live reference. Exact request and response schemas for every endpoint are in your deployment's interactive API docs, which always match the version you are running.