API keys

Add a key for your server, CI job or script, then send it in a header.

Add the key

In Organization settings → API keys, choose Add API key, pick a preset and the websites it can reach. Copy the secret now: it's shown once.

Send it

curl -X POST "https://api.databuddy.cc/v1/query?website_id=$DATABUDDY_WEBSITE_ID" \
  -H "x-api-key: $DATABUDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"parameters":["summary_metrics"],"preset":"last_7d"}'

Authorization: Bearer $DATABUDDY_API_KEY works too. Keys start with dbdy_ followed by 48 characters.

Keep keys in environment variables or a secret manager, never in browser code or a repo. Share only the first characters shown in the dashboard.

Pick a preset

PresetScopesFor
Read onlyEvery read: scopeDashboards and reports that never change anything
Analyticsread:dataQueries, SQL, replays
Trackingtrack:eventsSending events to basket.databuddy.cc, including MCP server analytics
Source mapswrite:source_mapsUploading source maps from CI
Linksread:links, write:linksManaging short links
Monitorsread:monitors, write:monitorsUptime monitors, such as from Pulumi
Status pagesread:status_pages, write:status_pagesStatus pages and incidents
Configmanage:websites, manage:flags, manage:configChanging websites, flags and integrations

Authentication lists what every scope allows, including read:logs, delete:visitor_data and read:flags.

Limit a key to some websites

A key reaches every website in the organization, or only the ones you pick. A key limited to one website can read only that website, even with read:data. Link analytics need a key that reaches every website, because links belong to the organization.

Rotate or revoke a key

ActionEffect
RotateMakes a new secret for the same key; update your servers right away
RevokeStops the key immediately and can't be undone

Both are in each key's details. Adding, changing, rotating, revoking and deleting keys shows in the audit log; individual requests don't.

Fix key errors

StatusCodeWhat to do
401AUTH_REQUIREDSend the key, or replace a revoked or expired one
403ACCESS_DENIEDAdd the scope, or give the key access to that website
429RATE_LIMITEDWait Retry-After seconds; see rate limits

How is this guide?