Conventions

API conventions

One set of rules. Every v1 route follows these conventions. Where a rule has an exception, the exception is stated next to it. Examples use $TERANIA_KEY for your API key and the base URL https://app.terania.ai/api/v1.

JSON over HTTPS, key in the header.

RuleDetail

Base URL

https://app.terania.ai/api/v1

Authentication

Authorization: Bearer <key>. The scheme word is not case sensitive. Keys begin with qk_. See Authentication.

Key in the query string

Refused. A query parameter named key, api_key or token answers 401 before anything else is checked. Send the key in the header only.

Bad credentials

A missing or malformed bearer, an unknown, revoked or expired key, a suspended or removed issuer and an inactive organisation all answer the same 401.

Request body

JSON, Content-Type: application/json.

Response

JSON. Every response carries API-Version: 1 and the rate limit headers (see rate limits).

Success statuses

GET 200. POST 201 (200 on an idempotent replay). PATCH 200. DELETE 200.

Wrong method

405 method_not_allowed. Item routes that accept PATCH answer "Only GET and PATCH are supported here." Chat, usage and routine paths send an Allow header.

bash
curl https://app.terania.ai/api/v1/customers \
  -H "Authorization: Bearer $TERANIA_KEY"

Call it from your server.

The API sends no cross-origin headers. Treat the API as server to server and keep keys out of browser code. Browser use is not supported. An API key can read your organisation's records: never ship one in a web page or a mobile app.

Keyset cursors, not page numbers.

List routes page with an opaque cursor. Pass the last cursor you received as after. Stop when the next cursor is null.

ItemDetail

limit

Whole number from 1 to 100. Default 50. A value that is not a number uses 50. Values outside the range are clamped.

after

Opaque id of the last row you saw. A garbage, deleted or out-of-scope cursor does not error: it returns the first page.

Next cursor, record lists

Returned in the body as reach.next on most record lists. Exceptions: AI Employees return a top-level next, People return no cursor, webhooks return a plain array and chat lists use nextCursor.

Next cursor, chat lists

Chat widget and chat conversation lists return nextCursor at the top of the body.

Next cursor, MCP list_records

nextCursor inside data. See MCP tools. MCP pages are at most 50.

End of list

A next cursor of null means no further row.

Webhook list

GET /api/v1/webhooks returns a bare array with no cursor.

Snapshots

Lists are not snapshots. Rows can appear or move between pages. Deduplicate by id.

bash
curl "https://app.terania.ai/api/v1/customers?limit=25" \
  -H "Authorization: Bearer $TERANIA_KEY"

curl "https://app.terania.ai/api/v1/customers?limit=25&after=<reach.next>" \
  -H "Authorization: Bearer $TERANIA_KEY"

Almost none, on purpose.

Record list routes take after and limit and nothing else. There are no status, search or date filters on the REST routes. The customers list is fixed to active customers. Filter on your side after you read, or use the app for search. The MCP tool list_records adds kind and, for chat conversations, widgetId.

Closed field lists.

Writes are JSON objects with a closed list of fields. An unknown field is refused, not ignored.

RuleDetail

Unknown field

400 invalid_request with the sentence "Unknown field: name."

Body size

16,384 bytes for creates. 65,536 bytes for task PATCH and the chat paths.

Unreadable body

A body that cannot be parsed, or is over the cap, answers 400 bad_request.

Not a JSON object

400 invalid_request: "Send the changes as a JSON object."

Money and ids

Every large integer is sent as a decimal string.

What the key may do

A write needs a write scope. Without it: 403 write_forbidden. See scopes.

Deletes

There are none for records.

Retry a create without making two.

Send an Idempotency-Key header, 1 to 128 characters, on POST /cases, POST /tasks and POST /missions. Those three honour it. Every other write refuses the header with 400 invalid_request: "Idempotency-Key is not supported on this endpoint yet."

CaseResult

First request with a new key

201 and the new record.

Same key, same body

200 and the stored record. No second record is made.

Same key, different body

409 { "error": "idempotency-key-reused" }. This 409 has no code field.

Routine runner POST /automations/:id/runs

Requires the header, and it must be a UUID. A fresh key answers 201. A replay answers 200.

MCP start_mission

Takes the key as the idempotency_key argument, up to 128 characters.

bash
curl -X POST https://app.terania.ai/api/v1/cases \
  -H "Authorization: Bearer $TERANIA_KEY" \
  -H "Idempotency-Key: 6b1f0c52-example-key-0042" \
  -H "Content-Type: application/json" \
  -d '{"subject":"Hot water unit leaking","purpose":"customer-support"}'

Strings for ids and money.

  • Ids are opaque strings. Treat them as such.

  • Every bigint, including amounts in minor units, is sent as a decimal string.

  • Calendar dates, such as dueDate and dueOn, are calendar dates. Timestamps, such as dueAt and startAt, are ISO 8601 times in UTC with milliseconds and a Z, for example 2026-11-13T00:00:00.000Z.

  • Webhook payloads use ISO times in occurredAt and unix seconds in the signature header.

When it goes wrong.

Every error is JSON with a sentence, a code and sometimes a request id. See [errors](/developers/reference/errors) and [rate limits](/developers/reference/rate-limits). Webhook rules are on the [webhooks](/developers/webhooks) page.