API reference
Account API
On this page
Account endpoints work across websites and need an account access token, not a site secret key.
Endpoints
| Request | Returns |
|---|---|
| GET /api/v1/account | The token's owner (email, name) and the token's name, scopes and websites (null means all). |
| GET /api/v1/websites | Websites the token can use: id, name, domains, createdAt. |
| POST /api/v1/websites | Creates a website from JSON with name and domain. Needs the write scope on a token for all websites. Returns the website and its secret key, once. |
List websites
terminal
curl https://metricraven.com/api/v1/websites \
--header "Authorization: Bearer $METRICRAVEN_TOKEN"Response
{
"websites": [
{
"id": "ana_pub_1a2b3c4d5e6f7a8b",
"name": "Acme",
"domains": ["acme.com"],
"createdAt": "2026-10-01T09:30:00.000Z"
}
]
}Create a website
terminal
curl --request POST https://metricraven.com/api/v1/websites \
--header "Authorization: Bearer $METRICRAVEN_TOKEN" \
--header 'Content-Type: application/json' \
--data '{ "name": "Acme", "domain": "acme.com" }'Add the tracking script with the returned id as data-site-id, and store secretKey on your server for events and payments.
Details
- Creating a website counts toward your plan's website allowance; over it, the API returns 402 website_limit.
- Read reports for a website with the Reports API, adding
site=WEBSITE_ID.