Docs Connect your systems

Chat API reference

Every Chat API endpoint, request and response, with examples.

This page lists every Chat API endpoint, field, status and error, the callback Entropix sends, and the headers your own tools receive on an end user's turn. For what the API is for and how to make a key, start with Chat API.

Base address https://portal.entropixs.com/hooks/api/v1/ (your portal's own address) Called with an agent's API key, made by an Admin

Basics

ItemValue
AuthenticationAuthorization: Bearer eapi_… on every call except a file link. Only an agent's API key opens these endpoints, and an API key opens nothing else.
Request bodyJSON, on POST /messages only. Unknown fields are ignored; a known field of the wrong type is 400.
Response bodyJSON, with Content-Type: application/json, Cache-Control: no-store and X-Content-Type-Options: nosniff.
IdsEntropix makes every id. Messages start with msg_, conversations with conv_.
TimesRFC 3339 in UTC, for example 2026-11-21T09:14:03.512Z.
End-user keysEvery call names the end user: end_user.id in the body of POST /messages, ?end_user= on every other call except a file link. Missing, it is 400 end_user_required.

Endpoints

Method and pathWhat it doesSuccess
POST /hooks/api/v1/messagesSend a message, starting or continuing a conversation202
GET /hooks/api/v1/messages/{id}Read a message and its answer, optionally waiting for it200
GET /hooks/api/v1/conversations/{id}Read a conversation and its latest messages200
DELETE /hooks/api/v1/conversations/{id}End a conversation204
GET /hooks/api/v1/files/{id}Download a file an answer made, by its signed link200

Send a message

POST /hooks/api/v1/messages stores your message and answers at once. The agent answers in the background; read the answer with Get a message or take a callback.

Headers

HeaderRequiredWhat it does
AuthorizationYesBearer eapi_…
Content-TypeSend itapplication/json
Idempotency-KeyNoAny printable ASCII with no spaces, at most 255 characters. A repeat of the same value on the same key within 24 hours stores nothing new: it answers 202 with the first message as it is now, and counts against no limit.

Body

FieldTypeRules
textstring, requiredNot blank. At most 16 KiB and 4,096 characters, valid UTF-8, no control characters except newline and tab. A pasted credential is replaced by a note such as [credential removed: AWS secret key] before it is stored.
conversation_idstringLeave out to start a new conversation. To continue one, give its conv_… id. An id this key cannot reach is 404. If the conversation was ended, the message starts it again, fresh.
end_user.idstringRequired on an end-user key. Your own id for the person, at most 128 characters. Required whenever end_user.name is sent.
end_user.namestringOptional, at most 80 characters. Shown on the portal as "<name> via API".
metadataobjectOptional. Any JSON object of at most 2 KiB, stored and returned with the message. Entropix never acts on it.
metadata.external_refstringOptional, at most 128 characters. On a message that starts a conversation, it becomes the conversation's external_ref. It never finds a conversation.

The whole body is at most 128 KiB.

Answer

202 Accepted with the message object (including text and speaker) and a Location header holding its poll_url. A message sent while another of the same conversation is open stays queued until that one is finished.

This example uses an end-user key, so it names the end user. $ENTROPIX_KEY holds your key.

curl -sS -X POST https://portal.entropixs.com/hooks/api/v1/messages \
  -H "Authorization: Bearer $ENTROPIX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Which of my bookings are next week?",
       "end_user": {"id": "u-42", "name": "Ana"}}'
{
  "message_id": "msg_c4ca4238a0b923820dcc509a6f75849b",
  "conversation_id": "conv_c81e728d9d4c2f636f067f89cc14862c",
  "status": "queued",
  "text": "Which of my bookings are next week?",
  "speaker": "Ana via API",
  "end_user": {"id": "u-42"},
  "created_at": "2026-11-21T10:02:11.004Z",
  "poll_url": "https://portal.entropixs.com/hooks/api/v1/messages/msg_c4ca4238a0b923820dcc509a6f75849b"
}

Get a message

GET /hooks/api/v1/messages/{id} returns the message object without text and speaker. Once it is answered it carries answer; once it failed, error.

QueryWhat it does
waitWhole seconds from 0 to 30 (default 0). Holds the request open until the message is answered or failed, or the time is up, then returns it as it is. Anything else is 400. One key may hold at most 10 waiting requests at once; the eleventh is 429 rate_limited with Retry-After: 5. A request with no wait is never refused this way.
end_userRequired on an end-user key: the end user the message was sent for.
curl -sS "https://portal.entropixs.com/hooks/api/v1/messages/<message_id>?wait=30&end_user=u-42" \
  -H "Authorization: Bearer $ENTROPIX_KEY"

