---
title: "Set Message Booking"
method: PUT
path: "/email/threads/{thread_id}/messages/{message_id}/booking"
tags: ["email"]
---

# Set Message Booking

`PUT /email/threads/{thread_id}/messages/{message_id}/booking`

Move one message to another booking, and return the regrouped thread.

Grouping is derived on every read, so an override is the one part of it that
is stored — and it must outrank re-derivation, or the next sync would undo a
correction someone made deliberately.

Returns the whole thread rather than an acknowledgement: moving a message
changes where the boundaries fall, so the client cannot compute the new
grouping from a success flag, and a second round-trip to find out would show
a stale panel in between.

## Path parameters

- `thread_id` string, uuid, required
- `message_id` string, uuid, required

## Request body

- MessageBookingOverrideRequest — Move one message to a different booking within its thread. ``reference`` is a booking reference already present in this thread, or NULL meaning "this message belongs to no booking". NULL is a real answer, not an absence — a message can be spam that landed mid-conversation — so the route records that a decision was made separately from what it was. Deliberately NOT a ``booking_record_id``: measured on production, the references guests quote do not match any reservation we hold, so the only stable handle inside a thread is the reference itself.
  - `reference` string, nullable

## Response `200`

Successful Response

- EmailThreadDetail — Thread header + the full ordered back-and-forth.
  - `id` string, uuid, required
  - `tenant_id` string, uuid, required
  - `email_account_id` string, uuid, required
  - `customer_profile_id` string, uuid, nullable
  - `subject` string, nullable
  - `status` string, required
  - `source` string, required
  - `guest_email` string, nullable
  - `guest_name` string, nullable
  - `message_count` integer, required
  - `started_at` string, date-time, nullable
  - `last_message_at` string, date-time, nullable
  - `booking_intent` boolean, required
  - `booking_made` boolean, required
  - `booking_value_cents` integer, nullable
  - `booking_value_currency` string, nullable
  - `booking_outcome_set_at` string, date-time, nullable
  - `disposition` string, nullable
  - `outcome_agent_ref` string, nullable
  - `review_status` string, required
  - `outcome` string, nullable
  - `contact_source` string, nullable
  - `local_hour_of_day` integer, nullable
  - `local_day_of_week` integer, nullable
  - `primary_property_id` string, uuid, nullable
  - `primary_property_name` string, nullable
  - `booking_intent_evidence` string, nullable
  - `stay_link_status` string
  - `linked_stay` LinkedStayRead — The stay a thread was tied to, and how. Carries ``match_method`` because an unexplained link is not auditable: an operator correcting a wrong link needs to know whether it came from a quoted reference or a model reading a surname.
    - `booking_record_id` string, uuid, required
    - `reservation_id` string, required
    - `property_name` string, required
    - `checkin` string, date, required
    - `checkout` string, date, required
    - `guest_name` string, nullable
    - `source` string, nullable
    - `match_method` string, required
  - `messages` EmailMessageDetail[]
    - `id` string, uuid, required
    - `direction` string, required
    - `from_address` string, nullable
    - `to_addresses` string[], nullable
    - `cc_addresses` string[], nullable
    - `sent_at` string, date-time, nullable
    - `subject` string, nullable
    - `body_raw` string, nullable
    - `body_clean` string, nullable
    - `is_automated` boolean, required
    - `is_internal` boolean, required
    - `attachments` object[], nullable
    - `sequence` integer, required
    - `booking_ref_override` string, nullable
    - `booking_ref_override_at` string, date-time, nullable
  - `booking_groups` MessageBookingGroupRead[]
    - `ordinal` integer, required
    - `reference` string, nullable
    - `message_ids` string[]

## Other responses

- `404` — Email thread or message not found
- `422` — Reference is not one of this thread's bookings

---

[API](https://skmtc.dev/getanana/apis/cleon-api.md) · [All operations](https://skmtc.dev/getanana/apis/cleon-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getanana/cleon-api/revisions/c0f54348e251/schema)
