> ## 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 CancelledBooking

> Update an existing CancelledBooking record.

Updates an existing CancelledBooking 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 **`CancelledBooking-Edit`** role.
</Note>

## Enums

<Accordion title="eBookingCancellationReason">
  | Value | Name                      |
  | ----- | ------------------------- |
  | 0     | Unknown                   |
  | 1     | NoLongerNeeded            |
  | 2     | TooExpensive              |
  | 3     | BadPreviousExperience     |
  | 4     | RebookedForADifferentTime |
  | 5     | FailedToPayUpfront        |
  | 6     | Integration               |
  | 7     | Other                     |
  | 8     | NotCheckedIn              |
  | 9     | MarketPlace               |
</Accordion>

<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 CancelledBooking record to update.
</ParamField>

<ParamField body="ResourceId" type="integer" required>
  ID of the resource linked to this record.
</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>
  The repeats value for this cancelled booking.
</ParamField>

<ParamField body="WhichBookingsToUpdate" type="integer" required>
  Date/time value for which bookings to update.
</ParamField>

<ParamField body="CancelledOn" type="string" required>
  Date and time when the booking was cancelled.
</ParamField>

### Optional Fields

<ParamField body="FloorPlanDeskId" type="integer">
  ID of the floor plan desk linked to this record.
</ParamField>

<ParamField body="CoworkerId" type="integer">
  ID of the coworker linked to this record.
</ParamField>

<ParamField body="ExtraServiceId" type="integer">
  ID of the extra service linked to this record.
</ParamField>

<ParamField body="Notes" type="string">
  Optional notes or comments about this cancelled booking.
</ParamField>

<ParamField body="InternalNotes" type="string">
  The internal notes value for this cancelled booking.
</ParamField>

<ParamField body="ChargeNow" type="boolean">
  Whether charge now is enabled.
</ParamField>

<ParamField body="InvoiceNow" type="boolean">
  Whether invoice now is enabled.
</ParamField>

<ParamField body="InvoiceThisCoworker" type="boolean">
  Whether invoice this coworker is enabled.
</ParamField>

<ParamField body="DoNotUseBookingCredit" type="boolean">
  Whether do not use booking credit is enabled.
</ParamField>

<ParamField body="PurchaseOrder" type="string">
  The purchase order value for this cancelled booking.
</ParamField>

<ParamField body="DiscountCode" type="string">
  The discount code value for this cancelled booking.
</ParamField>

<ParamField body="LastNotificationTime" type="string">
  Date/time value for last notification time.
</ParamField>

<ParamField body="GoogleCalendarId" type="string">
  ID of the google calendar associated with this record.
</ParamField>

<ParamField body="GoogleEventId" type="string">
  ID of the google event associated with this record.
</ParamField>

<ParamField body="Office365EventId" type="string">
  ID of the office365 event associated with this record.
</ParamField>

<ParamField body="PublicGoogleEventId" type="string">
  ID of the public google event associated with this record.
</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="Online" type="boolean">
  Whether online is enabled.
</ParamField>

<ParamField body="TeamsAtTheTimeOfBooking" type="string">
  The teams at the time of booking value for this cancelled booking.
</ParamField>

<ParamField body="TariffAtTheTimeOfBooking" type="string">
  The tariff at the time of booking value for this cancelled booking.
</ParamField>

<ParamField body="RepeatSeriesUniqueId" type="string">
  ID of the repeat series unique associated with this record.
</ParamField>

<ParamField body="RepeatBooking" type="boolean">
  Whether repeat booking is enabled.
</ParamField>

<ParamField body="RepeatEvery" type="integer">
  The repeat every value for this cancelled booking.
</ParamField>

<ParamField body="RepeatUntil" type="string">
  Date/time value for repeat until.
</ParamField>

<ParamField body="RepeatOnMondays" type="boolean">
  Whether repeat on mondays is enabled.
</ParamField>

<ParamField body="RepeatOnTuesdays" type="boolean">
  Whether repeat on tuesdays is enabled.
</ParamField>

<ParamField body="RepeatOnWednesdays" type="boolean">
  Whether repeat on wednesdays is enabled.
</ParamField>

<ParamField body="RepeatOnThursdays" type="boolean">
  Whether repeat on thursdays is enabled.
</ParamField>

<ParamField body="RepeatOnFridays" type="boolean">
  Whether repeat on fridays is enabled.
</ParamField>

<ParamField body="RepeatOnSaturdays" type="boolean">
  Whether repeat on saturdays is enabled.
</ParamField>

<ParamField body="RepeatOnSundays" type="boolean">
  Whether repeat on sundays is enabled.
</ParamField>

<ParamField body="Reminded" type="boolean">
  Whether reminded is enabled.
</ParamField>

<ParamField body="MrmReminded" type="boolean">
  Whether mrm reminded is enabled.
</ParamField>

<ParamField body="OverridePrice" type="number">
  The override price value for this cancelled booking.
</ParamField>

<ParamField body="Invoiced" type="boolean">
  Whether the booking had been charged. When true, a charge (CoworkerExtraService) had been posted to the customer account.
</ParamField>

