- [HTTP request](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/billingAccounts.billingAccountLicenseConfigs/retractLicenseConfig#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/billingAccounts.billingAccountLicenseConfigs/retractLicenseConfig#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/billingAccounts.billingAccountLicenseConfigs/retractLicenseConfig#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/billingAccounts.billingAccountLicenseConfigs/retractLicenseConfig#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/billingAccounts.billingAccountLicenseConfigs/retractLicenseConfig#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/billingAccounts.billingAccountLicenseConfigs/retractLicenseConfig#body.RetractLicenseConfigResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/billingAccounts.billingAccountLicenseConfigs/retractLicenseConfig#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/billingAccounts.billingAccountLicenseConfigs/retractLicenseConfig#body.aspect_1)

This method is called from the billing account side to retract the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.licenseConfigs#LicenseConfig` from the given project back to the billing account.

### HTTP request

Choose an endpoint:
global us   
`POST https://discoveryengine.googleapis.com/v1alpha/{billingAccountLicenseConfig=billingAccounts/*/billingAccountLicenseConfigs/*}:retractLicenseConfig`

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `billingAccountLicenseConfig` | `string` Required. Full resource name of `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/billingAccounts.billingAccountLicenseConfigs#BillingAccountLicenseConfig`. Format: `billingAccounts/{billingAccount}/billingAccountLicenseConfigs/{billingAccountLicenseConfigId}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "licenseConfig": string, "fullRetract": boolean, "licenseCount": string } ``` |

| Fields ||
|---|---|
| `licenseConfig` | `string` Required. Full resource name of `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.licenseConfigs#LicenseConfig`. Format: `projects/{project}/locations/{location}/licenseConfigs/{licenseConfigId}`. |
| `fullRetract` | `boolean` Optional. If set to true, retract the entire license config. Otherwise, retract the specified license count. |
| `licenseCount` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The number of licenses to retract. Only used when fullRetract is false. |

### Response body

Response message for `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/billingAccounts.billingAccountLicenseConfigs/retractLicenseConfig#google.cloud.discoveryengine.v1alpha.LicenseConfigService.RetractLicenseConfig` method.

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

| JSON representation |
|---|
| ``` { "licenseConfig": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.licenseConfigs#LicenseConfig`) } } ``` |

| Fields ||
|---|---|
| `licenseConfig` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.licenseConfigs#LicenseConfig`)`` The updated LicenseConfig. |

### Authorization scopes

Requires one of the following OAuth scopes:

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

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 `billingAccountLicenseConfig` resource:

- `discoveryengine.billingAccountLicenseConfigs.retract`

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