Skip to main content

keys

Creates, updates, deletes, gets or lists a keys resource.

Overview

Namekeys
TypeResource
Idgoogle.recaptchaenterprise.keys

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name for the Key in the format projects/{project}/keys/{key}.
androidSettingsobjectSettings for keys that can be used by Android apps. (id: GoogleCloudRecaptchaenterpriseV1AndroidKeySettings)
createTimestring (google-datetime)Output only. The timestamp corresponding to the creation of this key.
displayNamestringRequired. Human-readable display name of this key. Modifiable by user.
expressSettingsobjectSettings for keys that can be used by reCAPTCHA Express. (id: GoogleCloudRecaptchaenterpriseV1ExpressKeySettings)
iosSettingsobjectSettings for keys that can be used by iOS apps. (id: GoogleCloudRecaptchaenterpriseV1IOSKeySettings)
labelsobjectOptional. See [Creating and managing labels] (https://cloud.google.com/recaptcha/docs/labels).
testingOptionsobjectOptional. Options for user acceptance testing. (id: GoogleCloudRecaptchaenterpriseV1TestingOptions)
wafSettingsobjectOptional. Settings for WAF (id: GoogleCloudRecaptchaenterpriseV1WafSettings)
webSettingsobjectSettings for keys that can be used by websites. (id: GoogleCloudRecaptchaenterpriseV1WebKeySettings)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, keysIdReturns the specified key.
listselectprojectsIdpageSize, pageTokenReturns the list of all keys that belong to a project.
createinsertprojectsIdCreates a new reCAPTCHA Enterprise key.
patchupdateprojectsId, keysIdupdateMaskUpdates the specified key.
deletedeleteprojectsId, keysIdDeletes the specified key.
migrateexecprojectsId, keysIdMigrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must be authenticated as one of the current owners of the reCAPTCHA Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
keysIdstring
projectsIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Returns the specified key.

SELECT
name,
androidSettings,
createTime,
displayName,
expressSettings,
iosSettings,
labels,
testingOptions,
wafSettings,
webSettings
FROM google.recaptchaenterprise.keys
WHERE projectsId = '{{ projectsId }}' -- required
AND keysId = '{{ keysId }}' -- required;

INSERT examples

Creates a new reCAPTCHA Enterprise key.

INSERT INTO google.recaptchaenterprise.keys (
data__name,
data__displayName,
data__webSettings,
data__androidSettings,
data__iosSettings,
data__expressSettings,
data__labels,
data__testingOptions,
data__wafSettings,
projectsId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ webSettings }}',
'{{ androidSettings }}',
'{{ iosSettings }}',
'{{ expressSettings }}',
'{{ labels }}',
'{{ testingOptions }}',
'{{ wafSettings }}',
'{{ projectsId }}'
RETURNING
name,
androidSettings,
createTime,
displayName,
expressSettings,
iosSettings,
labels,
testingOptions,
wafSettings,
webSettings
;

UPDATE examples

Updates the specified key.

UPDATE google.recaptchaenterprise.keys
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__webSettings = '{{ webSettings }}',
data__androidSettings = '{{ androidSettings }}',
data__iosSettings = '{{ iosSettings }}',
data__expressSettings = '{{ expressSettings }}',
data__labels = '{{ labels }}',
data__testingOptions = '{{ testingOptions }}',
data__wafSettings = '{{ wafSettings }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND keysId = '{{ keysId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
androidSettings,
createTime,
displayName,
expressSettings,
iosSettings,
labels,
testingOptions,
wafSettings,
webSettings;

DELETE examples

Deletes the specified key.

DELETE FROM google.recaptchaenterprise.keys
WHERE projectsId = '{{ projectsId }}' --required
AND keysId = '{{ keysId }}' --required;

Lifecycle Methods

Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must be authenticated as one of the current owners of the reCAPTCHA Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.

EXEC google.recaptchaenterprise.keys.migrate 
@projectsId='{{ projectsId }}' --required,
@keysId='{{ keysId }}' --required
@@json=
'{
"skipBillingCheck": {{ skipBillingCheck }}
}';