OpheliaDocs
Search docs⌘K
DashboardCreate an account
v3 · Start

Get started

Get a test key, then make five calls on the practice site: search, read what is open, book at begin, book at commit with a code, and read the booking back.

Get a test key

Click Issue API key on the API keys page. A test key starts oph_test_ and holds v3:search and v3:book, which open every call below. It works while your organization's free allowance lasts: 3 confirmed bookings, shared with v1. Bookings on the practice site never count, but once the allowance is used up every test-key call, the practice site included, answers 402 free_tier_exhausted. A live key comes from a project's Go live step and needs billing set up (a payment method on the billing page). Keys and scopes has the details.

A test key drives the real site. Only opheliapractice.com is pretend. On any other site a booking made with a test key is real: it charges the card and cannot be cancelled through Ophelia. Every call below uses the practice site.

2. See what's open

Read the offers of one entity for the same evening.

curl
curl -X POST https://api.opheliaos.com/v3/availability \
-H "Authorization: Bearer YOUR_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{
"entity_id": "ent_bc78e91578f61f35555280df",
"datetime": "2026-11-14T19:00:00-05:00",
"party_size": 2
}'

You get 200 and seven offers, one per time. Three are shown. Keep the offer_id of the time you want.

json
{
"status": "succeeded",
"offers": [
{
"offer_id": "off_a97ba7d77afa03e54939af9e",
"entity_id": "ent_bc78e91578f61f35555280df",
"label": "6:00 PM",
"kind": "replay",
"expires_at": "2026-11-04T01:20:13Z"
},
{
"offer_id": "off_ea27bf414d62895bf8c9bec4",
"entity_id": "ent_bc78e91578f61f35555280df",
"label": "7:00 PM",
"kind": "replay",
"expires_at": "2026-11-04T01:20:13Z"
},
{
"offer_id": "off_b51de0f5d7da0e7031deb448",
"entity_id": "ent_bc78e91578f61f35555280df",
"label": "7:30 PM",
"kind": "replay",
"expires_at": "2026-11-04T01:20:13Z"
}
],
"drive_id": "drv_88cf1630c33a4d67cdcab42c"
}

3. Book at begin

Go as far as the checkout form and stop (max_commitment: "begin"). Send the offer's own time as datetime, written as the place's own local time with its offset, and fill_identity: true so the drive may type the email and phone.

curl
curl -X POST https://api.opheliaos.com/v3/bookings \
-H "Authorization: Bearer YOUR_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{
"entity_id": "ent_bc78e91578f61f35555280df",
"offer_id": "off_ea27bf414d62895bf8c9bec4",
"idempotency_key": "docs-begin-001",
"datetime": "2026-11-14T19:00:00-05:00",
"party_size": 2,
"customer": {
"name": "Jane Smith",
"email": "jane.smith.diner@gmail.com",
"phone": "+12124567890"
},
"authorize": {
"max_commitment": "begin",
"fill_identity": true
}
}'

You get 200 succeeded with a booking_id and no confirmation_number. The booking report says the form was reached and what it asks for. Nothing final was pressed. At begin, succeeded means the form was reached: to know whether something was booked, look at confirmation_number, not status.

json
{
"status": "succeeded",
"booking_id": "bk_d9a8ab05d47ca72b5c68615e",
"booking": {
"action": "Find a table",
"form": {
"fields": [
{ "key": "name", "tier": "pii" },
{ "key": "email", "tier": "pii" },
{ "key": "phone", "tier": "pii" }
],
"result": {
"complete": true,
"filled": ["name", "email", "phone"],
"missing": [],
"needs": []
}
},
"form_reached": true,
"screen": "identity",
"url": "https://opheliapractice.com/restaurant/practice-bistro",
"why": "the page asks for name, email, phone"
},
"cancellable": false,
"cancel_via": "contact the venue directly using the confirmation on this booking"
}

4. Book at commit, then send the code

Send the same booking without max_commitment, and with a new idempotency_key. A booking with no max_commitment presses the final button.

On a real site this call books. v3 cannot cancel it. On the practice site nothing is booked.
curl
curl -X POST https://api.opheliaos.com/v3/bookings \
-H "Authorization: Bearer YOUR_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{
"entity_id": "ent_bc78e91578f61f35555280df",
"offer_id": "off_ea27bf414d62895bf8c9bec4",
"idempotency_key": "docs-commit-001",
"datetime": "2026-11-14T19:00:00-05:00",
"party_size": 2,
"customer": {
"name": "Jane Smith",
"email": "jane.smith.diner@gmail.com",
"phone": "+12124567890"
},
"authorize": {
"fill_identity": true
}
}'

Practice Bistro texts a code, so the drive pauses: 202 requires_action. continue_with names the route for the code.

json
{
"status": "requires_action",
"booking_id": "bk_a12d331e7b3dcd72d6fb057f",
"attempt_id": "att_64bf82ce9687b7a239ed5f1c",
"challenge_type": "otp",
"resumable": true,
"live_url": "https://opheliapractice.com/restaurant/practice-bistro",
"continue_with": "POST /v3/bookings/att_64bf82ce9687b7a239ed5f1c/continue",
"cancellable": false,
"cancel_via": "contact the venue directly using the confirmation on this booking"
}

Send the code. On the practice site it is always 246810; on a real site, ask the person for the code the site sent them.

curl
curl -X POST https://api.opheliaos.com/v3/bookings/att_64bf82ce9687b7a239ed5f1c/continue \
-H "Authorization: Bearer YOUR_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{ "code": "246810" }'

You get 200 succeeded with the site's confirmation_number.

json
{
"status": "succeeded",
"booking_id": "bk_a12d331e7b3dcd72d6fb057f",
"attempt_id": "att_64bf82ce9687b7a239ed5f1c",
"confirmation_number": "PB-108554",
"confirmation": {
"reference": "PB-108554",
"screen": "confirmed",
"url": "https://opheliapractice.com/restaurant/practice-bistro"
},
"cancellable": false,
"cancel_via": "contact the venue directly using the confirmation on this booking"
}

5. Read the booking

Read the booking as it stands now by its booking_id, at any time.

curl
curl https://api.opheliaos.com/v3/bookings/bk_a12d331e7b3dcd72d6fb057f \
-H "Authorization: Bearer YOUR_TEST_KEY"
json
{
"status": "succeeded",
"booking_id": "bk_a12d331e7b3dcd72d6fb057f",
"attempt_id": "att_64bf82ce9687b7a239ed5f1c",
"confirmation_number": "PB-108554",
"confirmation": {
"reference": "PB-108554",
"screen": "confirmed",
"url": "https://opheliapractice.com/restaurant/practice-bistro"
},
"cancellable": false,
"cancel_via": "contact the venue directly using the confirmation on this booking"
}