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

## 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>
  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>
  Repeats.
</ParamField>

<ParamField body="WhichBookingsToUpdate" type="integer" required>
  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">
  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 Now.
</ParamField>

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

<ParamField body="InvoiceThisCoworker" type="boolean">
  Invoice This Coworker.
</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="Online" type="boolean">
  Online.
</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">
  Repeat Booking.
</ParamField>

<ParamField body="RepeatEvery" type="integer">
  Repeat Every.
</ParamField>

<ParamField body="RepeatUntil" type="string">
  Repeat Until.
</ParamField>

<ParamField body="RepeatOnMondays" type="boolean">
  Repeat On Mondays.
</ParamField>

<ParamField body="RepeatOnTuesdays" type="boolean">
  Repeat On Tuesdays.
</ParamField>

<ParamField body="RepeatOnWednesdays" type="boolean">
  Repeat On Wednesdays.
</ParamField>

<ParamField body="RepeatOnThursdays" type="boolean">
  Repeat On Thursdays.
</ParamField>

<ParamField body="RepeatOnFridays" type="boolean">
  Repeat On Fridays.
</ParamField>

<ParamField body="RepeatOnSaturdays" type="boolean">
  Repeat On Saturdays.
</ParamField>

<ParamField body="RepeatOnSundays" type="boolean">
  Repeat On Sundays.
</ParamField>

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

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

<ParamField body="OverridePrice" type="number">
  Override Price.
</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">
  Invoice Date.
</ParamField>

<ParamField body="BookingNumber" type="integer">
  Booking Number.
</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="CoworkerInvoiceId" type="integer">
  Coworker Invoice Id.
</ParamField>

<ParamField body="CoworkerInvoiceNumber" type="string">
  Coworker Invoice Number.
</ParamField>

<ParamField body="CoworkerInvoicePaid" type="boolean">
  Coworker Invoice Paid.
</ParamField>

<ParamField body="CoworkerInvoiceDraft" type="boolean">
  Coworker Invoice Draft.
</ParamField>

<ParamField body="CoworkerInvoiceVoid" type="boolean">
  Coworker Invoice Void.
</ParamField>

<ParamField body="CoworkerInvoiceCreditNote" type="boolean">
  Coworker Invoice Credit Note.
</ParamField>

<ParamField body="CoworkerExtraServiceIds" type="string">
  Coworker Extra Service Ids.
</ParamField>

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

<ParamField body="CoworkerExtraServiceCurrencyCode" type="string">
  Coworker Extra Service Currency Code.
</ParamField>

<ParamField body="CoworkerExtraServiceChargePeriod" type="integer">
  Coworker Extra Service Charge Period.
</ParamField>

<ParamField body="CoworkerExtraServiceTotalUses" type="integer">
  Coworker Extra Service Total Uses.
</ParamField>

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

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

<ParamField body="CheckedInAt" type="string">
  Checked In At.
</ParamField>

<ParamField body="CancelIfNotPaid" type="boolean">
  Cancel If Not Paid.
</ParamField>

<ParamField body="CancelIfNotCheckedIn" type="boolean">
  Cancel If Not Checked In.
</ParamField>

<ParamField body="MaxOccupancy" type="integer">
  Max Occupancy.
</ParamField>

<ParamField body="LastMinutePriceAdjustment" type="number">
  Last Minute Price Adjustment.
</ParamField>

<ParamField body="DynamicPriceAdjustment" type="number">
  Dynamic Price Adjustment.
</ParamField>

<ParamField body="PriceFactorLastMinute" type="number">
  Price Factor Last Minute.
</ParamField>

<ParamField body="PriceFactorDemand" type="number">
  Price Factor Demand.
</ParamField>

<ParamField body="Office365AdminEventId" type="string">
  Office365Admin Event Id.
</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">
  Original Booking Id.
</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
}
```
