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

# Update Booking

> Update an existing Booking record.

Updates an existing Booking record. You must include the `Id` of the record to update along with all required fields.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`Booking-Edit`** role.
</Note>

## Enums

<Accordion title="eBookingRepeatCycle — Repeats values">
  | Value | Name          |
  | ----- | ------------- |
  | 1     | Daily         |
  | 2     | Weekly        |
  | 3     | Monthly       |
  | 4     | Yearly        |
  | 5     | FirstOfMonth  |
  | 6     | SecondOfMonth |
  | 7     | ThirdOfMonth  |
  | 8     | LastOfMonth   |
  | 9     | FourthOfMonth |
</Accordion>

<Accordion title="eRepeatedBookingUpdateAction — WhichBookingsToUpdate values">
  | Value | Name                     |
  | ----- | ------------------------ |
  | 1     | UpdateThisBookingOnly    |
  | 2     | UpdateFutureBookingsOnly |
  | 3     | UpdateAllBookings        |
  | 4     | UpdateNotChargedBookings |
  | 5     | DeleteAllBookings        |
  | 6     | DeleteBookingsAfterThis  |
  | 7     | DeleteNotChargedBookings |
  | 8     | RevertAllCharges         |
</Accordion>

## Request Body

### Required Fields

<ParamField body="Id" type="integer" required>
  The Id of the Booking record to update.
</ParamField>

<ParamField body="ResourceId" type="integer" required>
  Resource Id.
</ParamField>

<ParamField body="FromTime" type="string" required>
  Booking start time.
</ParamField>

<ParamField body="ToTime" type="string" required>
  Booking end time.
</ParamField>

<ParamField body="Repeats" type="integer" required>
  Repeat cycle. Create-only.
</ParamField>

<ParamField body="WhichBookingsToUpdate" type="integer" required>
  Action to apply when updating or deleting bookings in a repeated series. This is the only field that can modify a series after creation.
</ParamField>

### Optional Fields

<ParamField body="FloorPlanDeskId" type="integer">
  Floor Plan Desk Id.
</ParamField>

<ParamField body="CoworkerId" type="integer">
  Coworker Id.
</ParamField>

<ParamField body="ExtraServiceId" type="integer">
  Extra Service Id.
</ParamField>

<ParamField body="Notes" type="string">
  Notes.
</ParamField>

<ParamField body="InternalNotes" type="string">
  Internal notes.
</ParamField>

<ParamField body="ChargeNow" type="boolean">
  Charge immediately.
</ParamField>

<ParamField body="InvoiceNow" type="boolean">
  Invoice immediately.
</ParamField>

<ParamField body="InvoiceThisCoworker" type="boolean">
  Charge the booking to the customer making it rather than their paying member (if any).
</ParamField>

<ParamField body="DoNotUseBookingCredit" type="boolean">
  Do not use booking credit.
</ParamField>

<ParamField body="PurchaseOrder" type="string">
  Purchase order.
</ParamField>

<ParamField body="DiscountCode" type="string">
  Discount code.
</ParamField>

<ParamField body="LastNotificationTime" type="string">
  Last Notification Time.
</ParamField>

<ParamField body="GoogleCalendarId" type="string">
  Google Calendar Id.
</ParamField>

<ParamField body="GoogleEventId" type="string">
  Google Event Id.
</ParamField>

<ParamField body="Office365EventId" type="string">
  Office365Event Id.
</ParamField>

<ParamField body="PublicGoogleEventId" type="string">
  Public Google Event Id.
</ParamField>

<ParamField body="Tentative" type="boolean">
  Tentative booking. Must be approved by an administrator before confirmed or charged. Tentative bookings still block the calendar.
</ParamField>

<ParamField body="TeamsAtTheTimeOfBooking" type="string">
  Teams at the time of booking.
</ParamField>

<ParamField body="TariffAtTheTimeOfBooking" type="string">
  Tariff at the time of booking.
</ParamField>

<ParamField body="RepeatSeriesUniqueId" type="string">
  Repeat Series Unique Id.
</ParamField>

<ParamField body="RepeatBooking" type="boolean">
  Create a repeating booking series. Create-only: once created, only WhichBookingsToUpdate can be used to update the series. No new bookings can be added to the series.
</ParamField>

<ParamField body="RepeatEvery" type="integer">
  Repeat every N periods. Create-only.
</ParamField>

<ParamField body="RepeatUntil" type="string">
  Repeat until date. Create-only.
</ParamField>

<ParamField body="RepeatOnMondays" type="boolean">
  Repeat on Mondays. Create-only.
