---
title: "Create a new backup schedule"
method: POST
path: "/backups/schedules"
tags: ["Backups"]
---

# Create a new backup schedule

`POST /backups/schedules`

## Request

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

## Request body

- CreateBackupScheduleRequest
  - `backup_type` string, required
  - `description` string, nullable
  - `enabled` boolean, required
  - `include_control_plane` boolean, nullable: When `true` (default), every run also produces a `control_plane` backup of Temps's own database. Operators who use Temps purely as a backup orchestrator for external DBs can set this to `false` to keep the run history focused on those services.
  - `max_runtime_secs` integer, nullable: Optional wall-clock timeout override for jobs created by this schedule (seconds). When set, overrides the engine-family default. `null` means "use engine default." The per-job `max_runtime_secs` in `EnqueueJobParams` can still override this for ad-hoc triggers.
  - `name` string, required
  - `retention_period` integer, required
  - `s3_source_id` integer, nullable: Optional S3 source. If omitted, the current default S3 source is used.
  - `schedule_expression` string, required: Cron expression with a leading seconds field: `sec min hour day-of-month month day-of-week`, for example `0 0 3 * * *` for every day at 03:00 UTC. A five-field expression such as `0 3 * * *` is rejected.
  - `service_ids` integer[]: External services to target when `target_all_services` is `false`. The schedule and these memberships are created atomically, so an enabled schedule can never be observed without its requested targets.
  - `tags` string[], required
  - `target_all_services` boolean, nullable: When `true` (default), the schedule backs up every external service on the host — including databases created in the future. When `false`, the schedule backs up only the services supplied in `service_ids` (or later attached through the schedule-services API). Omit to use the default.

## Response `201`

Backup schedule created

- 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

- `401`: Unauthorized
- `403`: Insufficient permissions
- `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 `201`
  - the `last_run` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `201`
  - the `next_run` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `201`
  - the `updated_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `201`
- **2026-11-09** `12896146b193`: 3 breaking
  - 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 `500` status
- **2026-10-05** `4b228ebed583`: 3 info
  - 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 `500` status
- **2026-10-05** `63a80791dc58`: 3 warning
  - removed the optional property `status` from the response with the `401` status
  - removed the optional property `status` from the response with the `403` status
  - removed the optional property `status` from the response with the `500` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/backups/schedules/post.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)