The message object

FieldWhen presentWhat it is
message_idAlwaysThe message's id, msg_…
conversation_idAlwaysIts conversation's id, conv_…
statusAlwaysqueued, working, answered or failed
textSend and conversation answersThe message as stored
speakerSend and conversation answersWho the portal shows as sending it: "<end_user.name> via API", else "<end_user.id> via API", else "<key name> via API"
end_userWhen the message named one{"id": "…"}, as you sent it
answerStatus answeredtext (Markdown) and files, a list of {name, url, size}. url is a signed link, good for 10 minutes; read the message again for a fresh one. size is in bytes. unverified, when present, lists the claims the answer marks proven that the portal's check found no support for; at most 3, absent when none. No text is added to text for them.
errorStatus failedWhy, in plain words
metadataWhen you sent someYour object, as sent
created_atAlwaysWhen the message was sent
answered_atStatus answered or failedWhen it finished
poll_urlAlwaysThis message's GET address
waitingStatus queued or working, on an organisation that uses runnersno_runner_online (no runner is online; the message waits until one is) or waiting_for_runner (it waits for a free runner slot)

Why a message fails

A failed message's error says why. These are the ones you may meet:

  • The agent could not answer (for example, its model is not reachable). The words start with "I couldn't answer".
  • The conversation was ended before this message ran.
  • Entropix did not finish an answer to this message within an hour, so it stopped waiting. Send it again.
  • The person who made this API key can no longer use Entropix: ask an admin to make a new key.
  • This key needs end_user.id on every message.
  • <agent> has several clusters and the API can't pick one: its key's maker picks one in the portal's chat first. (a Kubernetes agent with more than one cluster; see Chat API troubleshooting)
  • This conversation was closed after too many failed checks. (an end-user conversation whose verify step ran out of tries; see Who can use what)

Get a conversation

GET /hooks/api/v1/conversations/{id} returns the conversation and its latest messages, oldest first, each with text and speaker.

QueryWhat it does
limitHow many of the latest messages, from 1 to 100 (default 20). Anything else is 400.
end_userRequired on an end-user key: the end user the conversation belongs to.
FieldWhat it is
conversation_idThe conversation's id
external_refThe metadata.external_ref of the message that started it, if any
end_user{"id": "…"}, on an end-user key's conversation
endedtrue once it was ended
created_atWhen it started
messagesMessage objects since it last started. Empty while it is ended.

End a conversation

DELETE /hooks/api/v1/conversations/{id} ends the conversation and answers 204 No Content. Messages still waiting behind its open message fail with The conversation was ended before this message ran. The next message sent with the same conversation_id starts it again as a fresh chat: the agent no longer sees the earlier turns, and GET shows only the new messages. The earlier history stays on the portal. On an end-user key, add ?end_user=.

Download a file

GET /hooks/api/v1/files/{id}?k=…&e=…&s=… is the link in answer.files[].url. Use it exactly as given, with no Authorization header: the link is signed. It works for 10 minutes, only while the key that read it is still live, and only for a file an answer of that key's agent and key family made. Anything else answers 404 not_found.

The file comes back with its own Content-Type, Content-Disposition: attachment with its name, X-Content-Type-Options: nosniff, Content-Security-Policy: default-src 'none'; sandbox and Cache-Control: private, no-store. Entropix keeps a file for 90 days.

Errors

Every refusal has the same body:

{"error": {"code": "rate_limited", "message": "this key sent its minute's limit of messages; try again in 42s"}}
StatuscodeMeaning
400invalid_requestA field or query value broke a rule; the message says which
400end_user_requiredAn end-user key's call named no end user: "This key needs end_user.id on every message."
401unauthorizedNo key, or not an API key Entropix made. Comes with WWW-Authenticate: Bearer realm="entropix-api".
403forbidden"this API key was revoked or replaced", or "this agent's API is turned off" (the agent is being removed)
404not_found"no such conversation, message or file for this key": it does not exist, or belongs to another agent, key family or end user
413too_largeThe body, text or metadata is over its limit
429rate_limitedThe key's limit (60 a minute, 1,000 a day) or its 10 waiting polls. See Retry-After.
429end_user_rate_limitedThis end user's limit (10 a minute, 200 a day). See Retry-After.
503pausedOnly on sending: the organisation runs its work on runners and none is online. Retry-After: 30.
500internal"the portal failed to answer; try again"

