Before you start
You must have theowner or admin role. A member sees the cards without the buttons.
The two keys
Settings → API holds exactly one key of each type. Which one you need depends on whether you’re reading data or writing events.
Neither key belongs in browser code. Browser and mobile installs carry the public
workspace ID from Settings → General instead, which is safe to ship.
The write key sends events. It reads nothing, so any server-side or agent read of your
data uses the Agent key instead. The mobile SDKs also send the write key to
POST /attribution/lookup, to resolve the install they already own. Do not call that
route from your own backend with an email a user typed. See
Authentication.
A key authorizes exactly one workspace. If a response looks like someone else’s data,
you’re holding another workspace’s key.
Named keys carry write scopes
The Agent key reads and never writes. It resolves todatalyr:read alone and always
will.
A named key carries the scopes someone granted it: datalyr:read,
datalyr:write:rules, datalyr:write:links, datalyr:write:reports, or
datalyr:propose:scripts. A request
without the matching scope returns 403 and names the scope it wanted. See
Agent access.
Approve an agent’s key request
An agent that needs a key sends you a link towww.datalyr.com/approve.
- Open the link.
- Sign in if Datalyr asks.
- Read the requester, the workspace, and each scope row.
- Select Approve or Deny.
The agent’s side of this flow is in
Authentication.
Set a key’s rate limit
Every new named key allows 100 requests per minute. The owner can raise or lower that per key.- Open Settings → API.
- Find the named key.
- Enter the new requests-per-minute limit.
- Save.
GET /v1/usage reports the limit in effect as rate_limit. A plan downgrade keeps
limits already set.
Generate a key
- Open Settings → API.
- Find the card for the key you need.
- Select generate key.
- Confirm in the dialog.
- Copy the full value from the one-time dialog.
- Store it in an environment variable or a secret manager.
Copy the value before you close the dialog. We store a hash for lookup and never show
the full value again, so the card afterwards shows only a masked preview such as
dk_agent_••••••••a1b2.Rotate a key
- List every service that holds the current key.
- Select regenerate on the card.
- Confirm in the dialog.
- Copy the new value from the one-time dialog.
- Update the secret in every environment.
- Redeploy or restart those services.
Verify
Run one authenticated request with the new key:200 response naming your workspace proves the key works. See
Authentication for the full 401 body.
If a key leaks
- Select regenerate on the affected card immediately.
- Update every consumer with the new value.
- Review your own service logs for requests you did not make.
When it doesn’t work
Next
- Authentication: how
/v1reads the header. - API reference: every endpoint the Agent key unlocks.
- Connect Claude or Codex: read your data with OAuth and no stored key.