---
title: "Link Booking To Account"
method: POST
path: "/bookings/{booking_id}/link"
tags: ["Bookings"]
---

# Link Booking To Account

`POST /bookings/{booking_id}/link`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/bookings/{booking_id}/link`
- Auth: HTTP bearer

Link an existing booking to the authenticated user's account.

This endpoint is used after a guest creates an account post-booking.
It verifies that the booking's guest email matches the user's email
before linking.

**Security:**
- User must be authenticated
- Booking guest_email must match user's email (from user_identities),
  or, for a booking in a confirmed multi-stay checkout, the payer's
  email. The payer links every stay of the checkout; a room's own lead
  guest links only that stay's rooms
- Booking must not already be linked to another account, and a sibling
  linked to another account is left with it

## Path parameters

- `booking_id` integer, required

## Headers

- `API-Version` '1'

## Response `200`

Booking successfully linked to account

- BookingLinkResponse: Response after linking a booking to a user account.
  - `success` boolean, required: Whether the linking was successful
  - `booking_id` integer, required: The booking ID that was linked
  - `message` string, required: Human-readable status message
  - `linked_booking_ids` integer[]: Every booking now linked, including the other lines of a group booking paid in the same checkout, and, when the payer links a multi-stay checkout, every booking at every park.

## Other responses

- `400`: Email mismatch - cannot link
- `404`: Booking not found
- `409`: Booking already linked to an account
- `422`: Validation Error

---

[API](https://skmtc.dev/totalparks/apis/total-parks-public-api.md) · [All operations](https://skmtc.dev/totalparks/apis/total-parks-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/totalparks/apis/total-parks-public-api/revisions/dcb4c822e2c6?raw)
