---
title: "POST /v1/{+parent}/backupSchedules"
method: POST
path: "/v1/{+parent}/backupSchedules"
tags: ["projects"]
---

# POST /v1/{+parent}/backupSchedules

`POST /v1/{+parent}/backupSchedules`

Creates a new backup schedule.

## Path parameters

- `parent` string, required

## Query parameters

- `backupScheduleId` string

## Request body

- BackupSchedule — BackupSchedule expresses the automated backup creation specification for a Spanner database.
  - `name` string — Identifier. Output only for the CreateBackupSchedule operation. Required for the UpdateBackupSchedule operation. A globally unique identifier for the backup schedule which cannot be changed. Values are of the form `projects//instances//databases//backupSchedules/a-z*[a-z0-9]` The final segment of the name must be between 2 and 60 characters in length.
  - `spec` BackupScheduleSpec — Defines specifications of the backup schedule.
    - `cronSpec` CrontabSpec — CrontabSpec can be used to specify the version time and frequency at which the backup is created.
      - `text` string — Required. Textual representation of the crontab. User can customize the backup frequency and the backup version time using the cron expression. The version time must be in UTC timezone. The backup will contain an externally consistent copy of the database at the version time. Full backups must be scheduled a minimum of 12 hours apart and incremental backups must be scheduled a minimum of 4 hours apart. Examples of valid cron specifications: * `0 2/12 * * *` : every 12 hours at (2, 14) hours past midnight in UTC. * `0 2,14 * * *` : every 12 hours at (2, 14) hours past midnight in UTC. * `0 */4 * * *` : (incremental backups only) every 4 hours at (0, 4, 8, 12, 16, 20) hours past midnight in UTC. * `0 2 * * *` : once a day at 2 past midnight in UTC. * `0 2 * * 0` : once a week every Sunday at 2 past midnight in UTC. * `0 2 8 * *` : once a month on 8th day at 2 past midnight in UTC.
      - `timeZone` string — Output only. The time zone of the times in `CrontabSpec.text`. Currently, only UTC is supported.
      - `creationWindow` string, google-duration — Output only. Scheduled backups contain an externally consistent copy of the database at the version time specified in `schedule_spec.cron_spec`. However, Spanner might not initiate the creation of the scheduled backups at that version time. Spanner initiates the creation of scheduled backups within the time window bounded by the version_time specified in `schedule_spec.cron_spec` and version_time + `creation_window`.
  - `retentionDuration` string, google-duration — Optional. The retention duration of a backup that must be at least 6 hours and at most 366 days. The backup is eligible to be automatically deleted once the retention period has elapsed.
  - `encryptionConfig` CreateBackupEncryptionConfig — Encryption configuration for the backup to create.
    - `encryptionType` 'ENCRYPTION_TYPE_UNSPECIFIED' | 'USE_DATABASE_ENCRYPTION' | 'GOOGLE_DEFAULT_ENCRYPTION' | 'CUSTOMER_MANAGED_ENCRYPTION' — Required. The encryption type of the backup.
    - `kmsKeyName` string — Optional. This field is maintained for backwards compatibility. For new callers, we recommend using `kms_key_names` to specify the KMS key. Only use `kms_key_name` if the location of the KMS key matches the database instance's configuration (location) exactly. For example, if the KMS location is in `us-central1` or `nam3`, then the database instance must also be in `us-central1` or `nam3`. The Cloud KMS key that is used to encrypt and decrypt the restored database. Set this field only when encryption_type is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{kms_key_name}`.
    - `kmsKeyNames` string[] — Optional. Specifies the KMS configuration for the one or more keys used to protect the backup. Values are of the form `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{kms_key_name}`. The keys referenced by `kms_key_names` must fully cover all regions of the backup's instance configuration. Some examples: * For regional (single-region) instance configurations, specify a regional location KMS key. * For multi-region instance configurations of type `GOOGLE_MANAGED`, either specify a multi-region location KMS key or multiple regional location KMS keys that cover all regions in the instance configuration. * For an instance configuration of type `USER_MANAGED`, specify only regional location KMS keys to cover each region in the instance configuration. Multi-region location KMS keys aren't supported for `USER_MANAGED` type instance configurations.
  - `fullBackupSpec` FullBackupSpec — The specification for full backups. A full backup stores the entire contents of the database at a given version time.
  - `incrementalBackupSpec` IncrementalBackupSpec — The specification for incremental backup chains. An incremental backup stores the delta of changes between a previous backup and the database contents at a given version time. An incremental backup chain consists of a full backup and zero or more successive incremental backups. The first backup created for an incremental backup chain is always a full backup.
  - `updateTime` string, google-datetime — Output only. The timestamp at which the schedule was last updated. If the schedule has never been updated, this field contains the timestamp when the schedule was first created.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/spanner.md) · [All operations](https://skmtc.net/google/apis/spanner/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/spanner/versions/4b66067d2622/schema)
