Account API
List, create, and delete projects from your server.
Get started
Use the Account API when you need server-side project management. Analytics data lives in the Project API.
- 1Create an API key from Account → API
- 2Store the key in your server environment
- 3Pass it as a Bearer token in every request
Authentication
Pass your API key in the Authorization header on every request:
curl https://api.openrevenue.com/api/v1/projects \ -H "Authorization: Bearer openrevenue_your_api_key_here"curl https://api.openrevenue.com/api/v1/projects \ -H "Authorization: Bearer openrevenue_your_api_key_here"Requests without a valid key return 401 Unauthorized. Keys can be read or read write; create and delete require write.
Mobile session routes (Bearer session, not API key): GET/PATCH /api/account/profile and DELETE /api/account.
Base URL
All API endpoints are available under /api/v1 on the API host:
https://api.openrevenue.com/api/v1https://api.openrevenue.com/api/v1Machine-readable OpenAPI 3.1: /openapi.json. Hosted MCP: Docs → MCP.
Periods
Endpoints that accept a period query parameter support these values:
24hLast 24 hours7dLast 7 days30dLast 30 days (default)90dLast 90 days12mLast 12 monthsthis_monthCurrent calendar month (UTC)this_weekCurrent week, starting Sunday (UTC)Projects
/api/v1/projectsReturns all projects belonging to the authenticated user, ordered by creation date.
JavaScript
const res = await fetch("https://api.openrevenue.com/api/v1/projects", { headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}` },}) const data = await res.json()const res = await fetch("https://api.openrevenue.com/api/v1/projects", { headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}` },}) const data = await res.json()cURL
curl https://api.openrevenue.com/api/v1/projects \ -H "Authorization: Bearer openrevenue_your_key"curl https://api.openrevenue.com/api/v1/projects \ -H "Authorization: Bearer openrevenue_your_key"Response
{ "projects": [ { "id": "44cc0aa0-912f-4067-83c7", "name": "Madar Agency", "domain": "example.com", "createdAt": "2026-04-01T12:00:00.000Z" } ]}{ "projects": [ { "id": "44cc0aa0-912f-4067-83c7", "name": "Madar Agency", "domain": "example.com", "createdAt": "2026-04-01T12:00:00.000Z" } ]}Response fields
projectsarray
List of projects owned by the authenticated user.
projects[].idstring
Unique project identifier. Use this as the tracker data-site value.
projects[].namestring
Project display name.
projects[].domainstring
Normalized domain for the project.
projects[].createdAtstring
ISO timestamp for when the project was created.
Errors
401Invalid or missing API keyThe Authorization header is missing or the Bearer token is invalid.
/api/v1/projectsCreates a new project. The domain is automatically normalized — protocols and paths are stripped.
Parameters
namerequiredDisplay name for the project, e.g. "My Website".
string
domainrequiredThe site's domain, e.g. "mysite.com" or "https://mysite.com".
string
JavaScript
const res = await fetch("https://api.openrevenue.com/api/v1/projects", { method: "POST", headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ name: "My Website", domain: "mysite.com" }),}) const project = await res.json()const res = await fetch("https://api.openrevenue.com/api/v1/projects", { method: "POST", headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ name: "My Website", domain: "mysite.com" }),}) const project = await res.json()cURL
curl -X POST https://api.openrevenue.com/api/v1/projects \ -H "Authorization: Bearer openrevenue_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "My Website", "domain": "mysite.com" }'curl -X POST https://api.openrevenue.com/api/v1/projects \ -H "Authorization: Bearer openrevenue_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "My Website", "domain": "mysite.com" }'Response
{ "id": "7f3a9d12-bc45-4e89-a012", "name": "My Website", "domain": "mysite.com", "createdAt": "2026-05-25T10:00:00.000Z"}{ "id": "7f3a9d12-bc45-4e89-a012", "name": "My Website", "domain": "mysite.com", "createdAt": "2026-05-25T10:00:00.000Z"}Response fields
idstring
Unique project identifier.
namestring
Project display name.
domainstring
Normalized domain with protocol and path removed.
createdAtstring
ISO timestamp for when the project was created.
Errors
400name and domain are requiredThe JSON body is missing a required field.
400You already have a project for this domainThe authenticated user already owns an active project for the normalized domain.
400{domain} is already added to another OpenRevenue account…Another account already has an active project for this domain.
401Invalid or missing API keyThe Authorization header is missing or the Bearer token is invalid.
403API key is read-onlyThe key does not include the write scope.
/api/v1/projects/{domain}Permanently deletes a project and all its analytics data. Requires a write-scoped API key and {"confirm":true} in the JSON body. This action cannot be undone.
JavaScript
const res = await fetch("https://api.openrevenue.com/api/v1/projects/mysite.com", { method: "DELETE", headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ confirm: true }),}) const result = await res.json()const res = await fetch("https://api.openrevenue.com/api/v1/projects/mysite.com", { method: "DELETE", headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ confirm: true }),}) const result = await res.json()cURL
curl -X DELETE https://api.openrevenue.com/api/v1/projects/mysite.com \ -H "Authorization: Bearer openrevenue_your_key" \ -H "Content-Type: application/json" \ -d '{"confirm":true}'curl -X DELETE https://api.openrevenue.com/api/v1/projects/mysite.com \ -H "Authorization: Bearer openrevenue_your_key" \ -H "Content-Type: application/json" \ -d '{"confirm":true}'Response
{ "ok": true}{ "ok": true}Response fields
okboolean
True when the project was deleted successfully.
Errors
400Pass {"confirm":true}…Missing confirm:true in the request body.
401Invalid or missing API keyThe Authorization header is missing or the Bearer token is invalid.
403API key is read-onlyThe key does not include the write scope.
404Project not foundNo project with that domain exists for the authenticated user.