POST/api/book/{token}/bookings

Create a public room booking

Creates a public room booking without requiring a bearer token. Provide starts_at and ends_at for a scheduled room, or duration_minutes for an on-demand room, which accepts 15, 30, or 60 minutes from now. Bookings must fall within the room's booking window and end before midnight; a blank title uses the default title.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 parameters · 4 body fields
tokenstringrequired
The room's public booking token.
resource_typestringoptional
The resource type to book; use this with collection tokens only.
resource_idintegeroptional
The integer identifier of the resource to book; use this with collection tokens only.

Public room booking details. Use starts_at and ends_at for scheduled rooms, or duration_minutes for on-demand rooms.

duration_minutesintegeroptional
On-demand rooms only
Allowed:153060
ends_atstringoptional
The booking's end time; bookings must end before midnight in the room's time zone.
starts_atstringoptional
ISO 8601, or YYYY-MM-DDTHH:MM in the room time zone
titlestringoptional
The booking title. The public booking page applies a length cap and uses its default title when this value is blank.

5 status codes
200Returns the created booking in a `data` object, including its identifier, title, and start and end times expressed in the room's local time without a time zone.
dataobjectoptional
The shape the public booking page uses: times are local to the room, without a zone
409Returned when the requested booking slot has just been taken.
410Returned when the token is unknown, Booking with TRMNL is off, or the room cannot be booked.
422Returned when the requested booking is outside the room's booking window.
429Returned when the token has exceeded its booking limit.

Error handling

A 409 is returned when the requested slot has just been taken, and a 410 when the token is unknown, Booking with TRMNL is off, or the room cannot be booked. A 422 is returned when the booking is outside the booking window, and a 429 when the token has exceeded its booking limit. duration_minutes must be 15, 30, or 60 for an on-demand room; starts_at must use ISO 8601 or YYYY-MM-DDTHH:MM in the room's time zone, and bookings must end before midnight. The token path parameter must identify a valid public booking token.