</ParamField>

<ParamField body="RepeatOnTuesdays" type="boolean">
  Repeat on Tuesdays. Create-only.
</ParamField>

<ParamField body="RepeatOnWednesdays" type="boolean">
  Repeat on Wednesdays. Create-only.
</ParamField>

<ParamField body="RepeatOnThursdays" type="boolean">
  Repeat on Thursdays. Create-only.
</ParamField>

<ParamField body="RepeatOnFridays" type="boolean">
  Repeat on Fridays. Create-only.
</ParamField>

<ParamField body="RepeatOnSaturdays" type="boolean">
  Repeat on Saturdays. Create-only.
</ParamField>

<ParamField body="RepeatOnSundays" type="boolean">
  Repeat on Sundays. Create-only.
</ParamField>

<ParamField body="Reminded" type="boolean">
  Reminded.
</ParamField>

<ParamField body="MrmReminded" type="boolean">
  Mrm Reminded.
</ParamField>

<ParamField body="OverridePrice" type="number">
  Admin-set fixed price for the booking, regardless of what extra service (rate) is associated with it.
</ParamField>

<ParamField body="KisiKeyId" type="integer">
  Kisi Key Id.
</ParamField>

<ParamField body="StartScheduledJobId" type="string">
  Start Scheduled Job Id.
</ParamField>

<ParamField body="EndScheduledJobId" type="string">
  End Scheduled Job Id.
</ParamField>

<ParamField body="Billed" type="boolean">
  Billed.
</ParamField>

<ParamField body="FromTimeLocal" type="string">
  From Time Local.
</ParamField>

<ParamField body="ToTimeLocal" type="string">
  To Time Local.
</ParamField>

<ParamField body="InvoiceDateLocal" type="string">
  Invoice Date Local.
</ParamField>

<ParamField body="CoworkerExtraServicePrice" type="number">
  Coworker Extra Service Price.
</ParamField>

<ParamField body="IncludeZoomInvite" type="boolean">
  Include Zoom invite.
</ParamField>

<ParamField body="ZoomEventData" type="string">
  Zoom Event Data.
</ParamField>

<ParamField body="Office365AdminEventId" type="string">
  Office365Admin Event Id.
</ParamField>

### Children

<ParamField body="BookingProducts" type="object[]">
  Products to include with this booking

  <Expandable>
    <ParamField body="ProductId" type="integer" required>
      Product Id.
    </ParamField>

    <ParamField body="Quantity" type="integer" required>
      The number of units of this product to include in the booking.
    </ParamField>

    <ParamField body="InvoiceInMinutes" type="boolean">
      Whether to invoice this product based on the booking duration in minutes.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="BookingVisitors" type="object[]">
  Visitors to add to this booking

  <Expandable>
    <ParamField body="VisitorFullName" type="string">
      Full name of the visitor. Read-only, resolved from the linked Visitor record..
    </ParamField>

    <ParamField body="VisitorEmail" type="string">
      Email address of the visitor. Read-only, resolved from the linked Visitor record..
    </ParamField>
  </Expandable>
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT \
    "https://spaces.nexudus.com/api/spaces/bookings" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "ResourceId": 0,
      "FromTime": "2025-01-15T10:30:00Z",
      "ToTime": "2025-01-15T10:30:00Z",
      "Repeats": 0,
      "WhichBookingsToUpdate": 0,
      "Id": 87654321,
      "BookingProducts": [
          {
              "ProductId": 0,
              "Quantity": 0,
              "InvoiceInMinutes": false
          }
      ],
      "BookingVisitors": [
          {
              "VisitorFullName": null,
              "VisitorEmail": null
          }
      ]
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/spaces/bookings',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        ResourceId: 0,
        FromTime: '2025-01-15T10:30:00Z',
        ToTime: '2025-01-15T10:30:00Z',
        Repeats: 0,
        WhichBookingsToUpdate: 0,
        Id: 87654321,
        BookingProducts: [object Object],
        BookingVisitors: [object Object]
      })
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.put(
      'https://spaces.nexudus.com/api/spaces/bookings',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'ResourceId': 0,
          'FromTime': '2025-01-15T10:30:00Z',
          'ToTime': '2025-01-15T10:30:00Z',
          'Repeats': 0,
          'WhichBookingsToUpdate': 0,
          'Id': 87654321,
          'BookingProducts': [object Object],
          'BookingVisitors': [object Object]
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the update.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the updated record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the booking was updated successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "Booking was successfully updated.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "FromTime: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "FromTime"
    }
  ],
  "WasSuccessful": false
}
```
