Developers
ENPT

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

ItemValue
Base URLhttps://api.tolky.to
Path prefix/api/externalAPIs/public/...
FormatJSON in and out (Content-Type: application/json)
AuthenticationAuthorization: Bearer $TOLKY_TOKEN
MethodsGET, 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": { }
}
FieldDescription
codeRepeats the HTTP status.
messageShort text, usually OK. Some delete routes put their result here.
dataThe 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 5xx errors, details is left out.
  • Some errors return only code and message, with an empty data.
StatusMeaning
200Success.
201Created (some create routes, such as knowledge chunks and MCP servers).
400A required field is missing or a value is invalid.
401The token is missing or invalid.
403The token is valid but cannot access this resource.
404The ID does not exist in your account.
408The request exceeded the server time limit for that route.
409Conflict, for example an avatar sub slug that already exists.
500Internal error.
503Temporarily 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, 503 and 504. Wait longer between tries (for example 1, 2 and 4 seconds) and stop after a few attempts.
  • Do not retry other 4xx errors: 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.

Previous

Use Tolky with Claude

Next

Create a conversation