
# Update an event

Update a single event. Absent fields keep their stored values.

```sh
PATCH https://sitepaste.com/api/v1/public/sites/{siteId}/events/{eventId}
```

Requires the `content` scope.

Ids come from [the list](/api/events/get-events) or from a batch response.

## Usage

```bash
curl -X PATCH "https://sitepaste.com/api/v1/public/sites/default/events/4ghjanhpo9sy" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "capacity": 40 }'
```


## Body

Any field an event entry takes in [POST /sites/{siteId}/events](/api/events/post-events): `title`, `description`, `eventTypeSlugs`, `startsAt`, `timezone`, `price`, `capacity`, `location`, `imageUrl`, `bookingUrl`, `hidden`. Omitting `eventTypeSlugs` keeps the stored list rather than clearing it. `timezone` cannot be cleared: an empty value is refused, the same as on create.

An `id` in the body must name the event the path names, which supports read-modify-write: GET the event, change a field, PATCH the whole object back. An `id` naming a different event is refused.

`events` and `deleteIds` belong to [POST /sites/{siteId}/events/batch](/api/events/post-events-batch). Publish your change with [POST /sites/{siteId}/deployments](/api/deployments/post-deployments).

## Response

200 OK with the updated event alone, in the shape [list events](/api/events/get-events) returns each entry in.

422 when the body does not validate, with problems keyed under `events["0"]` as in a batch response. The exceptions are a body `id` naming a different event, and the batch envelope fields above, which come back under `fields`. 400 when `{eventId}` is malformed; 404 when it is well formed but names no event on the site. A request with both a bad id and a refused field gets the id's answer.