---
title: "POST /v1/{+parent}/keys"
method: POST
path: "/v1/{+parent}/keys"
tags: ["projects"]
---

# POST /v1/{+parent}/keys

`POST /v1/{+parent}/keys`

Creates a new reCAPTCHA Enterprise key.

## Path parameters

- `parent` string, required

## Request body

- GoogleCloudRecaptchaenterpriseV1Key — A key used to identify and configure applications (web and/or mobile) that use reCAPTCHA Enterprise.
  - `labels` object — Optional. See [Creating and managing labels] (https://cloud.google.com/recaptcha/docs/labels).
  - `name` string — Identifier. The resource name for the Key in the format `projects/{project}/keys/{key}`.
  - `universalSettings` GoogleCloudRecaptchaenterpriseV1UniversalKeySettings — Settings for keys that are configured through their Policy.
  - `webSettings` GoogleCloudRecaptchaenterpriseV1WebKeySettings — Settings specific to keys that can be used by websites.
    - `challengeSecurityPreference` 'CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED' | 'USABILITY' | 'BALANCE' | 'SECURITY' — Optional. Settings for the frequency and difficulty at which this key triggers captcha challenges. This should only be specified for `IntegrationType` CHECKBOX, INVISIBLE or POLICY_BASED_CHALLENGE.
    - `challengeSettings` GoogleCloudRecaptchaenterpriseV1WebKeySettingsChallengeSettings — Settings for POLICY_BASED_CHALLENGE keys to control when a challenge is triggered.
      - `actionSettings` object — Optional. The action to score threshold map. The action name should be the same as the action name passed in the `data-action` attribute (see https://cloud.google.com/recaptcha/docs/actions-website). Action names are case-insensitive. There is a maximum of 100 action settings. An action name has a maximum length of 100.
      - `defaultSettings` GoogleCloudRecaptchaenterpriseV1WebKeySettingsActionSettings — Per-action challenge settings.
        - `scoreThreshold` number, float — Required. A challenge is triggered if the end-user score is below that threshold. Value must be between 0 and 1 (inclusive).
    - `allowAllDomains` boolean — Optional. If set to true, it means allowed_domains are not enforced.
    - `allowedDomains` string[] — Optional. Domains or subdomains of websites allowed to use the key. All subdomains of an allowed domain are automatically allowed. A valid domain requires a host and must not include any path, port, query or fragment. Examples: 'example.com' or 'subdomain.example.com' Each key supports a maximum of 250 domains. To use a key on more domains, set `allow_all_domains` to true. When this is set, you are responsible for validating the hostname by checking the `token_properties.hostname` field in each assessment response against your list of allowed domains.
    - `allowAmpTraffic` boolean — Optional. If set to true, the key can be used on AMP (Accelerated Mobile Pages) websites. This is supported only for the SCORE integration type.
    - `integrationType` 'INTEGRATION_TYPE_UNSPECIFIED' | 'SCORE' | 'CHECKBOX' | 'INVISIBLE' | 'POLICY_BASED_CHALLENGE' — Required. Describes how this key is integrated with the website.
  - `androidSettings` GoogleCloudRecaptchaenterpriseV1AndroidKeySettings — Settings specific to keys that can be used by Android apps.
    - `allowAllPackageNames` boolean — Optional. If set to true, allowed_package_names are not enforced.
    - `allowedPackageNames` string[] — Optional. Android package names of apps allowed to use the key. Example: 'com.companyname.appname' Each key supports a maximum of 250 package names. To use a key on more apps, set `allow_all_package_names` to true. When this is set, you are responsible for validating the package name by checking the `token_properties.android_package_name` field in each assessment response against your list of allowed package names.
    - `supportNonGoogleAppStoreDistribution` boolean — Optional. Set to true for keys that are used in an Android application that is available for download in app stores in addition to the Google Play Store.
  - `displayName` string — Required. Human-readable display name of this key. Modifiable by user.
  - `createTime` string, google-datetime — Output only. The timestamp corresponding to the creation of this key.
  - `iosSettings` GoogleCloudRecaptchaenterpriseV1IOSKeySettings — Settings specific to keys that can be used by iOS apps.
    - `allowAllBundleIds` boolean — Optional. If set to true, allowed_bundle_ids are not enforced.
    - `allowedBundleIds` string[] — Optional. iOS bundle IDs of apps allowed to use the key. Example: 'com.companyname.productname.appname' Each key supports a maximum of 250 bundle IDs. To use a key on more apps, set `allow_all_bundle_ids` to true. When this is set, you are responsible for validating the bundle id by checking the `token_properties.ios_bundle_id` field in each assessment response against your list of allowed bundle IDs.
    - `appleDeveloperId` GoogleCloudRecaptchaenterpriseV1AppleDeveloperId — Contains fields that are required to perform Apple-specific integrity checks.
      - `keyId` string — Required. The Apple developer key ID (10-character string).
      - `privateKey` string — Required. Input only. A private key (downloaded as a text file with a .p8 file extension) generated for your Apple Developer account. Ensure that Apple DeviceCheck is enabled for the private key.
      - `teamId` string — Required. The Apple team ID (10-character string) owning the provisioning profile used to build your application.
  - `wafSettings` GoogleCloudRecaptchaenterpriseV1WafSettings — Settings specific to keys that can be used for WAF (Web Application Firewall).
    - `wafService` 'WAF_SERVICE_UNSPECIFIED' | 'CA' | 'FASTLY' | 'CLOUDFLARE' | 'AKAMAI' — Required. The Web Application Firewall (WAF) service that uses this key.
    - `wafFeature` 'WAF_FEATURE_UNSPECIFIED' | 'CHALLENGE_PAGE' | 'SESSION_TOKEN' | 'ACTION_TOKEN' | 'EXPRESS' — Required. The Web Application Firewall (WAF) feature for which this key is enabled.
  - `testingOptions` GoogleCloudRecaptchaenterpriseV1TestingOptions — Options for user acceptance testing.
    - `testingScore` number, float — Optional. All assessments for this Key return this score. Must be between 0 (likely not legitimate) and 1 (likely legitimate) inclusive.
    - `testingChallenge` 'TESTING_CHALLENGE_UNSPECIFIED' | 'NOCAPTCHA' | 'UNSOLVABLE_CHALLENGE' — Optional. For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests for this site return nocaptcha if NOCAPTCHA, or an unsolvable challenge if CHALLENGE.
  - `expressSettings` GoogleCloudRecaptchaenterpriseV1ExpressKeySettings — Settings specific to keys that can be used for reCAPTCHA Express.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/recaptchaenterprise.md) · [All operations](https://skmtc.net/google/apis/recaptchaenterprise/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/recaptchaenterprise/versions/3b5248d3ca31/schema)
