Authentication
Every request carries one API key. Which kind depends on where the request comes from:
Both are created in the dashboard; API keys explains the options each one offers.
Send one key per request. A request that carries both X-Secret-Key and X-Public-Key is
rejected with 400 before it reaches any endpoint.
Secret key
A secret key authenticates a server. It belongs to one entity, the workspace you see in the dashboard, so the request needs nothing else to say where to work:
A secret key has a role, WRITER or READER. Readers can list and fetch; writers can also
create, update and delete batches and widget configuration. A key can be limited to an IP
allowlist (single addresses or CIDR ranges), and calls from any other address get 403. Secret
keys are for server-to-server traffic: the API does not answer browser CORS preflights for them,
and a secret key that ends up in a page should be revoked and replaced.
Public key
A public key authenticates a browser page or a widget, where a secret cannot be hidden. It only
reaches the endpoints under /v1/, which are the chat session and widget configuration calls:
Three restrictions keep a public key safe even though it is visible:
- Domains. The request’s
Origin(orReferer) must match one of the key’s allowed domains. A public key cannot be created without at least one. - Scopes. An optional scope list names the operations the key may call, such as
chat:initorwidget-config:read. A key without a list may call all of them. - reCAPTCHA. When a reCAPTCHA secret is configured on the key, starting a chat also requires a
g-tokenheader carrying a Google reCAPTCHA token, verified against the key’s score threshold.
Which endpoints take which key
Errors
The voice workers that run calls use an internal credential of their own. Their endpoints are not part of this reference.