/Docs
Register

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.

  1. 1Create an API key from Account → API
  2. 2Store the key in your server environment
  3. 3Pass it as a Bearer token in every request
API keys are created and deleted only from the logged-in dashboard. Keep them out of client-side code and public repositories.

Authentication

Pass your API key in the Authorization header on every request:

bash
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:

Base URL
https://api.openrevenue.com/api/v1

Machine-readable OpenAPI 3.1: /openapi.json. Hosted MCP: Docs → MCP.

Periods

Endpoints that accept a period query parameter support these values:

24hLast 24 hours
7dLast 7 days
30dLast 30 days (default)
90dLast 90 days
12mLast 12 months
this_monthCurrent calendar month (UTC)
this_weekCurrent week, starting Sunday (UTC)

Projects

GET/api/v1/projects

Returns all projects belonging to the authenticated user, ordered by creation date.

JavaScript

index.ts
const res = await fetch("https://api.openrevenue.com/api/v1/projects", {  headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}` },}) const data = await res.json()

cURL

bash
curl https://api.openrevenue.com/api/v1/projects \  -H "Authorization: Bearer openrevenue_your_key"

Response

json
{  "projects": [    {      "id": "44cc0aa0-912f-4067-83c7",      "name": "Madar Agency",      "domain": "example.com",      "createdAt": "2026-04-01T12:00:00.000Z"    }  ]}

Response fields

projects

array

List of projects owned by the authenticated user.

projects[].id

string

Unique project identifier. Use this as the tracker data-site value.

projects[].name

string

Project display name.

projects[].domain

string

Normalized domain for the project.

projects[].createdAt

string

ISO timestamp for when the project was created.

Errors

401
Invalid or missing API key

The Authorization header is missing or the Bearer token is invalid.

POST/api/v1/projects

Creates a new project. The domain is automatically normalized — protocols and paths are stripped.

Parameters

namerequired

Display name for the project, e.g. "My Website".

string

domainrequired

The site's domain, e.g. "mysite.com" or "https://mysite.com".

string

JavaScript

index.ts
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

bash
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

json
{  "id": "7f3a9d12-bc45-4e89-a012",  "name": "My Website",  "domain": "mysite.com",  "createdAt": "2026-05-25T10:00:00.000Z"}

Response fields

id

string

Unique project identifier.

name

string

Project display name.

domain

string

Normalized domain with protocol and path removed.

createdAt

string

ISO timestamp for when the project was created.

Errors

400
name and domain are required

The JSON body is missing a required field.

400
You already have a project for this domain

The 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.

401
Invalid or missing API key

The Authorization header is missing or the Bearer token is invalid.

403
API key is read-only

The key does not include the write scope.

DELETE/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

index.ts
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

bash
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

json
{  "ok": true}

Response fields

ok

boolean

True when the project was deleted successfully.

Errors

400
Pass {"confirm":true}…

Missing confirm:true in the request body.

401
Invalid or missing API key

The Authorization header is missing or the Bearer token is invalid.

403
API key is read-only

The key does not include the write scope.

404
Project not found

No project with that domain exists for the authenticated user.