OpheliaDocs
Search docs⌘K
DashboardCreate an account
v3 · Reference

Request rules

Every check a request meets before anything is done on a site, and the exact answer when it fails. A request refused here did nothing.

The four body shapes

A refusal comes in one of four shapes. Read error_code first, then field, then error.

1. The v3 envelope: a check about what the request asks
json
{
"status": "failed",
"failure_class": "terminal",
"error_code": "wrong_id_namespace",
"error": "id \"ven_123\" is not a ent id — v1 and v3 mint separate namespaces and an id from one never resolves in the other"
}
2. Simple: error_code and error
json
{
"error": "name the thing to read: either `entity_id` (minted by POST /v3/search) or `url` (the `booking_url` that search returned beside it)",
"error_code": "invalid_input"
}
3. Field: no error_code, the field and its rule
json
{
"detail": "a whole number from 1 to 20 — how many of the item to order; leave it out for one",
"docs": "https://www.opheliaos.com/docs.md",
"error": "invalid request body",
"field": "quantity"
}
4. Keys and limits: the code is in error
json
{"error": "insufficient_scope", "required_scope": "v3:book", "accepted_scopes": ["v3:book"]}

Shape 4 covers insufficient_scope, billing_required, free_tier_exhausted, billing_check_unavailable, entitlement_check_unavailable (Keys and scopes) and rate_limited (Rate limits). On every v3 route insufficient_scope carries accepted_scopes; only the v3:act check answers {"error": "insufficient_scope", "required_scope": "v3:act"}. unauthorized, wrong_key_environment and no_organization are shape 2.

The order of checks

The first check that fails answers. In order:

1
The key: 401 unauthorized, 403 wrong_key_environment.
2
Your organization: 403 org_suspended, or over its rate limit for the route, 429 rate_limited. The call is counted here, even if a later check refuses it. Then the Ophelia-Practice-Timing header (400 invalid_practice_timing), then the Ophelia-Practice-Scenario header (400 invalid_practice_scenario), when sent.
3
The scope: 403 insufficient_scope. Then 403 no_organization, then 503 v3_disabled.
4
The body: readable JSON. Only the first 1 MiB is read.
5
The route's own fields: what to read or book, booking fields, the code on a continue.
6
On search and availability, max_commitment: "commit" without v3:act: 403 insufficient_scope. Then billing: 402 free_tier_exhausted for a test key past its free allowance, 402 billing_required for a live key when your organization has no billing set up.
7
Then v3 itself, in an order that depends on the route. A booking checks its idempotency_key first: a key already used replays the first answer and skips every check below. Availability and bookings then resolve the id (entity_id or url, then the offer) before the ask. Search and availability refuse commitment_refused before the ask. Then the ask (party_size, datetime, authorize, quantity, idempotency_key) and the site.

The Ophelia-Practice-Timing header, when sent, must be live, fast or instant: else 400 invalid_practice_timing. The Ophelia-Practice-Scenario header, when sent, must name a practice scenario: else 400 invalid_practice_scenario (Practice site).

The body

FieldRuleHTTPAnswer
the body
JSON. An empty body is read as {}.
400
Shape 2, invalid_input, "invalid JSON: …".
the body
At most 1 MiB. A longer body is cut there, so it is no longer JSON.
400
Shape 2, invalid_input, "invalid JSON: …".
entity_id or url
One is required on POST /v3/availability and POST /v3/bookings.
400
Shape 2, invalid_input, "name the thing to read: …" (or "name the thing to book: …").
url
An absolute http or https URL, not a bare host.
400
Shape 1, invalid_input, "`url` must be an absolute http(s) URL …".
code
Required on POST /v3/bookings/{attempt_id}/continue (otp_code also accepted).
400
Shape 2, invalid_input, "the challenge answer is required (send `code`)".

Booking fields

On POST /v3/bookings, in this order. A row that names no shape answers shape 3.

