---
title: "Book a room as a visitor"
method: POST
path: "/api/book/{token}/bookings"
tags: ["Public booking"]
---

# Book a room as a visitor

`POST /api/book/{token}/bookings`

## Request

- Base URL: `https://trmnl.com`
- URL: `https://trmnl.com/api/book/{token}/bookings`
- Auth: none declared

Public: no bearer token. The same rules as the public booking page: within the room booking window, ending before midnight, and on an on-demand room duration_minutes (15, 30 or 60) from now instead of times. The title is capped and defaults when blank. Limited per token.

## Query parameters

- `resource_type` string
- `resource_id` integer

## Request body

- object
  - `title` string, nullable
  - `starts_at` string: ISO 8601, or YYYY-MM-DDTHH:MM in the room time zone
  - `ends_at` string
  - `duration_minutes` 15 | 30 | 60: On-demand rooms only

## Response `200`

Booked

- object
  - `data` PublicBookingEvent: The shape the public booking page uses: times are local to the room, without a zone
    - `id` integer
    - `title` string
    - `startsAt` string
    - `endsAt` string
    - `actionLabel` string: Present when the visitor may cancel or end it
    - `actionMethod` 'delete' | 'patch'
    - `actionPath` string
    - `actionConfirm` string

## Other responses

- `409`: The slot was just taken
- `410`: Unknown token, Booking with TRMNL off, or a room that cannot be booked: all look the same
- `422`: Outside the booking window
- `429`: Too many bookings from one token

---

[API](https://skmtc.dev/trmnl/apis/trmnl-api.md) · [All operations](https://skmtc.dev/trmnl/apis/trmnl-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trmnl/apis/trmnl-api/revisions/66179e6d663b?raw)
