> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voyantcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upsert Passengers

> Create or update passengers on a booking by referencing existing people.

## Method

`POST` `/v1/bookings/:id/passengers`

## Path Parameters

<ParamField path="id" type="string" required>Booking ID</ParamField>

## Body Parameters

<ParamField path="passengers" type="array" required>Array of passenger objects</ParamField>

<ResponseField path="passengers[]" type="Passenger Object">
  <Expandable title="properties" defaultOpen>
    <ResponseField path="personId" type="uuid">Existing person ID (with name parts such as firstName, middleName, lastName stored on the Person)</ResponseField>
    <ResponseField path="role" type="string">Passenger role (e.g., lead, guest)</ResponseField>
    <ResponseField path="roomAllocation" type="string">Room allocation reference</ResponseField>
    <ResponseField path="extras" type="object">Additional attributes</ResponseField>
  </Expandable>
</ResponseField>

## Headers

<ParamField header="Authorization" type="string" required>Bearer token (e.g. <code>Authorization: Bearer YOUR\_API\_KEY</code>)</ParamField>
<ParamField header="content-type" type="string">application/json</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.voyantcloud.com/v1/bookings/bkg_456def/passengers \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "content-type: application/json" \
    -d '{
      "passengers": [
        { "personId": "5f7a1a0b-1111-2222-3333-abcdefabcdef", "role": "lead" }
      ]
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch("https://api.voyantcloud.com/v1/bookings/bkg_456def/passengers", {
    method: "POST",
    headers: { Authorization: `Bearer ${process.env.VOYANT_API_KEY}`, "content-type": "application/json" },
    body: JSON.stringify({ passengers: [{ personId: "5f7a1a0b-1111-2222-3333-abcdefabcdef", role: "lead" }] }),
  })
  ```

  ```python Python theme={null}
  import os, requests
  requests.post(
    "https://api.voyantcloud.com/v1/bookings/bkg_456def/passengers",
    headers={"Authorization": f"Bearer {os.environ['VOYANT_API_KEY']}", "content-type": "application/json"},
    json={"passengers": [{"personId": "5f7a1a0b-1111-2222-3333-abcdefabcdef", "role": "lead"}]},
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
      "passengers": [
          {
              "id": "psg_123",
              "person_id": "5f7a1a0b-1111-2222-3333-abcdefabcdef", 
              "role": "lead"
          }
      ]
  }
  ```
</ResponseExample>
