API overview
Any client - a web frontend, a mobile app, a script - drives a deployed agent over the Sectr HTTP API. See the full reference for complete details.
The primary concept
Section titled “The primary concept”The journal is the only source of truth. A session is an append-only
event log; every “live” view - including the chat stream - is a tail of that journal.
This makes reconnecting (Last-Event-ID) trivially correct and produces a fully auditable
and debuggable transcript.
The data plane APIs
Section titled “The data plane APIs”| Area | Endpoints | Auth |
|---|---|---|
| Sessions | POST /sessions, GET /sessions/{sessionId}, POST /sessions/{sessionId}/input |
user token (end users), invocation key (backend), or platform key |
| Streaming | GET /sessions/{sessionId}/events (SSE) |
same as the session’s |
| Approvals | POST /sessions/{sessionId}/approval, GET /approvals |
decide: user token (own sessions) / keys; inbox: platform key |
| AG-UI | POST /ag-ui/{app}/{route} (run), GET /ag-ui/{app}/{route} (reconnect, ?threadId=) |
user token or invocation key |
Browser clients authenticate with a user token, which your backend mints
with its invocation key via POST /tokens;
see authentication.
The control plane APIs
Section titled “The control plane APIs”| Area | Endpoints | Auth |
|---|---|---|
| Projects | GET /apps, GET /apps/{appId}, GET /apps/{appId}/deployments |
platform key |
| Deployments | POST /deployments, POST /deployments/{deploymentId}/activate |
platform key |
| Secrets | PUT /secrets/{key}, GET /secrets, DELETE /secrets/{key} |
platform key |
| API keys | GET /api-keys, POST /api-keys, DELETE /api-keys/{keyId} |
platform key |
API Base URLs
Section titled “API Base URLs”- Prod:
https://api.sectr.dev - Locally,
sectr devserves the same API from its gateway, printed at server startup (https://local.sectr.dev:8420by default)
Start here
Section titled “Start here”- Authentication — which key class you need
- Send a message — create a session, add turns
- Stream a session — the SSE tail + resumption
- Approve or deny from your UI
- AG-UI endpoint — CopilotKit and other AG-UI clients
- Limits — concurrency, rate limits, and the
429codes