- [HTTP request](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#body.RollbackTargetResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#body.aspect_1)
- [RollbackTargetConfig](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#RollbackTargetConfig)
  - [JSON representation](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#RollbackTargetConfig.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#try-it)

Creates a `Rollout` to roll back the specified target.

### HTTP request

Choose a location:
<button value="global" default="">global</button> <button value="asia-south1">asia-south1</button> <button value="asia-south2">asia-south2</button> <button value="us-central1">us-central1</button> <button value="us-east1">us-east1</button> <button value="us-east4">us-east4</button> <button value="us-east5">us-east5</button> <button value="us-east7">us-east7</button> <button value="us-south1">us-south1</button> <button value="us-west1">us-west1</button> <button value="us-west2">us-west2</button> <button value="us-west3">us-west3</button> <button value="us-west4">us-west4</button>   
`POST https://clouddeploy.googleapis.com/v1/{name=projects/*/locations/*/deliveryPipelines/*}:rollbackTarget`

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The `DeliveryPipeline` for which the rollback `Rollout` must be created. The format is `projects/{projectId}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "targetId": string, "rolloutId": string, "releaseId": string, "rolloutToRollBack": string, "rollbackConfig": { object (`https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#RollbackTargetConfig`) }, "validateOnly": boolean, "overrideDeployPolicy": [ string ] } ``` |

| Fields ||
|---|---|
| `targetId` | `string` Required. ID of the `Target` that is being rolled back. |
| `rolloutId` | `string` Required. ID of the rollback `Rollout` to create. |
| `releaseId` | `string` Optional. ID of the `Release` to roll back to. If this isn't specified, the previous successful `Rollout` to the specified target will be used to determine the `Release`. |
| `rolloutToRollBack` | `string` Optional. If provided, this must be the latest `Rollout` that is on the `Target`. |
| `rollbackConfig` | ``object (`https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#RollbackTargetConfig`)`` Optional. Configs for the rollback `Rollout`. |
| `validateOnly` | `boolean` Optional. If set to true, the request is validated and the user is provided with a `RollbackTargetResponse`. |
| `overrideDeployPolicy[]` | `string` Optional. Deploy policies to override. Format is `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`. |

### Response body

The response object from `deliveryPipelines.rollbackTarget`.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "rollbackConfig": { object (`https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#RollbackTargetConfig`) } } ``` |

| Fields ||
|---|---|
| `rollbackConfig` | ``object (`https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines/rollbackTarget#RollbackTargetConfig`)`` The config of the rollback `Rollout` created or will be created. |

### Authorization scopes

Requires the following OAuth scope:

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

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

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

- `clouddeploy.rollouts.rollback`

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

## RollbackTargetConfig

Configs for the Rollback rollout.

| JSON representation |
|---|
| ``` { "rollout": { object (`https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines.releases.rollouts#Rollout`) }, "startingPhaseId": string } ``` |

| Fields ||
|---|---|
| `rollout` | ``object (`https://docs.cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines.releases.rollouts#Rollout`)`` Optional. The rollback `Rollout` to create. |
| `startingPhaseId` | `string` Optional. The starting phase ID for the `Rollout`. If unspecified, the `Rollout` will start in the stable phase. |