Docs

Create a booking

Preview· P9
POST
/bookings

Books a slot from GET /booking-types/{btype_id}/availability. If the slot has been taken in the meantime, you get conflict; fetch availability again and offer another time.

  • If the booking type doesn't require host confirmation, the booking is confirmed straight away. Agoo confirms it to the attendee and the host, and sends reminders by your organisation's settings.
  • If it does (requires_confirmation), the booking starts as pending and holds its slot. Agoo tells the attendee their request was received and asks the host to confirm or decline it before confirm_by. See POST /bookings/{booking_id}/confirm and /decline.
  • Fires booking.created for every booking, with its status.
  • A confirmed in_person booking also creates an expected visit with a QR pass, so the attendee can check in on arrival. Its visit_id is set, and visit.created and pass.sent fire too. For a pending booking this happens when the host confirms it.
  • custom_fields are checked against the visit form for the booking type's visit_type. With a publishable key, they may contain only the fields in the booking type's public_form; a field your staff fill in returns validation_failed at body.custom_fields.<key>.
  • Leave host_id out to let Agoo pick a free host from the booking type's hosts.
  • A booking_type_id that isn't a booking type you can book (unknown, turned off, or private with a publishable key), or a host_id that isn't one of its hosts, returns validation_failed.

Scope: bookings:write · Plan: Pro and Enterprise in live mode; every plan in test mode. Publishable keys: allowed for public booking types.

Authorization

headerAuthorizationBearer <token>

Send Authorization: Bearer <token> on every request. The token is one of:

PrefixWhat it isWhere it may be used
agoo_sk_live_Secret key, live modeYour servers only
agoo_sk_test_Secret key, test modeYour servers only
agoo_pk_live_Publishable key, live modeBrowsers and apps: create pre-registrations and bookings, read public booking types (with their intake questions) and their free slots, read the visit types open for pre-registration with their public forms. Never lists people.
agoo_pk_test_Publishable key, test modeAs above, in test mode

Admins create keys in Console → Developers → API keys and choose each key's scopes. A key is shown once. Never put a secret key in a URL, a browser or a mobile app.

Scope: bookings:write

Header Parameters

Idempotency-Key*string

A UUID you generate for this operation. If you retry with the same key within 24 hours, Agoo returns the original response instead of acting twice. While the first request is still running, a retry returns conflict. Reusing a key with a different request returns idempotency_key_reused. Responses with rate_limited, internal_error or unavailable aren't stored, so retry those with the same key.

Formatuuid

Request Body

application/json
  1. body
booking_type_id*BookingTypeId

A booking type ID (TypeID with the btype prefix).

Match^btype_[0-7][0-9a-hjkmnp-tv-z]{25}$
Example"btype_01kn44arm0eya81713cpbnfbpq"
start_at*string

The start_at of a free slot.

Formatdate-time
host_id?PersonId

One of the booking type's hosts. Leave it out to let Agoo pick a free host.

Match^person_[0-7][0-9a-hjkmnp-tv-z]{25}$
Example"person_01kjsesxm0e4zbyvkr7bcfxbfg"
time_zone?string

The attendee's IANA time zone for messages. Defaults to the booking type's.

attendee*

The person booking. Give a phone number, an email address or both.

custom_fields?

Answers to your organisation's custom fields, keyed by field key. The keys and allowed values come from the JSON Schema of the matching form (GET /forms). Keys that aren't in the form are rejected. Questions the form marks as required aren't enforced through the API; they're asked when the visitor checks in or completes their pre-registration. Answers to fields an admin marked sensitive or masked are never included for API keys or connected apps, nor in events and webhooks: they stay inside Agoo, seen only by the roles the admin chose.

Example
{  "vehicle_plate": "GR 4521-24",  "bringing_laptop": true}
duration_minutes?integer

One of the booking type's durations. Defaults to its duration_minutes.

Range5 <= value <= 1440
meeting_kind?MeetingKind

One of the booking type's meeting_kinds. Defaults to its first.

Value in"in_person""virtual""external""phone"
remind_by?string

How the attendee wants their confirmation and reminders. Defaults to your organisation's order.

Value in"sms""email""whatsapp"

Response Body

The new booking.

application/json
  1. response

A booked meeting.

id*BookingId

A booking ID (TypeID with the booking prefix).

Match^booking_[0-7][0-9a-hjkmnp-tv-z]{25}$
Example"booking_01m4dtqd00eq4rtc1jdsr1gr6z"
status*BookingStatus

Where the booking is. Most bookings are confirmed as soon as they're made. When the booking type requires host confirmation, a booking starts as pending and holds its slot until the host confirms it (confirmed), declines it (declined) or doesn't answer in time (expired). A confirmed booking can be cancelled; the attendee can also cancel a pending request from their link.

Value in"pending""confirmed""declined""expired""cancelled"
booking_type_id*BookingTypeId

A booking type ID (TypeID with the btype prefix).

