# Update on-call schedule event

Update a single event in the given on-call schedule.

Events starting sooner than today at 0:00 UTC can't be updated.

[endpoint]
base_url = "https://uptime.betterstack.com"
path = "/api/v2/on-calls/{schedule_id}/events/{event_id}"
method = "PATCH"

[[path_param]]
name = "schedule_id"
description = "The ID of the on-call schedule that the event is part of. Use `default` to refer to the default on-call schedule for the team."
required = true
type = "string"

[[path_param]]
name = "event_id"
description = "The ID of the event you want to update."
required = true
type = "string"

[[body_param]]
name = "starts_at"
description = '''
Start time of the event.
Must be today at 0:00 UTC or later.
'''
required = false
type = "date"

[[body_param]]
name = "ends_at"
description = "End time of the event."
required = false
type = "date"

[[body_param]]
name = "users"
description = "List of email addresses of the users that will be on-call during this event."
required = false
type = "array"

[[body_param]]
name = "override"
description = "Whether this event is an override. Override events take precedence over regular scheduled events."
required = false
type = "boolean"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"

[/endpoint]

[responses]
[[response]]
status = 200
description = '''Event was updated'''
body = '''{
  "id": 12345678,
  "starts_at": "2025-01-01T09:45:00Z",
  "ends_at": "2025-01-01T17:00:00",
  "users": ["tomas@betterstack.com"],
  "override": false
}'''

[[response]]
status = 422
description = '''Event was not updated'''
body = '''{
  "errors": {
    "base": [
       "events ending before today at 00:00 UTC can't be updated or deleted"
    ]
  }
}'''

[/responses]

#### Example cURL

```shell
[label Example]
curl --request PATCH \
  --url "https://uptime.betterstack.com/api/v2/on-calls/default/events/12345678" \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{ "starts_at": "2025-01-01T09:45:00Z" }'
```
