Authentication
Every API request authenticates with a bearer token in the Authorization header:
curl https://api.onivos.com/contacts \
-H "Authorization: Bearer onv_test_xxxxxxxx"There is no other way in. A missing, malformed, expired or revoked token returns 401 immediately — it never falls back to an anonymous identity.
Token types
| Prefix | What it is | Acts as | Expires |
|---|---|---|---|
onv_test_ | Test key — same API, test-mode data and strict rate limits | Your organization, admin role | Never (until revoked) |
onv_live_ | Live key — full production access | Your organization, admin role | Never (until revoked) |
onv_pat_ | Personal access token — acts as you, for scripts and AI clients | The member who created it, capped by their current role | Mandatory: 30, 90 or 365 days |
An organization key is not tied to a person, so it survives staff changes — use it for server-to-server integrations. A personal access token is tied to you: if your role is demoted or your membership is removed, the token weakens or dies with it. Use it for your own tooling and for MCP clients.
The secret is shown once
Creating or rolling a key returns the full secret in that one response. It is never retrievable again — store it in your secret manager immediately. What the app and the API show afterwards is only the display prefix (onv_live_a1b2c3d4).
Getting a key
In the app: Settings → Developer → API keys → Create key. Pick a name, tick the scopes, choose live or test.
Over the API (session-authenticated, owner or admin):
| Method | Path | Description |
|---|---|---|
GET | /developer/keys | List the organization's keys (no secrets). |
POST | /developer/keys | Create a key. Body: name, scopes[], test. Returns 201 with secret. |
POST | /developer/keys/{id}/roll | Issue a new secret. The old one keeps working for 24 hours, so you can redeploy without downtime. |
DELETE | /developer/keys/{id} | Revoke. Takes effect within a minute across the fleet. |
GET | /developer/keys/{id}/usage?range=30 | Call volume and rate-limited counts. Returns calls, rateLimited, series. |
GET | /developer/pats · POST · DELETE /developer/pats/{id} | The same lifecycle for personal access tokens. POST takes name, scopes[], expiresInDays (30 | 90 | 365). |
Test keys exist on every plan, including Free. Live keys and personal access tokens require a plan with API access — creating one on Free returns 403.
Scopes
A token carries a list of scopes in the grammar <group>:<action>:
contacts:read read-only access to contacts, companies, deals, tasks, tickets
contacts:write read AND write — write always implies read
commerce:* everything in the commerce groupThe group comes from the endpoint you call (see the table in API overview); the action comes from the method — GET and HEAD are read, everything else is write.
Grant the narrowest set that does the job. A key with contacts:read calling POST /contacts gets:
{
"error": {
"code": "insufficient_scope",
"message": "API key lacks the contacts:write scope"
}
}with status 403.
What a key can and cannot do
- It is bound to one organization. The key determines the tenant; an
X-Tenant-Idheader is ignored. To work across organizations, create a key in each. - It acts with the admin role. Owner-only surfaces — transferring ownership, deleting the organization, changing the plan — stay session-only.
- It cannot reach session-only endpoints. Sign-in, MFA, platform administration and similar have no scope group at all and always return
403.
Test mode
A test key talks to the same endpoints with the same shapes. What differs:
- Rate limits are fixed and strict (1 request/second, burst of 10) regardless of your plan.
- Outbound side effects that cost real money or reach real people are held back.
That makes a test key the right credential for the docs playground, for CI, and for the first five minutes of an integration.
Next
- Errors — what comes back when a call fails.
- Rate limits — the budget your token gets.
- Connect your AI — using a personal access token from an MCP client.