Retry-After is in whole seconds. A message refused with 429 or 503 was not stored: send it again later, with the same Idempotency-Key if you use one.

Callbacks

A key made with a callback URL gets one signed POST for every message it sent, once the message is answered or failed, as long as the key is still live at that moment. You can poll as well.

The request

PartValue
Method and addressPOST to the key's callback URL. Redirects are not followed.
Content-Typeapplication/json
User-AgentEntropix-Callback/1
Entropix-Signaturet=<unix seconds>,v1=<hex>
BodyThe message object, as GET returns it
POST /entropix/answers HTTP/1.1
Content-Type: application/json
User-Agent: Entropix-Callback/1
Entropix-Signature: t=1795255339,v1=5f0c1e…

{"message_id":"msg_c4ca4238a0b923820dcc509a6f75849b","conversation_id":"conv_c81e728d9d4c2f636f067f89cc14862c","status":"answered","end_user":{"id":"u-42"},"answer":{"text":"You have one booking next week: …","files":[]},"created_at":"2026-11-21T10:02:11.004Z","answered_at":"2026-11-21T10:02:19.880Z","poll_url":"https://portal.entropixs.com/hooks/api/v1/messages/msg_c4ca4238a0b923820dcc509a6f75849b"}

Answering it

  • Answer with any 2xx within 10 seconds. Do your own work after you answer.
  • A 408, 429, 5xx, a timeout or a connection error is tried again, with a wait that doubles each time: 1 minute, then 2, 4, 8 and 16 minutes. If you answer with Retry-After in seconds, Entropix waits at least that long, but never past the hour. It gives up one hour after the callback was queued, which with these waits is at most six tries.
  • Any other status (a 3xx or another 4xx) gives up at once.
  • If the key is revoked before the callback goes out, it is not sent. If the key was rotated and its grace period ended before a queued callback went out, the callback goes to the new key's URL, signed with the new key's secret. A message answered after its key ended gets no callback; read it with the new key.
  • Each try is signed again, with a fresh timestamp.
  • Use message_id to ignore a callback you have already handled.

Check the signature

The signature is HMAC-SHA256, keyed with the key's whole callback secret (whsec_…, prefix included), over the timestamp, a full stop and the raw body: "<t>." + body, written as lowercase hex. Check it on the raw bytes, before you parse the JSON, compare in constant time, and refuse a timestamp far from your own clock so an old callback cannot be replayed.

# Python 3
import hashlib, hmac, time

def verify(secret: str, header: str, body: bytes, tolerance: int = 300) -> bool:
    parts = dict(p.strip().split("=", 1) for p in header.split(",") if "=" in p)
    ts, sig = parts.get("t", ""), parts.get("v1", "")
    if not ts.isdigit() or not sig:
        return False
    if abs(time.time() - int(ts)) > tolerance:
        return False
    want = hmac.new(secret.encode(), ts.encode() + b"." + body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(want, sig)
// Node.js
const crypto = require("crypto");

function verify(secret, header, rawBody, toleranceSec = 300) {
  const parts = Object.fromEntries(
    header.split(",").map((p) => p.trim().split("=", 2)));
  const ts = parts.t, sig = parts.v1;
  if (!/^\d+$/.test(ts || "") || !sig) return false;
  if (Math.abs(Date.now() / 1000 - Number(ts)) > toleranceSec) return false;
  const want = crypto.createHmac("sha256", secret)
    .update(ts + ".").update(rawBody).digest("hex");
  return want.length === sig.length &&
    crypto.timingSafeEqual(Buffer.from(want), Buffer.from(sig));
}
Tip

During a rotation's grace period, a callback for a message sent with the old key is signed with the old key's secret, and one for the new key with the new secret. Accept either secret until the grace period ends; after it, every callback is signed with the new secret.

Headers your tools receive on an end user's turn

When a turn comes from an end-user key, Entropix tells your own tool servers who is asking. These headers go on every request of the turn to an MCP tool server's own host, and on every http_request call the access block opens. The value always comes from the message your app sent, never from the model, and Entropix removes any header of the same name that a connection's settings would add, so it cannot be faked by configuration. Other turns (portal chat, channels, goals, reviews and system keys) send none of them.

HeaderValueSent
Entropix-End-UserThe message's end_user.idEvery request of an end user's turn
Entropix-Callerapi-end-userEvery request of an end user's turn
Entropix-VerifiedtrueOnce the conversation passed its verify step
Entropix-Verified-IdThe value the verify step keptOn http_request calls of a verified conversation

Use them to filter what your tool returns to the person asking. Setting up the verify step and the tools end users may use is in Who can use what.