API conventions

Base URL, request format, versioning, errors, pagination, idempotency and rate-limit headers.

Base URL, format and versioning

  • Base URL: https://api.heyllo.co/v1. HTTPS only.
  • Request bodies are JSON with Content-Type: application/json, up to 1 MB. File uploads use multipart/form-data. Responses are JSON, except streamed replies.
  • Timestamps are ISO 8601 in UTC. IDs are opaque strings with a type prefix.
  • Every response carries a Request-Id header (req_...). Quote it when you contact support.

Versioning

The major version is in the path. Behaviour within v1 is pinned to a dated version. Send it in the Heyllo-Version header, or leave it out to use the version pinned to your organisation. Authenticated responses echo the version used in the Heyllo-Version header. An unknown version returns 400 api_version_invalid.

HTTP
GET /v1/bots HTTP/1.1
Host: api.heyllo.co
Authorization: Bearer hk_live_...
Heyllo-Version: 2026-12-01

The current version is 2026-12-01. Additive changes, such as new fields, new event types and new endpoints, can arrive within a version at any time, so ignore fields you do not recognise. Breaking changes only ship under a new dated version.

Errors

Errors use standard HTTP status codes and one JSON envelope.

JSON
{
  "error": {
    "type": "invalid_request_error",
    "code": "model_not_allowed",
    "message": "Model 'example/model' is not enabled for your organisation.",
    "param": "model",
    "request_id": "req_7Fh2Kp9Qx4Lm8Vn3Rt6Wc1Yz",
    "doc_url": "https://heyllo.co/docs/api/errors#model_not_allowed"
  }
}
FieldDescription
typeThe broad category. Each type maps to one HTTP status.
codeA stable, machine-readable reason. Branch on this.
messageA human-readable explanation for developers. Do not parse it, and do not show it to end users.
paramThe request field at fault, when there is one.
request_idThe request ID, also in the Request-Id header.
doc_urlA link to the code's entry in the error reference.

Retry 429 responses after Retry-After, and 5xx responses with exponential backoff and jitter. Do not retry other 4xx responses unchanged.

Pagination

List endpoints return objects newest first, in a list envelope.

JSON
{
  "object": "list",
  "data": [],
  "has_more": true,
  "next_cursor": "YzE6MTIzNDU"
}
  • limit: 1 to 100, default 20.
  • cursor: pass the previous page's next_cursor to get the next page. next_cursor is null on the last page.
  • Cursors are opaque and stay valid when new objects are created between pages. A cursor that cannot be read returns 400 cursor_invalid.
Shell
curl "https://api.heyllo.co/v1/conversations?bot=bot_k3x9q2m7v1p8z4w6t5r0y2&limit=50&cursor=YzE6MTIzNDU" \
  -H "Authorization: Bearer $HEYLLO_API_KEY"

Idempotency

Send an Idempotency-Key header to retry a write safely after a timeout or network error. Use any unique string of 1 to 255 printable ASCII characters, such as a UUID. Keys are remembered for 24 hours per organisation.

The header is required on these endpoints, which return 400 idempotency_key_required without it:

  • POST /v1/workspaces
  • POST /v1/bots
  • POST /v1/bots/{id}/knowledge/url, /knowledge/text, /knowledge/qa, /knowledge/files and /knowledge/documents
  • POST /v1/conversations/{id}/messages
  • POST /v1/api_keys and POST /v1/api_keys/{id}/rotate

Other POST, PATCH and DELETE endpoints accept it optionally. GET requests ignore it.

  • Same key, same request: the stored response is returned with the header Idempotent-Replayed: true. For a streamed message, the final turn is returned as JSON.
  • Same key, different request: 422 idempotency_key_reused. The method, path and body must match.
  • Same key while the first request is still running: 409 request_in_progress.
  • After a `5xx`: the key is released, so you can retry with the same key. Other error responses are stored and replayed like successes.

Rate-limit headers

HeaderMeaning
RateLimit-LimitRequests allowed in the current window.
RateLimit-RemainingRequests left in the current window.
RateLimit-ResetSeconds until the window resets.
Retry-AfterSent with 429 and some 503 responses: seconds to wait before retrying.

Limits apply per key, per organisation, and for chat and knowledge requests separately. The headers describe the limit closest to running out. See Limits and usage for the numbers.