<ParamField body="InvoiceDate" type="string">
  Date/time value for invoice date.
</ParamField>

<ParamField body="BookingNumber" type="integer">
  The booking number value for this cancelled booking.
</ParamField>

<ParamField body="KisiKeyId" type="integer">
  ID of the kisi key associated with this record.
</ParamField>

<ParamField body="StartScheduledJobId" type="string">
  ID of the start scheduled job associated with this record.
</ParamField>

<ParamField body="EndScheduledJobId" type="string">
  ID of the end scheduled job associated with this record.
</ParamField>

<ParamField body="Billed" type="boolean">
  Whether billed is enabled.
</ParamField>

<ParamField body="FromTimeLocal" type="string">
  Date/time value for from time local.
</ParamField>

<ParamField body="ToTimeLocal" type="string">
  Date/time value for to time local.
</ParamField>

<ParamField body="InvoiceDateLocal" type="string">
  Date/time value for invoice date local.
</ParamField>

<ParamField body="CoworkerInvoiceId" type="integer">
  ID of the coworker invoice associated with this record.
</ParamField>

<ParamField body="CoworkerInvoiceNumber" type="string">
  The coworker invoice number value for this cancelled booking.
</ParamField>

<ParamField body="CoworkerInvoicePaid" type="boolean">
  Whether coworker invoice paid is enabled.
</ParamField>

<ParamField body="CoworkerInvoiceDraft" type="boolean">
  Whether coworker invoice draft is enabled.
</ParamField>

<ParamField body="CoworkerInvoiceVoid" type="boolean">
  Whether coworker invoice void is enabled.
</ParamField>

<ParamField body="CoworkerInvoiceCreditNote" type="boolean">
  Whether coworker invoice credit note is enabled.
</ParamField>

<ParamField body="CoworkerExtraServiceIds" type="string">
  The coworker extra service ids value for this cancelled booking.
</ParamField>

<ParamField body="CoworkerExtraServicePrice" type="number">
  The coworker extra service price value for this cancelled booking.
</ParamField>

<ParamField body="CoworkerExtraServiceCurrencyCode" type="string">
  The coworker extra service currency code value for this cancelled booking.
</ParamField>

<ParamField body="CoworkerExtraServiceChargePeriod" type="integer">
  The coworker extra service charge period value for this cancelled booking.
</ParamField>

<ParamField body="CoworkerExtraServiceTotalUses" type="integer">
  The coworker extra service total uses value for this cancelled booking.
</ParamField>

<ParamField body="IncludeZoomInvite" type="boolean">
  Whether include zoom invite is enabled.
</ParamField>

<ParamField body="ZoomEventData" type="string">
  The zoom event data value for this cancelled booking.
</ParamField>

<ParamField body="CheckedInAt" type="string">
  Date/time value for checked in at.
</ParamField>

<ParamField body="CancelIfNotPaid" type="boolean">
  Whether cancel if not paid is enabled.
</ParamField>

<ParamField body="CancelIfNotCheckedIn" type="boolean">
  Whether cancel if not checked in is enabled.
</ParamField>

<ParamField body="MaxOccupancy" type="integer">
  The max occupancy value for this cancelled booking.
</ParamField>

<ParamField body="LastMinutePriceAdjustment" type="number">
  The last minute price adjustment value for this cancelled booking.
</ParamField>

<ParamField body="DynamicPriceAdjustment" type="number">
  The dynamic price adjustment value for this cancelled booking.
</ParamField>

<ParamField body="PriceFactorLastMinute" type="number">
  The price factor last minute value for this cancelled booking.
</ParamField>

<ParamField body="PriceFactorDemand" type="number">
  The price factor demand value for this cancelled booking.
</ParamField>

<ParamField body="Office365AdminEventId" type="string">
  ID of the office365 admin event associated with this record.
</ParamField>

<ParamField body="CancellationReason" type="integer">
  Reason the booking was cancelled, e.g. NoLongerNeeded, TooExpensive, or NotCheckedIn. See `eBookingCancellationReason?` enum above.
</ParamField>

<ParamField body="CancelledBy" type="string">
  Name or identifier of the user who cancelled the booking.
</ParamField>

<ParamField body="CancellationReasonDetails" type="string">
  Additional free-text details explaining the cancellation reason.
</ParamField>

<ParamField body="Price" type="number">
  Booking price.
</ParamField>

<ParamField body="OriginalBookingId" type="string">
  ID of the original booking associated with this record.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT \
    "https://spaces.nexudus.com/api/spaces/cancelledbookings" \
    -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,
      "CancelledOn": "2025-01-15T10:30:00Z",
      "Id": 87654321
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/spaces/cancelledbookings',
    {
      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,
        CancelledOn: '2025-01-15T10:30:00Z',
        Id: 87654321
      })
    }
  );

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

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

  response = requests.put(
      'https://spaces.nexudus.com/api/spaces/cancelledbookings',
      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,
          'CancelledOn': '2025-01-15T10:30:00Z',
          'Id': 87654321
      }
  )

  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 cancelledbooking was updated successfully.
</ResponseField>

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

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "CancelledBooking 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
}
```
