Authentication
Two kinds of credential
A workspace token acts as the workspace and carries the scopes you gave it. An agent credential stands for one agent and carries none, because what an agent may do is decided for every request rather than granted once.
- Scheme
- Authorization: Bearer
- Token prefix
- xyr_live_…
- Agent prefix
- xyr_agt_…
- Stored as
- one-way hash
Live and test
The mode is in the prefix, so it is visible wherever the token is — in a log, a config file, a code review — rather than being a setting somebody has to remember to check.
- xyr_live_…Reads and writes this workspace’s records.
- xyr_test_…Reads this workspace’s real records and never writes. A write is checked exactly as a live one would be and answered with simulated: true, and nothing is recorded. The order and identity routes, which can only write for real, refuse it.
A test credential is judged by exactly the same checks a live one is. A rehearsal that skipped the decision, or that sent a real request to a customer’s server, would not be a rehearsal.
Scopes
A token carries only the scopes it was given. An endpoint that needs one it does not have is refused with forbidden, and the message names the scope rather than leaving you to guess which of them was missing.
- read:analyticsRead campaign and revenue reporting
- read:contactsRead contacts and segments
- write:contactsCreate and update contacts
- write:ordersReport orders for revenue attribution
- write:postsreaches peopleCreate and schedule social posts
- send:campaignsreaches peopleSend email and SMS campaigns
- read:growthRead missions, decisions, signals, opportunities, experiments, outcomes, approvals and proposed changes
- write:experimentsWrite down hypotheses against tests before they are decided
- write:actionsPropose changes for a person to approve; nothing is carried out without one
- write:eventsreaches peopleReport what contacts did in your own systems, which can start workflows that message them
- read:eventsRead the events a webhook can subscribe to
- manage:membersProvision, change and remove members from an identity provider, over SCIM
- read:agentsRead this workspace’s agents, the tools they may use, and the rules that govern them
The marked scopes let a token reach people outside the workspace — sending, posting, or reporting events that can start a workflow which messages somebody. Grant them only to an integration that genuinely sends, and never to one that only reads.
An agent’s own credential
Issued in Agent controls, with the owner. It is deliberately not something a token can mint: registering an agent widens what may act in the workspace, and a leaked key that could do that would be worse than any convenience it bought.
- CarriesNo scopes. What the agent may do is decided per request by the gateway, against the workspace’s permissions, the data, the risk and the owner’s rules.
- Stands forOne agent. Revoking it stops that agent and nothing else — unlike a workspace token, which is the workspace.
- Limit1200 requests an hour, per credential.
Authorization: Bearer xyr_agt_…The workspace is taken from the credential and never from the request: a caller cannot name a workspace it does not hold the key to.
What comes back, and how to read it, is on the Agent API page.
Replacing a token
A token is replaced with an overlap, so the new one works before the old one stops and nothing has to be swapped in a single instant. The overlap is chosen from a fixed set of 0h, 1h, 24h, 168h — 24h by default — rather than being free text, because "forever" is not an overlap.
- OverlapBoth tokens work. Deploy the new one, confirm it, then let the old one lapse.
- After the overlapThe replaced token stops — or sooner, if it was already due to expire.
- RevokedStops at once, with no overlap. This is what a leak calls for.