Reporting API
Pull an account's monthly totals — leads, appointments, booking rate, revenue — into your own reports with one bearer key.
curl -H "Authorization: Bearer YOUR_KEY" \
"https://app.onepath.ai/api/reporting/v1/accounts"
{
"owner": { "type": "partner", "code": "your_agency", "name": "Your Agency" },
"accounts": [
{
"id": 42,
"name": "Wahoo Plumbing",
"website": "callwahoo.com",
"time_zone": "America/Chicago",
"created_at": "2026-05-01T14:02:11Z"
}
]
}
Every account in that list can be queried for its numbers with Account metrics. Two endpoints, both GET, both JSON.
| Endpoint | Returns |
|---|---|
| /api/reporting/v1/accounts | the accounts your key can see |
| /api/reporting/v1/accounts/{id}/metrics?from=&to= | one account's totals for a date range |
What you can see
The API returns totals only. No leads, no customer names, phones or addresses, no conversations. If you need a number that is not one of the six in Account metrics, it is not available through this API.
Which accounts appear depends on who the key belongs to:
- A partner key sees the accounts that were referred by your agency and still have sharing turned on. An account owner can turn sharing off for your agency at any time in their OnePath settings; that account then disappears from your list and its metrics endpoint answers 404.
- An account key sees only that one account.
Getting a key
Keys are issued by OnePath — there is no self-serve page. Ask your OnePath contact for one. It arrives as a single string that begins with op_rk_; the whole string, prefix included, is the key. Replace YOUR_KEY in the examples on these pages with it. Keep it private: it is shown once and OnePath cannot recover it, only replace it. If a key leaks, ask for a new one and the old one is revoked.
Send it on every request as a bearer token:
Authorization: Bearer YOUR_KEY
Rate limits
- 60 requests per minute per key
- 30 requests per minute per IP address before authentication
Results for a given account and date range are cached for six hours, so calling the same range repeatedly returns quickly and does not count against anything but the request limit.
Errors
Every refusal has the same shape. Branch on error; show message to a human.
{ "error": "invalid_date_range", "message": "to must be on or after from" }
| Status | error | Meaning |
|---|---|---|
| 401 | unauthorized | missing, blank, unknown or revoked key |
| 404 | account_not_found | the account is not visible to this key, or does not exist |
| 422 | invalid_date_range | from/to missing, not YYYY-MM-DD, inverted, or more than 366 days apart |
| 422 | service_failure | something failed on OnePath's side; retry later |
| 429 | rate_limited | slow down and retry after a minute |
A 404 is the same for opted-out and nonexistent accounts
The API never confirms that an account exists unless your key may see it. If an account you expect is missing from /accounts, the owner has turned sharing off for you — ask them, not the API.