- [HTTP request](https://docs.cloud.google.com/memorystore/docs/valkey/reference/rest/v1beta/projects.locations.instances/backup#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/memorystore/docs/valkey/reference/rest/v1beta/projects.locations.instances/backup#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/memorystore/docs/valkey/reference/rest/v1beta/projects.locations.instances/backup#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/memorystore/docs/valkey/reference/rest/v1beta/projects.locations.instances/backup#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/memorystore/docs/valkey/reference/rest/v1beta/projects.locations.instances/backup#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/memorystore/docs/valkey/reference/rest/v1beta/projects.locations.instances/backup#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/memorystore/docs/valkey/reference/rest/v1beta/projects.locations.instances/backup#body.aspect_1)

Backup Instance. If this is the first time a backup is being created, a backup collection will be created at the backend, and this backup belongs to this collection. Both collection and backup will have a resource name. Backup will be executed for each shard. A replica (primary if nonHA) will be selected to perform the execution. Backup call will be rejected if there is an ongoing backup or update operation. Be aware that during preview, if the instance's internal software version is too old, critical update will be performed before actual backup. Once the internal software version is updated to the minimum version required by the backup feature, subsequent backups will not require critical update. After preview, there will be no critical update needed for backup.

### HTTP request

Choose an endpoint:
global africa-south1 asia-east1 asia-east2 asia-northeast1 asia-northeast2 asia-northeast3 asia-south1 asia-south2 asia-southeast1 asia-southeast2 asia-southeast3 australia-southeast1 australia-southeast2 europe-central2 europe-north1 europe-north2 europe-southwest1 europe-west1 europe-west10 europe-west12 europe-west15 europe-west2 europe-west3 europe-west4 europe-west6 europe-west8 europe-west9 me-central1 me-central2 me-west1 northamerica-northeast1 northamerica-northeast2 northamerica-south1 southamerica-east1 southamerica-west1 us-central1 us-central2 us-east1 us-east4 us-east5 us-east7 us-south1 us-west1 us-west2 us-west3 us-west4 us-west8   
`POST https://memorystore.googleapis.com/v1beta/{name=projects/*/locations/*/instances/*}:backup`

<br />

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. Instance resource name using the form: `projects/{projectId}/locations/{locationId}/instances/{instanceId}` where `locationId` refers to a Google Cloud region. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "ttl": string, "backupId": string } ``` |

| Fields ||
|---|---|
| `ttl` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Optional. TTL for the backup to expire. Value range is 1 day to 100 years. If not specified, the default value is 100 years. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `backupId` | `string` Optional. The id of the backup to be created. If not specified, the default value (\[YYYYMMDDHHMMSS\]_\[Shortened Instance UID\] is used. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/memorystore/docs/valkey/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/memorystore.read-write`

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `memorystore.instances.backup`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).