OpheliaDocs
Search docs⌘K
DashboardCreate an account
v3 · Reference

Keys and scopes

Every v3 call carries a test or live key. This page lists which keys work, what each scope opens, and every answer you get when a key is refused.

Scopes

ScopeOpensOn a new test key
v3:search
POST /v3/search, POST /v3/availability, GET /v3/verticals.
Yes
v3:book
POST /v3/bookings, GET /v3/bookings/{booking_id}, continue, abandon, and every /v3/sessions route. Also search, availability and GET /v3/verticals.
Yes
v3:sites:read
GET /v3/verticals.
No
v3:act
Checked when a search or an availability read carries authorize.max_commitment: "commit". Such a read is refused either way: 403 insufficient_scope without it, 409 commitment_refused with it. It opens nothing you can use. v3:book alone lets a booking commit.
No

These are the scopes of keys made on the dashboard. A test key holds the v1 scopes plus v3:search and v3:book. A live key made in a project holds v3:search, and v3:book only when the project has a site switched on; without it, booking calls answer 403 insufficient_scope. A test or live key made outside a project holds the v1 scopes plus v3:search and v3:book. No key the dashboard makes holds v3:act.

A key made on the dashboard drives only the sites switched on for it. Any other site answers 403 merchant_not_enabled_for_key before anything is driven. A site covers its subdomains, and a path narrows it (amazon.com/fresh). opheliapractice.com is always allowed. A key with no list, made before keys carried one, is not restricted.

Scope by route

RouteA key needs
POST /v3/search
v3:search or v3:book
POST /v3/availability
v3:search or v3:book
POST /v3/bookings
v3:book
GET /v3/bookings/{booking_id}
v3:book
POST /v3/bookings/{attempt_id}/continue
v3:book
POST /v3/bookings/{attempt_id}/abandon
v3:book
POST /v3/bookings/{booking_id}/cancel, /modify
any key (always refused with 501)
POST /v3/sessions and every /v3/sessions/… route
v3:book
GET /v3/verticals
v3:sites:read, v3:search or v3:book
GET /v3/
any key
GET /v3/corrections
any key

Rate limits by route: Endpoints.

Refusals

These come before anything runs. None of them did anything on a site. wrong_key_environment, no_organization and v3_disabled carry the code in error_code. unauthorized and org_suspended carry it in both error and error_code. insufficient_scope, billing_required, free_tier_exhausted and billing_check_unavailable carry it in error, with no error_code.

HTTPCodeWhen, and what to do
401
unauthorized
No key, or a key that is not valid. Check the header.
403
wrong_key_environment
A key that is not a test, live or beta key on /v3, or a beta key on /v1. Use a test or live key.
403
insufficient_scope
The key lacks the scope the route needs: accepted_scopes lists the scopes that would do. Ask for one, or use a key that has it. A search or availability read at commit on a key without v3:act answers this too.
403
merchant_not_enabled_for_key
The site is not switched on for this key. Nothing was driven. On a session connect the body also has merchant and allowed_sites. Turn the site on for the key in the dashboard, or use a key that has it.
403
no_organization
The key is not tied to an organization.
403
org_suspended
Your organization is suspended. message (and reason, when set) says why.
402
free_tier_exhausted
A test key, after your organization has used its free allowance of 3 confirmed bookings. Every test-key call answers this, on v1 and v3, the practice site included. Switch to a live key with billing.
402
billing_required
A live key (or an earlier beta key), and your organization has no payment method on file. Search, availability and bookings answer this, the practice site included. Add billing in the dashboard.
503
billing_check_unavailable
A live or beta key, and Ophelia could not check billing. Nothing was done. Try again later.
503
entitlement_check_unavailable
A test key, and Ophelia could not check the free allowance. Nothing was done. Try again later.
503
v3_disabled
v3 is switched off on this deployment. GET /v3/ still answers 200 with "enabled": false.

The bodies, exactly:

json
// 401
{"error": "unauthorized", "error_code": "unauthorized", "detail": "Send an Ophelia API key as `Authorization: Bearer <key>` (oph_test_… or oph_live_…). …", "docs": "https://www.opheliaos.com/docs", "docs_markdown": "https://www.opheliaos.com/docs.md", "llms_txt": "https://www.opheliaos.com/llms.txt"}
 
// 403, a key that is not a test, live or beta key on /v3
{"error": "this key is not authorized for v3: use a test, live or beta key", "error_code": "wrong_key_environment"}
 
// 403, a beta key on /v1
{"error": "this key is not authorized for v1 — beta keys are for v3", "error_code": "wrong_key_environment"}
 
// 403, a missing scope (every v3 route answers with accepted_scopes)
{"error": "insufficient_scope", "required_scope": "v3:book", "accepted_scopes": ["v3:book"]}
 
// 403, a missing scope where several would do
{"error": "insufficient_scope", "required_scope": "v3:search", "accepted_scopes": ["v3:search", "v3:book"]}
 
// 403, a search or availability read at commit on a key without v3:act
{"error": "insufficient_scope", "required_scope": "v3:act"}
 
// 403
{"error_code": "no_organization", "error": "this credential is not bound to an organization"}
 
// 403
{"error": "org_suspended", "error_code": "org_suspended", "message": "…"}
 
// 402, a test key past the free allowance
{"error": "free_tier_exhausted", "message": "Test API keys are limited to 3 free calls. Switch to a live key with billing to continue.", "limit": 3}
 
// 402, a live key with no billing (a beta key's message starts "Beta API keys")
{"error": "billing_required", "message": "Live API keys require billing to be set up (a payment method on file). Add billing in the dashboard to continue."}
 
// 503, billing could not be checked
{"error": "billing_check_unavailable"}
 
// 503
{"error_code": "v3_disabled", "error": "…"}

Billing is the same on /v1 and /v3. A test key works while your organization's free allowance lasts: 3 confirmed bookings, shared by v1 test bookings and v3 test-key bookings. A v3 test-key booking counts once, when it succeeds. Bookings on the practice site never count. A live key, or an earlier beta key, needs a payment method on file.

Body and field checks that come next: Request rules. Too many calls: Rate limits.