---
title: "Create booking anchor"
method: POST
path: "/booking_anchors"
tags: ["Booking - Anchors"]
---

# Create booking anchor

`POST /booking_anchors`

## Request

- Base URL: `https://api.jammed.app/api/v2`
- URL: `https://api.jammed.app/api/v2/booking_anchors`
- Auth: none declared. Required headers: `Authorization`

Anchor a span of time in a room so only the slots immediately before and after it stay bookable that day. Takes the same fields as the admin form: a room and a start and end time.

The anchor's `date` and `duration` are worked out from `start_at` and `end_at`, and its `source` is always `api`. Times without a UTC offset are read in the studio's timezone.

Requires the `bookings.write` scope when using OAuth tokens.

## Headers

- `Authorization` string, required

## Request body

- object
  - `booking_anchor` object
    - `room_id` integer, required
    - `start_at` string, date-time, required
    - `end_at` string, date-time, required: Must be after `start_at`

## Response `201`

Booking anchor created

- BookingAnchor
  - `id` integer
  - `room_id` integer
  - `date` string, date: The day the anchor applies to, in the studio's timezone
  - `start_at` integer: Unix timestamp
  - `end_at` integer: Unix timestamp
  - `start_time` string: Format: YYYY-MM-DD HH:MM, in the studio's timezone
  - `end_time` string: Format: YYYY-MM-DD HH:MM, in the studio's timezone
  - `duration` integer, nullable: Length in seconds that a slot has to match when sticky bookings match durations
  - `source` 'auto' | 'manual' | 'api': `auto` anchors come from a booking, `manual` ones were added in the admin, and `api` ones through this API
  - `booking_code` string, nullable: Code of the booking an `auto` anchor was created from
  - `room` object
    - `id` integer
    - `name` string
    - `code` string

## Other responses

- `400`: Bad request - the `booking_anchor` key is missing
- `401`: Unauthorized - Invalid API key
- `403`: Forbidden - the OAuth token lacks the scope, or does not belong to an admin
- `422`: Unprocessable - the room does not exist, the times are missing or backwards, or sticky bookings are not turned on

## Changes

- **2026-11-05** (v2) `d512cbbe42fb`: 2 info
  - api tag `Booking - Anchors` added
  - api tag `Booking Anchor Endpoints` removed
- **2026-10-19** (v2) `c8d56b30958a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/jammed-org/apis/jammed-bookings-api/changes/booking_anchors/post.md)

---

[API](https://skmtc.dev/jammed-org/apis/jammed-bookings-api.md) - [All operations](https://skmtc.dev/jammed-org/apis/jammed-bookings-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jammed-org/apis/jammed-bookings-api/revisions/d512cbbe42fb?raw)
