# Bring your own reCAPTCHA keys

> [!WARNING]
>
> **Preview**
>
>
> This feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
> [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1).
>
> Pre-GA features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

You can use your own reCAPTCHA key with
[Identity Platform integration with the reCAPTCHA Enterprise API](https://docs.cloud.google.com/identity-platform/docs/recaptcha-enterprise.md.txt).

When the Identity Platform integration with the reCAPTCHA Enterprise API is enabled, Identity Platform provisions
reCAPTCHA keys on your behalf by default. However, you can
choose to bring your own reCAPTCHA key to use with
reCAPTCHA. Uploading your own reCAPTCHA key
disables the provisioning by
Identity Platform.

## Enable the ability to bring your own key

To enable this capability and upload your reCAPTCHA key, call the
endpoint with the following `curl` command:

    curl -i -X PATCH -H 'Content-Type: application/json' -H
    "x-goog-user-project: PROJECT_ID" -H 'Authorization: Bearer OAUTH_TOKEN' -d
    '
    {
      "recaptchaConfig": {
        "recaptchaKeys": [{"key": "projects/PROJECT_NUMBER/keys/KEY_VALUE",
        "type": "PLATFORM_TYPE"}],
      },
    }'
    https://identitytoolkit.googleapis.com/v2/projects/PROJECT_ID/config?updateMask=recaptchaConfig.recaptchaKeys

Replace the following:

- <var translate="no">`PROJECT_ID`</var>: the project ID
- <var translate="no">`OAUTH_TOKEN`</var>: the credential used for administrator requests
- <var translate="no">`PROJECT_NUMBER`</var>: the project number
- <var translate="no">`KEY_VALUE`</var>: the string that represents the reCAPTCHA key you want to upload
- <var translate="no">`PLATFORM_TYPE`</var>: the platform of the application using the reCAPTCHA key. Valid values are `WEB`, `ANDROID`, and `IOS`.

## Disable the ability to bring your own key

To continue provisioning reCAPTCHA keys through
Identity Platform, call the
endpoint with `curl` and pass an empty list for `recaptchaConfig.recaptchaKeys`. For example:

    curl -i -X PATCH -H 'Content-Type: application/json' -H "x-goog-user-project:
    PROJECT_ID" -H 'Authorization: Bearer OAUTH_TOKEN' -d '
    {
      "recaptchaConfig": {
        "recaptchaKeys": [],
      },
    }'
    https://identitytoolkit.googleapis.com/v2/projects/PROJECT_ID/config?updateMask=recaptchaConfig.recaptchaKeys

Replace the following:

- <var translate="no">`PROJECT_ID`</var>: the project ID
- <var translate="no">`OAUTH_TOKEN`</var>: the credential used for administrator requests