# Updates a booking sheet

`PUT /api/booking-sheets/{productRecipeId}`

- **Products:** Operator (`FOH`)
- **Features:** Front of House Generic Access (`FOHGENERIC`)

HTML version: [Updates a booking sheet](https://support.gladstonesoftware.cloud/reference/bookings/updates-a-booking-sheet)

## Overview

Replaces the name, site and resource list of an existing booking sheet — the group of
bookable resources, such as the courts in a sports hall, that
[Return booking sheets for the given resource group with member details](return-booking-sheets-for-the-given-resource-group-with-member-details.md)
renders as one grid.

This is a full replacement, not a patch. Every field in the body is applied, and `products`
becomes the sheet's complete resource list: any resource you leave out is detached from the
sheet. Read the sheet first and send back the whole list with your edits applied.

One behaviour to guard against: an id that does not exist is **not** reported. The endpoint
finds no booking sheet and still returns `204 No Content`, so a typo in
`productRecipeId` looks exactly like a successful update. Confirm the change by re-reading
the sheet rather than trusting the status code.

Success returns `204 No Content` with an empty body.

## Endpoint

`PUT {base_url}/api/booking-sheets/{productRecipeId}`

`{base_url}` is the environment URL issued to your integration. See [Authenticating with Gladstone APIs](../../guides/authenticating-with-gladstone-apis.md).

## Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `productRecipeId` | string | Yes | The booking sheet to update, as returned when it was created by [Creates a booking sheet](creates-a-booking-sheet.md). An id that does not exist is silently ignored and still returns `204` — see the overview. |

## Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `description` | string | Yes | The booking sheet's name, shown as the heading of the sheet. Applied in full — whatever you send replaces the current name, so send the existing value if you only mean to change the products. Must not be blank, and must be 255 characters or fewer. |
| `siteId` | string | Yes | The site the booking sheet belongs to. Maximum 15 characters, and must not be blank. Changing it moves the sheet: the platform finds a site group that contains only this site, and creates one if none exists, so a site with no group of its own gains one as a side effect of this call. |
| `products` | array of string | Yes | The complete list of resource products on the sheet — the courts, lanes or rooms that become its columns. This replaces the existing list rather than adding to it: resources present on the sheet but absent from this array are detached, and resources in the array that are not yet on the sheet are attached. Send at least one; an empty array is rejected with `One or more Products must be specified`. Each entry must be an existing product id, or the call fails with the `A database error has occurred` `400`. |

## Sample request

```bash title="cURL"
curl -X PUT '{base_url}/api/booking-sheets/{productRecipeId}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "description": "string",
  "siteId": "string",
  "products": [
    "string"
  ]
}'
```

## Errors

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | `productRecipeId must be provided` — the path segment was empty. |
| `400` | Bad request | `Request object must be provided` — the body was absent or unparseable. |
| `400` | Bad request | Body validation failed: `Description cannot be blank`, `The booking sheet description cannot be more than 255 characters`, `Site Id cannot be blank`, `Site Id cannot be more than 15 characters`, or `One or more Products must be specified`. |
| `400` | Bad request | `A database error has occurred. Please ensure that the ID supplied exists` — the update was rejected when saved, most often because a product id in `products` does not exist. Note that an unknown `productRecipeId` does **not** produce this error; it returns `204`. |
| `500` | Internal server error | An unexpected server-side failure; the response body is empty. Retry, then raise a support ticket with the time of the call. |