Match^btype_[0-7][0-9a-hjkmnp-tv-z]{25}$
Example"btype_01kn44arm0eya81713cpbnfbpq"
host_id*PersonId

A person ID (TypeID with the person prefix).

Match^person_[0-7][0-9a-hjkmnp-tv-z]{25}$
Example"person_01kjsesxm0e4zbyvkr7bcfxbfg"
start_at*string
Formatdate-time
end_at*string
Formatdate-time
time_zone*string

The time zone used in messages to the attendee.

Example"Africa/Accra"
meeting_kind*MeetingKind

in_person at a site, virtual (video link), external (another address) or phone.

Value in"in_person""virtual""external""phone"
site_id*|
Match^site_[0-7][0-9a-hjkmnp-tv-z]{25}$
meeting_url*|

The video link for virtual meetings.

Formaturi
meeting_provider*|

The provider Agoo makes this video booking's meeting with, through the host's connected account. null for a link pasted on the booking type or the host's own.

Value in"google_meet""teams""zoom"null
meeting_state*string

The automatic meeting link: none (not automatic), pending (being made; meeting_url follows), ready (in meeting_url), failed (the host is asked to add one).

Value in"none""pending""ready""failed"
address*|

The meeting address for external meetings.

attendee*

The person who booked. Give a phone number, an email address or both, so Agoo can confirm and remind them.

visit_id*|

The expected visit created for an in-person booking once it's confirmed. null while the booking is pending, and for bookings that were never confirmed.

Match^visit_[0-7][0-9a-hjkmnp-tv-z]{25}$
custom_fields*

Answers to your organisation's custom fields, keyed by field key. The keys and allowed values come from the JSON Schema of the matching form (GET /forms). Keys that aren't in the form are rejected. Questions the form marks as required aren't enforced through the API; they're asked when the visitor checks in or completes their pre-registration. Answers to fields an admin marked sensitive or masked are never included for API keys or connected apps, nor in events and webhooks: they stay inside Agoo, seen only by the roles the admin chose.

Example
{  "vehicle_plate": "GR 4521-24",  "bringing_laptop": true}
confirm_by*|

For booking types that require host confirmation: when the request expires if the host hasn't answered, which is the end of the confirmation window or the meeting's start, whichever comes first. null for bookings that didn't need confirmation.

Formatdate-time
confirmed_at*|

When the booking was confirmed: when it was made, or when the host confirmed it. null if it hasn't been confirmed.

Formatdate-time
declined_at*|

When the host declined the booking.

Formatdate-time
decline_reason*|

The host's reason for declining, if they gave one. The attendee sees it only if the host chose to share it.

cancelled_at*|
Formatdate-time
cancellation_reason*string|null
duration_minutes*integer

The booking's length, one of its booking type's durations.

remind_by*|

The channel the attendee chose for their messages (null: your organisation's order).

Value in"sms""email""whatsapp"null
no_show*boolean

The attendee didn't come.

source*string

Where the booking was made.

Value in"booking_page""embed""api""console""app"
booking_type_name*|

The booking type's name, when you can read it.

host_name*|

The host's name, when you can read it.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
curl -X POST 'https://api.agoohq.com/v1/bookings' \  -H 'Idempotency-Key: 3f6b2a1e-8c4d-4f7a-9b2e-5d1c0a7e9f64' \  -H 'Content-Type: application/json' \  -d '{  "booking_type_id": "btype_01kn44arm0eya81713cpbnfbpq",  "start_at": "2026-10-16T10:00:00Z",  "attendee": {    "name": "Ama Owusu",    "phone": "+233241234567",    "email": "ama@coastline.example",    "company": "Coastline Consult"  },  "custom_fields": {}}'

{  "id": "booking_01m4dtqd00eq4rtc1jdsr1gr6z",  "status": "confirmed",  "booking_type_id": "btype_01kn44arm0eya81713cpbnfbpq",  "host_id": "person_01kjsesxm0e4zbyvkr7bcfxbfg",  "start_at": "2026-10-16T10:00:00Z",  "end_at": "2026-10-16T10:30:00Z",  "time_zone": "Africa/Accra",  "meeting_kind": "in_person",  "site_id": "site_01kjpt3yw0fz0v414608h9x65s",  "meeting_url": null,  "meeting_provider": null,  "meeting_state": "none",  "address": null,  "attendee": {    "name": "Ama Owusu",    "phone": "+233241234567",    "email": "ama@coastline.example",    "company": "Coastline Consult"  },  "visit_id": "visit_01m4dtqdz8f59rarmdksqjprz9",  "custom_fields": {},  "confirm_by": null,  "confirmed_at": "2026-10-08T13:20:00Z",  "declined_at": null,  "decline_reason": null,  "cancelled_at": null,  "cancellation_reason": null,  "duration_minutes": 30,  "remind_by": null,  "no_show": false,  "source": "booking_page",  "booking_type_name": "Meet Treasury",  "host_name": "Kwame Mensah",  "created_at": "2026-10-08T13:20:00Z",  "updated_at": "2026-10-08T13:20:00Z"}