FieldRuleHTTPAnswer
selections
At most 8.
400
"at most 8 selections (size, colour, …), each naming one of the item's choices"
selections
Each name and value at most 80 characters.
400
"a selection's name and value are each at most 80 characters"
quantity
1 to 20, or absent for one.
400
"a whole number from 1 to 20 — how many of the item to order; leave it out for one"
authorize.currency
Three letters.
400
"an ISO-4217 code of three letters (USD, EUR, GBP) — the currency authorize.max_total is stated in"
authorize.buy_now
Only with max_commitment: "commit".
400
"only with authorize.max_commitment "commit": Buy Now may place the order in its press"
authorize.buy_now
Only with payment: "account_on_file".
400
"only with authorize.payment "account_on_file": it checks out on the person's own account"
authorize.payment
account_on_file or absent.
400
""account_on_file" (the card the person's account on the site holds), or absent"
card
Not with authorize.payment.
400
"send authorize.payment "account_on_file" or a card, not both: one way to pay"
payment_collection
Not with authorize.payment.
400
"send authorize.payment "account_on_file" or payment_collection, not both: one way to pay"
authorize.sign_in
true with account_on_file.
400
"true: account_on_file pays from the person's own account, so the drive signs in as them"
authorize.fill_identity
true with account_on_file or sign_in.
400
"true: signing in as the person (authorize.sign_in) needs it"
end_user
Required with account_on_file or sign_in.
400
"the person whose account pays: the id their session was saved under (POST /v3/sessions)"
authorize.max_total
Required with account_on_file.
400
"the most the order may cost: the review is held to it before the order is placed"
authorize.currency
Required with account_on_file.
400
"the ISO-4217 code authorize.max_total is stated in (USD, EUR, GBP)"
link_wallet
Only with payment_collection: "link_wallet".
400
"link_wallet is read only with payment_collection "link_wallet""
payment_collection
Not with a card.
400
Shape 2, card_with_payment_link (for link) or card_with_link_wallet (for link_wallet).
link_wallet.access_token
Required with payment_collection: "link_wallet".
400
"payment_collection "link_wallet" needs the person's Link access token (scope payment_methods.agentic)"
payment_collection
link, link_wallet or absent.
400
"payment_collection is "link", "link_wallet", or absent when the card is in the request"
payment_collection
Only at max_commitment: "commit".
400
Shape 1, invalid_input.

With sign_in and no account_on_file, the fill_identity and end_usermessages read "true: signing in as the person (authorize.sign_in) needs their identity authorized" and "the person to sign in as: the id their session was saved under (POST /v3/sessions)".

The ask

On search, availability and bookings. These answer shape 1 with invalid_input; error starts with the field and the value sent (party_size "65": …).

FieldRuleHTTPAnswer
party_size
0 to 64.
400
"must not be negative", "exceeds the maximum of 64; a party this size is a phone call"
datetime
RFC 3339 with a zone.
400
"must be RFC3339 (e.g. 2026-08-15T19:30:00Z) …"
authorize.max_commitment
read, begin, commit, or absent.
400
"must be one of read | begin | commit …"
authorize.max_total
A positive number.
400
"must be a positive amount in the checkout's currency, or absent for no ceiling"
authorize.currency
Three letters (upper-cased for you).
400
"must be an ISO-4217 code of three upper-case letters (USD, EUR, GBP), or absent"
idempotency_key
On POST /v3/bookings only. 1 to 128 letters, digits, . _ -, starting with a letter or digit. Also read from the Idempotency-Key header.
400
"1-128 chars of letters, digits, '.', '_' or '-' …"
site
Required when authorize allows a press (begin or commit).
400
"an intent that authorizes acting must name the site to act on"
Then what the ask may do
FieldRuleHTTPAnswer
authorize.max_commitment
A search or availability read takes read or begin.
409
Shape 1, commitment_refused, only on a key with v3:act. A key without v3:act, such as every key the dashboard makes, gets 403 insufficient_scope earlier.
authorize.max_commitment
A booking takes begin or commit.
409
Shape 1, commitment_refused.
site
Named, when the request names no entity.
409
Shape 1, no_site.
site
A host or a URL. A word with no dot is read as <word>.com.
409
Shape 1, unresolvable_site.
site
On the public internet.
409
Shape 1, private_address.
vertical
Not a broad category such as travel.
400
Shape 1, ambiguous_vertical, naming the values to send.
authorize.max_total
Required at commit for an order (shopping, or an unknown kind of ask with quantity, selections or a way to pay) and for a booking on a site that may charge a fee. A reservation's own card needs none. With account_on_file it is a 400 field error instead (above).
422
status: "needs_input", max_total_required, missing: [{"role": "authorize.max_total"}]. Nothing was attempted.

Ids and offers

Shape 1 for each.

FieldRuleHTTPAnswer
entity_id, offer_id, booking_id, attempt_id
The prefix the route expects (ent_, off_, bk_, att_). A v1 id never works.
400
wrong_id_namespace
entity_id
Minted for your organization.
404
unknown_entity
offer_id
Minted for your organization.
404
unknown_offer
offer_id
Belongs to the entity being booked.
400
offer_entity_mismatch
offer_id
Before its expires_at.
409
offer_expired
booking_id
Made by your organization.
404
unknown_booking
attempt_id
Started by your organization. A finished attempt answers its stored result (idempotent_replay: true); a lapsed one answers 410 attempt_expired.
404
unknown_attempt

Connected accounts

On POST /v3/sessions and its continue. These answer shape 2.

FieldRuleHTTPAnswer
end_user
Required.
400
end_user_required: "end_user is your own stable id for the person whose account this is"
profile.phone
E.164 or a 10-digit US number.
400
phone_invalid: "phone must be E.164 (+15551234567) or a 10-digit US number"
profile.phone or profile.email
One is required.
400
phone_or_email_required
site or url
Named, a host or URL, public.
400
no_site, unresolvable_site, private_address
code
Required on the continue.
400
code_required