API reference

Authentication

Authenticate a request by sending your API key in a header.

curl https://api.databuddy.cc/v1/query/websites \
  -H "x-api-key: $DATABUDDY_API_KEY"

Authorization: Bearer $DATABUDDY_API_KEY works the same way. Make the key in Organization settings → API keys; see API keys for presets, rotation and website limits.

Keep keys on your server. A key in browser code, a NEXT_PUBLIC_ variable or a public repo can be read by anyone.

Choose how to sign in

CallerMethod
Your server, CI job or scriptAPI key in x-api-key or Authorization: Bearer
Claude, Claude Code, Codex, Cursor, VS Code, ChatGPTDatabuddy account sign-in (OAuth) over MCP
A custom agent on an MCP SDKAPI key, sent to https://api.databuddy.cc/v1/mcp

The MCP server accepts a signed-in account or an API key, never a dashboard session cookie.

Pick scopes

ScopeLets the key
read:dataQuery analytics (POST /v1/query, POST /v1/query/compile), list websites (GET /v1/query/websites), run SQL and read replays
read:logsRead backend logs linked to a website
track:eventsSend events to POST /track on basket.databuddy.cc
read:linksRead short links
write:linksAdd, change and delete short links
read:monitorsRead uptime monitors, and run uptime query types on POST /v1/query
write:monitorsAdd, change, pause and delete uptime monitors
read:status_pagesRead status pages and incidents
write:status_pagesManage status pages, incidents and which monitors they show
manage:websitesAdd, change and delete websites, export visitor data, plus everything delete:visitor_data and write:source_maps allow
delete:visitor_dataDelete a visitor's or account's data and check its status
write:source_mapsUpload, list and delete source maps
read:flagsRead flag definitions with GET /public/v1/flags/definitions
manage:flagsAdd, change and delete feature flags and their rules
manage:configChange integrations and organization settings

Most integrations need only read:data. Add track:events if the same server also sends events.

A key can reach every website in the organization, or only the ones you pick. Link analytics through POST /v1/query?link_id= needs read:data on a key that reaches every website.

Fix auth errors

StatusCodeWhat to do
401AUTH_REQUIREDSend a key, or replace a revoked or expired one
403ACCESS_DENIEDAdd the missing scope, or give the key access to that website
{
  "success": false,
  "error": "Authentication required",
  "code": "AUTH_REQUIRED",
  "requestId": "req_abc123def456"
}

Let agents find auth on their own

ResourceURL
Sign-in walkthrough for agentshttps://www.databuddy.cc/auth.md
API cataloghttps://api.databuddy.cc/.well-known/api-catalog
MCP OAuth metadatahttps://api.databuddy.cc/.well-known/oauth-protected-resource

How is this guide?