Conventions
Base URL, response format, errors, timeouts and retry rules shared by every endpoint.
Every endpoint follows the same rules: one address, a token on every call, JSON in and out, and the same response shape. Read this page once and the reference pages are easier to follow.
What every call has in common
- Calls go to the same address and carry your token. See Authentication.
- Every response says whether it worked, carries a short message and the data you asked for.
- Calls that run AI, such as sending a message, can take several seconds. Your system must wait for the answer instead of giving up early.
- Some routes are marked beta. They work, but their address or fields may still change.
ReferenceTechnical details
Base URL and format
| Item | Value |
|---|---|
| Base URL | https://api.tolky.to |
| Path prefix | /api/externalAPIs/public/... |
| Format | JSON in and out (Content-Type: application/json) |
| Authentication | Authorization: Bearer $TOLKY_TOKEN |
| Methods | GET, POST and DELETE. A DELETE route takes the ID at the end of the path. |
Routes are named after actions (conversations/create, avatars/edit), not after REST resources. Most of them use POST, even when they only read data. IDs are UUIDs. Field names follow each endpoint: some use camelCase, others snake_case. Copy them exactly as each reference page shows.
Response envelope
{
"code": 200,
"message": "OK",
"data": { }
}| Field | Description |
|---|---|
code | Repeats the HTTP status. |
message | Short text, usually OK. Some delete routes put their result here. |
data | The result. An object, an array or an empty object, depending on the endpoint. |
When something goes wrong
The HTTP status tells you what happened. Errors caused by the request (a missing field, an ID that does not exist) will fail again if you repeat them. Temporary errors (a timeout, a service briefly unavailable) usually work on a later try.
Errors and status codesTechnical details
{
"code": 404,
"message": "Lead com id 3f0c2a8e-... não encontrado",
"data": {
"error": {
"name": "NotFoundError",
"message": "Lead com id 3f0c2a8e-... não encontrado",
"code": 404,
"timestamp": "2026-11-16T14:00:00.000Z",
"details": null
}
}
}- Error messages may be in Portuguese or English. Branch on the HTTP status, not on the text.
- On
5xxerrors,detailsis left out. - Some errors return only
codeandmessage, with an emptydata.
| Status | Meaning |
|---|---|
200 | Success. |
201 | Created (some create routes, such as knowledge chunks and MCP servers). |
400 | A required field is missing or a value is invalid. |
401 | The token is missing or invalid. |
403 | The token is valid but cannot access this resource. |
404 | The ID does not exist in your account. |
408 | The request exceeded the server time limit for that route. |
409 | Conflict, for example an avatar sub slug that already exists. |
500 | Internal error. |
503 | Temporarily unavailable. Send a message also returns 503 when the avatar could not produce an answer. |
The responseStatus.ok flag
Send a message returns data.responseStatus. When processing fails, ok is false and the HTTP status is 503. The body still carries the data, plus errorDetails. With HTTP 200, ok is true.
Waiting and trying again
Timeouts and retriesTechnical details
- Many routes stop at 60 seconds and answer
408. Editing a knowledge chunk allows 120 seconds; the Flow Assistant question route allows 90 seconds. - Set your HTTP client timeout to at least 90 seconds for calls that run AI.
- Retry only on
408,500,502,503and504. Wait longer between tries (for example 1, 2 and 4 seconds) and stop after a few attempts. - Do not retry other
4xxerrors: fix the request first. - Retrying a write can repeat it. Each call to Create a conversation creates a new conversation, and each call to Send a message adds a new turn.
Short-lived caches
Some reads are cached for a short time, so a change can take a moment to show. Each reference page states the cache time when there is one. Several routes accept noCache (or no_cache) to skip it.
Beta routes
Pages marked beta document routes that are not yet in the stable release. Their base URL, path and fields are provisional and may change without notice. Do not build critical production flows on them yet.