# Method: projects.keys.retrieveLegacySecretKey

- [HTTP request](https://docs.cloud.google.com/recaptcha/docs/reference/rest/v1/projects.keys/retrieveLegacySecretKey#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/recaptcha/docs/reference/rest/v1/projects.keys/retrieveLegacySecretKey#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/recaptcha/docs/reference/rest/v1/projects.keys/retrieveLegacySecretKey#body.request_body)
- [Response body](https://docs.cloud.google.com/recaptcha/docs/reference/rest/v1/projects.keys/retrieveLegacySecretKey#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/recaptcha/docs/reference/rest/v1/projects.keys/retrieveLegacySecretKey#body.RetrieveLegacySecretKeyResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/recaptcha/docs/reference/rest/v1/projects.keys/retrieveLegacySecretKey#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/recaptcha/docs/reference/rest/v1/projects.keys/retrieveLegacySecretKey#body.aspect_1)

Returns the secret key related to the specified public key. You must use the legacy secret key only in a 3rd party integration with legacy reCAPTCHA.

### HTTP request

`GET https://recaptchaenterprise.googleapis.com/v1/{key=projects/*/keys/*}:retrieveLegacySecretKey`

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

### Path parameters

| Parameters ||
|---|---|
| `key` | `string` Required. The public key name linked to the requested secret key in the format `projects/{project}/keys/{key}`. |

### Request body

The request body must be empty.

### Response body

Secret key is used only in legacy reCAPTCHA. It must be used in a 3rd party integration with legacy reCAPTCHA.

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

| JSON representation |
|---|
| ``` { "legacySecretKey": string } ``` |

| Fields ||
|---|---|
| `legacySecretKey` | `string` The secret key (also known as shared secret) authorizes communication between your application backend and the reCAPTCHA Enterprise server to create an assessment. The secret key needs to be kept safe for security purposes. |

### 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 `key` resource:

- `recaptchaenterprise.keys.retrievelegacysecretkey`

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