REST Resource: projects.keys

Resource: Key

A key used to identify and configure applications (web and/or mobile) that use reCAPTCHA Enterprise.

JSON representation
{
  "name": string,
  "displayName": string,
  "labels": {
    string: string,
    ...
  },
  "createTime": string,

  // Union field platform_settings can be only one of the following:
  "webSettings": {
    object (WebKeySettings)
  },
  "androidSettings": {
    object (AndroidKeySettings)
  },
  "iosSettings": {
    object (IOSKeySettings)
  }
  // End of list of possible types for union field platform_settings.
}
Fields
name

string

The resource name for the Key in the format "projects/{project}/keys/{key}".

displayName

string

Human-readable display name of this key. Modifiable by user.

labels

map (key: string, value: string)

See Creating and managing labels.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

createTime

string (Timestamp format)

The timestamp corresponding to the creation of this Key.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

Union field platform_settings. Platform specific settings for this key. The key can only be used on one platform, the one it has settings for. platform_settings can be only one of the following:
webSettings

object (WebKeySettings)

Settings for keys that can be used by websites.

androidSettings

object (AndroidKeySettings)

Settings for keys that can be used by Android apps.

iosSettings

object (IOSKeySettings)

Settings for keys that can be used by iOS apps.

WebKeySettings

Settings specific to keys that can be used by websites.

JSON representation
{
  "allowAllDomains": boolean,
  "allowedDomains": [
    string
  ],
  "allowAmpTraffic": boolean,
  "integrationType": enum (IntegrationType),
  "challengeSecurityPreference": enum (ChallengeSecurityPreference)
}
Fields
allowAllDomains

boolean

If set to true, it means allowedDomains will not be enforced.

allowedDomains[]

string

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'

allowAmpTraffic

boolean

Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites. This can only be set for the SCORE integration type.

integrationType

enum (IntegrationType)

Required. Describes how this key is integrated with the website.

challengeSecurityPreference

enum (ChallengeSecurityPreference)

Settings for the frequency and difficulty at which this key triggers captcha challenges. This should only be specified for IntegrationTypes CHECKBOX and INVISIBLE.

IntegrationType

Enum that represents the integration types for web keys.

Enums
INTEGRATION_TYPE_UNSPECIFIED Default type that indicates this enum hasn't been specified. This is not a valid IntegrationType, one of the other types must be specified instead.
SCORE Only used to produce scores. It doesn't display the "I'm not a robot" checkbox and never shows captcha challenges.
CHECKBOX Displays the "I'm not a robot" checkbox and may show captcha challenges after it is checked.
INVISIBLE Doesn't display the "I'm not a robot" checkbox, but may show captcha challenges after risk analysis.

ChallengeSecurityPreference

Enum that represents the possible challenge frequency and difficulty configurations for a web key.

Enums
CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED Default type that indicates this enum hasn't been specified.
USABILITY Key tends to show fewer and easier challenges.
BALANCE Key tends to show balanced (in amount and difficulty) challenges.
SECURITY Key tends to show more and harder challenges.

AndroidKeySettings

Settings specific to keys that can be used by Android apps.

JSON representation
{
  "allowedPackageNames": [
    string
  ]
}
Fields
allowedPackageNames[]

string

Android package names of apps allowed to use the key. Example: 'com.companyname.appname'

IOSKeySettings

Settings specific to keys that can be used by iOS apps.

JSON representation
{
  "allowedBundleIds": [
    string
  ]
}
Fields
allowedBundleIds[]

string

iOS bundle ids of apps allowed to use the key. Example: 'com.companyname.productname.appname'

Methods

create

Creates a new reCAPTCHA Enterprise key.

delete

Deletes the specified key.

get

Returns the specified key.

list

Returns the list of all keys that belong to a project.

patch

Updates the specified key.