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.
Pick a preset
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
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
Related
How is this guide?