# Change a service

`PATCH /bookings/services/{id}` · Rivier · bookings

Change a service.

- Scope: bookings:admin
- Sdk: bookings.service.update
- Cli: bookings service update

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{0,62}$"
    },
    "description": {
      "type": "string",
      "maxLength": 4000,
      "default": ""
    },
    "locationId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "durations": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 5,
        "maximum": 1440
      },
      "minItems": 1,
      "maxItems": 12,
      "default": [
        60
      ]
    },
    "defaultDuration": {
      "type": "integer",
      "minimum": 5,
      "maximum": 1440,
      "default": 60
    },
    "bufferBefore": {
      "type": "integer",
      "minimum": 0,
      "maximum": 480,
      "default": 0
    },
    "bufferAfter": {
      "type": "integer",
      "minimum": 0,
      "maximum": 480,
      "default": 0
    },
    "minNotice": {
      "type": "integer",
      "minimum": 0,
      "maximum": 525600,
      "default": 0
    },
    "horizonDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 730,
      "default": 60
    },
    "slotStep": {
      "type": "integer",
      "minimum": 5,
      "maximum": 1440,
      "default": 15
    },
    "capacity": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10000,
      "default": 1
    },
    "mode": {
      "type": "string",
      "enum": [
        "one_to_one",
        "group"
      ],
      "default": "one_to_one"
    },
    "confirmation": {
      "type": "string",
      "enum": [
        "instant",
        "manual"
      ],
      "default": "instant"
    },
    "intake": {
      "type": "object",
      "additionalProperties": {},
      "default": {}
    },
    "deposit": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "none"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "percent"
            },
            "value": {
              "type": "number",
              "minimum": 1,
              "maximum": 100
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "fixed"
            },
            "amountMinor": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "kind",
            "amountMinor"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "full"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        }
      ],
      "default": {
        "kind": "none"
      }
    },
    "cancellationPolicyId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "published": {
      "type": "boolean",
      "default": false
    },
    "price": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "amountMinor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "currency": {
              "type": "string",
              "pattern": "^[a-z]{3}$"
            }
          },
          "required": [
            "amountMinor",
            "currency"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "resourceGroups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 80,
            "default": ""
          },
          "need": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20,
            "default": 1
          },
          "resourceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "required": [
          "resourceIds"
        ],
        "additionalProperties": false
      },
      "maxItems": 10,
      "default": []
    }
  },
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PATCH 'https://api.rivier.ai/bookings/services/{id}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "slug": "string",
  "description": "",
  "locationId": "string",
  "durations": [
    60
  ],
  "defaultDuration": 60,
  "bufferBefore": 0,
  "bufferAfter": 0
}'
```
