# API overview

> The Naruska CRM REST API: where it is, how requests and answers look, and where to read next.

The API is what the web app and the MCP server use themselves, so everything they can do, your code can do too. Your API URL is `https://staging-api.naruskacrm.com`.

## How requests look

- JSON in and out, over HTTPS. Send `Content-Type: application/json` with a body.
- Every request carries a bearer token: `Authorization: Bearer <token>`. See [Authentication](/api/authentication.md) for the kinds of token and their scopes.
- Every request works under the rights of the person or service account behind the token. You see and change exactly what they could in the web app.
- Field names are the same everywhere: in the API, in webhook payloads and in what the AI tools see.

```
curl "https://staging-api.naruskacrm.com/v1/cases?open=false&resolved_from=2026-11-16&resolved_to=2026-11-22" \
  -H "Authorization: Bearer $NARUSKA_TOKEN"
```

## Lists

- Lists take declared filters only; an unknown filter is refused, so a typo never returns everything.
- `limit` is 50 by default and at most 200. Pass `next_cursor` from the answer back as `cursor` for the next page.
- `sort` takes a declared field, with `-` in front for descending.
- A date filter takes a whole day (`2026-11-25`, in UTC) or an exact date-time.
- Custom fields filter as `custom.<key>` (picklists and yes/no fields) or `custom.<key>_from` and `_to` (numbers and dates). See [Custom fields](/custom-fields.md).

## Writes

- `POST` creates, `PATCH` changes only the fields you send, `DELETE` moves a record to the recycle bin; admins can restore it for 30 days.
- `Idempotency-Key` on a `POST` makes a retry safe: the same key and body within 24 hours returns the first answer instead of creating a second record.
- `Reason` (percent-encoded UTF-8) is stored with the change in the record's history.
- Every write can be undone. See [Undo](/api/undo.md).

## Answers

- Success is `200`, `201` or `204`. An error is a problem details object with a stable `code`: see [Errors](/errors.md).
- Every answer carries your usage in `X-Usage-*` and `RateLimit` headers. See [Usage and limits](/api/usage-and-limits.md).

## Read next

- [API reference](/api/reference.md): every route, generated from the API's own description.
- [Webhooks](/webhooks.md): get a request when something changes, instead of polling.
- The machine-readable description is at `https://staging-api.naruskacrm.com/openapi.json`.
