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

# API Overview

> Base URL, authentication, error handling, and conventions for the Sapt REST API.

The Sapt REST API gives you direct HTTP access to Projects, agents, memory, actions, and everything else in the workspace for that Project. Prefer to connect Claude or ChatGPT? See the [MCP Connector](/docs/mintlify/mcp/overview).

## Base URL

```
https://api.sapt.ai
```

## Authentication

All requests require an API key in the `Authorization` header:

```
Authorization: ApiKey sapt_...
```

Generate API keys from your Project settings in the Sapt dashboard.

## Content type

All request and response bodies use JSON:

```
Content-Type: application/json
```

## Error responses

Errors return a structured envelope. `code` is machine-readable, `message` is human-readable, and `details` is present for field-level validation errors or additional context.

```json theme={null}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Field 'name' is required",
    "details": { "field": "name" }
  }
}
```

## Endpoint reference

Every public endpoint is auto-generated from the live OpenAPI spec. Browse them under [Reference](/api-reference/socials/create-post).

### Reading the reference

A few fields are **free-form JSON** — their exact shape depends on the resource, so the reference shows them as an open object rather than a fixed schema. The most common ones:

| Field              | Where                  | What it holds                                                                                                                                                                                      |
| ------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bundle`           | Project templates      | The full saved configuration a template applies (roles, workflows, CRM types, sidebar). Its structure is documented in **[Project templates & the bundle](/docs/mintlify/api/project-templates)**. |
| `actions`, `steps` | Workflows              | The ordered work a workflow runs; each entry's shape depends on its action type.                                                                                                                   |
| `data`             | Object records         | The CRM record's values, keyed by the fields of its object type.                                                                                                                                   |
| `metadata`         | Assets, scheduled jobs | Caller-supplied key/value details attached to the resource.                                                                                                                                        |

If a field shows up as an open or "unknown" object, treat it as JSON whose keys depend on the specific resource — not as a typo or a missing type.

## Status codes

| Code  | Meaning                                   |
| ----- | ----------------------------------------- |
| `200` | OK                                        |
| `201` | Created                                   |
| `400` | Bad Request — invalid input               |
| `401` | Unauthorized — missing or invalid API key |
| `404` | Not Found                                 |
| `429` | Rate Limited — back off and retry         |
| `500` | Internal Error                            |

## Example request

```bash theme={null}
curl https://api.sapt.ai/projects/{projectId}/agents \
  -H "Authorization: ApiKey sapt_..." \
  -H "Content-Type: application/json"
```
