---
title: "Update a backup schedule (partial update)."
method: PATCH
path: "/backups/schedules/{id}"
tags: ["Backups"]
---

# Update a backup schedule (partial update).

`PATCH /backups/schedules/{id}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/backups/schedules/{id}`
- Auth: HTTP bearer

All request fields are optional; only fields that are present in the
JSON body are updated. Absent fields leave the corresponding column
unchanged. If `schedule_expression` is changed, `next_run` is
recomputed automatically.

## Path parameters

- `id` integer, required

## Request body

- UpdateBackupScheduleRequest: Request body for updating an existing backup schedule via `PATCH /api/backups/schedules/{id}`. All fields are optional; only present fields are updated. Absent fields leave the corresponding column unchanged.
  - `description` string, nullable: New human-readable description. Pass an empty string `""` to clear.
  - `enabled` boolean, nullable: Enable or disable the schedule. Skipped when `None`.
  - `include_control_plane` boolean, nullable: Toggle whether the control-plane backup is produced on every run.
  - `max_runtime_secs` integer, nullable: Per-schedule wall-clock timeout override (seconds). - `None` (field absent) — leave current value unchanged - `Some(None)` (field present, JSON `null`) — clear override; fall back to engine default - `Some(Some(n))` — set to `n` seconds (must be >= 60)
  - `name` string, nullable: New schedule name. Skipped when `None`. Must not be empty if provided.
  - `retention_period` integer, nullable: Days to retain backups produced by this schedule. Must be >= 1.
  - `schedule_expression` string, nullable: New cron expression with a leading seconds field (`sec min hour day-of-month month day-of-week`, e.g. `0 0 3 * * *`). When changed, `next_run` is recomputed.
  - `service_ids` integer[], nullable: Replace the explicit external-service selection atomically with the schedule update. Only meaningful when `target_all_services` resolves to `false`; an empty list explicitly clears the selection.
  - `tags` string[], nullable: Replace the full tag list. Skipped when `None`.
  - `target_all_services` boolean, nullable: Toggle between "back up every database" (`true`) and "back up only the explicit list" (`false`). When set to `true`, the server clears the explicit membership rows for this schedule.

## Response `200`

Schedule updated

- BackupScheduleResponse: Response type for backup schedule
  - `backup_type` string, required
  - `created_at` string, date-time, required
  - `description` string, nullable
  - `enabled` boolean, required
  - `id` integer, required
  - `include_control_plane` boolean, required: When `true`, every run also produces a `control_plane` backup (Temps's own Postgres). When `false`, only the external service fan-out happens.
  - `last_run` string, date-time, nullable
  - `max_runtime_secs` integer, nullable: Per-schedule wall-clock timeout override for backup jobs (seconds). `null` means the default of four hours (14400 seconds) is used.
  - `name` string, required
  - `next_run` string, date-time, nullable
  - `retention_period` integer, required
  - `s3_source_id` integer, required
  - `schedule_expression` string, required
  - `tags` string[], required
  - `target_all_services` boolean, required: When `true`, the schedule auto-includes every external service on the host (and any future ones). When `false`, the schedule only targets services attached via `backup_schedule_services`.
  - `updated_at` string, date-time, required

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Schedule not found
- `500`: Internal server error

## Changes

- **2026-11-26** `e1864d950604`: 4 breaking
  - the `created_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `200`
  - the `last_run` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `200`
  - the `next_run` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `200`
  - the `updated_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `200`
- **2026-11-09** `12896146b193`: 5 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `404` status
  - …1 more
- **2026-10-05** `4b228ebed583`: 5 info
  - added the optional property `status` to the response with the `400` status
  - added the optional property `status` to the response with the `401` status
  - added the optional property `status` to the response with the `403` status
  - added the optional property `status` to the response with the `404` status
  - …1 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/backups/schedules/:id/patch.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
