> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API

> Base URL, authentication, errors, rate limits, and pagination for the Sazabi public API, plus generated reference for every endpoint.

The Sazabi public API is a REST API. Every endpoint page in this section is
generated from the committed public OpenAPI contract, so the reference always
matches the deployed API.

## Base URL

All requests go to the versioned production base URL:

```txt theme={"system"}
https://api.sazabi.com/v1
```

The path prefix `/v1` is the API version. Prepend the base URL to every
endpoint path shown in this reference.

## Authentication

Authenticate with a **secret key**. Create one in the dashboard under
**Settings > Secret keys**. Secret keys are organization-scoped and grant
read/write access to the API, so keep them server-side only.

Send the key as a bearer token:

```bash theme={"system"}
curl https://api.sazabi.com/v1/me \
  -H "Authorization: Bearer $SAZABI_SECRET_KEY"
```

Public keys are for log ingestion, not the API — see
[Keys](https://docs.sazabi.com/manage/keys.md) for the distinction. A missing or invalid
credential returns `401`.

## Errors

Errors return a non-2xx HTTP status and a JSON body with the error fields at the
top level. The `code` field carries a stable machine-readable code, and
`operationId` names the endpoint that failed:

```json theme={"system"}
{
  "code": "NOT_FOUND",
  "message": "Dashboard not found",
  "operationId": "dashboards.get",
  "missingContext": []
}
```

Some responses also include `reason` (a machine-readable sub-code) and, on
`429`, `retryAfterSeconds`. `missingContext` lists any required context that
was absent from the request. A `400` whose `message` is `Input validation
failed` also carries `issues`, one entry per rejected field, so you can tell
which field to change:

```json theme={"system"}
{
  "code": "BAD_REQUEST",
  "message": "Input validation failed",
  "operationId": "organizations.create",
  "missingContext": [],
  "issues": [
    { "path": ["name"], "message": "Name must be 100 characters or less" }
  ]
}
```

| Status | Code | Meaning |
| - | - | - |
| 400 | `BAD_REQUEST` | The request was malformed or failed validation. |
| 401 | `UNAUTHORIZED` | The credential is missing or invalid. |
| 403 | `FORBIDDEN` | The credential is valid but cannot access the resource. |
| 404 | `NOT_FOUND` | The resource does not exist, or the credential cannot see it. |
| 409 | `CONFLICT` | The request conflicts with the current state. |
| 429 | `TOO_MANY_REQUESTS` | A rate limit was exceeded. |
| 500 | `INTERNAL_SERVER_ERROR` | An unexpected server error occurred. |

Branch on the top-level `code` field rather than parsing `message`; messages
are for humans and can change.

## Rate limits

The API enforces per-organization and per-key request rate limits. When you
exceed one, the API returns `429` with code `TOO_MANY_REQUESTS`. Back off and
retry. For the shape of these limits, see [Limits](https://docs.sazabi.com/reference/limits.md).

## Pagination

The API uses two pagination strategies. Check each endpoint's generated schema
to see which one it uses.

**Cursor-based (most list endpoints).** The response carries a `nextCursor`;
pass it back as the `cursor` query parameter to fetch the next page. A `null`
`nextCursor` means there are no more results.

```bash theme={"system"}
curl "https://api.sazabi.com/v1/threads?cursor=$NEXT_CURSOR" \
  -H "Authorization: Bearer $SAZABI_SECRET_KEY"
```

**Page-based.** `/v1/search/threads`, `/v1/search/messages`, and
`/v1/billing/transactions` take a one-based `page` query parameter and return a
`pagination` object with `page`, `limit`, `totalPages`, and a total count
(`totalResults` for search, `total` for billing transactions). Increment
`page` until you reach `totalPages`.

```bash theme={"system"}
curl "https://api.sazabi.com/v1/search/threads?page=2" \
  -H "Authorization: Bearer $SAZABI_SECRET_KEY"
```

## Streaming

Agent runs and threads stream events over Server-Sent Events. See
[Streaming](https://docs.sazabi.com/reference/api/streaming.md).

## In this section

Browse every operation by resource in the sidebar, or start from a resource
group below:

> [card] [Streaming](https://docs.sazabi.com/reference/api/streaming.md)
>
> Stream agent run and thread events over Server-Sent Events.

> [card] [AgentDispatches](https://docs.sazabi.com/reference/api/agent-dispatches/list.md)

> [card] [Auth](https://docs.sazabi.com/reference/api/auth/get.md)

> [card] [Artifacts](https://docs.sazabi.com/reference/api/artifacts/list.md)

> [card] [Dashboards](https://docs.sazabi.com/reference/api/dashboards/list.md)

> [card] [Logs](https://docs.sazabi.com/reference/api/logs/ask.md)

> [card] [Log sources](https://docs.sazabi.com/reference/api/log-sources/list.md)

> [card] [Log streams](https://docs.sazabi.com/reference/api/log-streams/list.md)

> [card] [Connected accounts](https://docs.sazabi.com/reference/api/connected-accounts/list.md)

> [card] [Integrations](https://docs.sazabi.com/reference/api/integrations/list-providers.md)

> [card] [Notification channels](https://docs.sazabi.com/reference/api/notification-channels/get-project.md)

> [card] [Notification delivery rules](https://docs.sazabi.com/reference/api/notification-delivery-rules/list.md)

> [card] [Task creation rules](https://docs.sazabi.com/reference/api/task-creation-rules/list.md)

> [card] [Task status mapping](https://docs.sazabi.com/reference/api/task-status-mapping/get.md)

> [card] [MCP connectors](https://docs.sazabi.com/reference/api/mcp-connectors/list.md)

> [card] [Sandbox environment variables](https://docs.sazabi.com/reference/api/sandbox-environment-variables/list.md)

> [card] [Sandbox init script](https://docs.sazabi.com/reference/api/sandbox-init-script/get.md)

> [card] [Sandbox clis](https://docs.sazabi.com/reference/api/sandbox-clis/delete-cli.md)

> [card] [Memory](https://docs.sazabi.com/reference/api/memory/list.md)

> [card] [Support tickets](https://docs.sazabi.com/reference/api/support-tickets/list.md)

> [card] [Onboarding](https://docs.sazabi.com/reference/api/onboarding/ensure-default-project.md)

> [card] [Organizations](https://docs.sazabi.com/reference/api/organizations/list.md)

> [card] [Members](https://docs.sazabi.com/reference/api/members/list.md)

> [card] [Teams](https://docs.sazabi.com/reference/api/teams/list.md)

> [card] [Public keys](https://docs.sazabi.com/reference/api/public-keys/list.md)

> [card] [SSO](https://docs.sazabi.com/reference/api/sso/connections-get.md)

> [card] [Tool permissions](https://docs.sazabi.com/reference/api/tool-permissions/list.md)

> [card] [Secret keys](https://docs.sazabi.com/reference/api/secret-keys/list.md)

> [card] [Projects](https://docs.sazabi.com/reference/api/projects/list.md)

> [card] [Search](https://docs.sazabi.com/reference/api/search/threads.md)

> [card] [Messages](https://docs.sazabi.com/reference/api/messages/list.md)

> [card] [Threads](https://docs.sazabi.com/reference/api/threads/list.md)

> [card] [Runs](https://docs.sazabi.com/reference/api/runs/list.md)

> [card] [Pull requests](https://docs.sazabi.com/reference/api/pull-requests/list.md)

> [card] [Issues](https://docs.sazabi.com/reference/api/issues/list.md)

> [card] [Work items](https://docs.sazabi.com/reference/api/work-items/create.md)

> [card] [Webhooks](https://docs.sazabi.com/reference/api/webhooks/list.md)

> [card] [Billing](https://docs.sazabi.com/reference/api/billing/get-summary.md)

> [card] [Onboarding tasks](https://docs.sazabi.com/reference/api/onboarding-tasks/list.md)

> [card] [Tasks](https://docs.sazabi.com/reference/api/tasks/create.md)

> [card] [Recommendations](https://docs.sazabi.com/reference/api/recommendations/list.md)

> [card] [Signals](https://docs.sazabi.com/reference/api/signals/list.md)

> [card] [Repos](https://docs.sazabi.com/reference/api/repos/list.md)

> [card] [Components](https://docs.sazabi.com/reference/api/components/list.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.