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.
| Rule | Detail |
|---|---|
Base URL |
|
Authentication |
|
Key in the query string | Refused. A query parameter named |
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, |
Response | JSON. Every response carries |
Success statuses | GET 200. POST 201 (200 on an idempotent replay). PATCH 200. DELETE 200. |
Wrong method | 405 |
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.
| Item | Detail |
|---|---|
| Whole number from 1 to 100. Default 50. A value that is not a number uses 50. Values outside the range are clamped. |
| 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 |
Next cursor, chat lists | Chat widget and chat conversation lists return |
Next cursor, MCP |
|
End of list | A next cursor of |
Webhook list |
|
Snapshots | Lists are not snapshots. Rows can appear or move between pages. Deduplicate by id. |
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.
| Rule | Detail |
|---|---|
Unknown field | 400 |
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 |
Not a JSON object | 400 |
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 |
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."
| Case | Result |
|---|---|
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 |
Routine runner | Requires the header, and it must be a UUID. A fresh key answers 201. A replay answers 200. |
MCP | Takes the key as the |
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
dueDateanddueOn, are calendar dates. Timestamps, such asdueAtandstartAt, are ISO 8601 times in UTC with milliseconds and a Z, for example2026-11-13T00:00:00.000Z.Webhook payloads use ISO times in
occurredAtand 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.