Websites know who you are because you sign in. Programs cannot fill in a sign-in form, so they carry a credential instead. An API key is the simplest kind: create it once in a dashboard, store it where your code runs, and send it with every request.
curl https://api.example.com/v1/reports -H "Authorization: Bearer YOUR_KEY"Keys, tokens and OAuth
| Credential | Typical use | Who creates it |
|---|---|---|
| API key | One service or project, server to server | You, in the dashboard |
| Personal access token | Scripts and tools acting as you across projects | You, with chosen permissions |
| OAuth access token | Third-party apps you approve | The app, after you approve it on a consent screen |
The line between "key" and "token" is blurry; what matters is the scope (what it can do), the owner (whose access it borrows) and how it can be revoked.
How Reveata's credentials work
Reveata's REST API accepts three kinds (API introduction):
- Website API keys start with
dt_site_, are created under a website's Settings → Developer and work for that one website only, server side: stats, goals, payments and identify calls. - Account access tokens start with
dt_pat_, are created under Account → API / MCP and carry the permissions you choose, such asanalytics:readorgoals:write. They are meant for scripts, the CLI and tools that work across several websites. - OAuth access tokens are issued to apps you connect, such as MCP clients, after you approve them on a consent page.
Keys are shown once when you create them; Reveata stores only a hash. A token can only do what you chose for it and what your role on each website allows, so lowering someone's role lowers their tokens too. GET /api/v1/whoami tells you which credential you sent and what it can reach. Requests are rate limited to 600 per minute per credential, with a 429 answer and a Retry-After header above that.
Other secrets follow the same pattern: proxy secrets start with dt_proxy_, crawler forwarding tokens with dt_bot_, and webhook signing secrets with whsec_.
Keeping keys safe
- Never put a secret key in front-end code. Anything shipped to a browser or app can be read. Reveata's tracking id (
ws_…) is public on purpose; API keys are not. - Use environment variables, not source files, and keep
.envfiles out of version control. - Give the least access needed. A read-only token for a dashboard script, a website key for one backend.
- Rotate on leaks. Roll or revoke the key at once and update the server that used it.
- One key per use. Separate keys make it possible to revoke one integration without breaking others.