Skip to main content

keys

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

Overview

Namekeys
TypeResource
Idgoogle.recaptchaenterprise.keys

Fields

NameDatatypeDescription
namestringIdentifier. The resource name for the Key in the format projects/{project}/keys/{key}.
androidSettingsobjectSettings specific to keys that can be used by Android apps.
createTimestringOutput only. The timestamp corresponding to the creation of this key.
displayNamestringRequired. Human-readable display name of this key. Modifiable by user.
expressSettingsobjectSettings specific to keys that can be used for reCAPTCHA Express.
iosSettingsobjectSettings specific to keys that can be used by iOS apps.
labelsobjectOptional. See [Creating and managing labels] (https://cloud.google.com/recaptcha/docs/labels).
testingOptionsobjectOptions for user acceptance testing.
wafSettingsobjectSettings specific to keys that can be used for WAF (Web Application Firewall).
webSettingsobjectSettings specific to keys that can be used by websites.

Methods

NameAccessible byRequired ParamsDescription
getSELECTkeysId, projectsIdReturns the specified key.
listSELECTprojectsIdReturns the list of all keys that belong to a project.
createINSERTprojectsIdCreates a new reCAPTCHA Enterprise key.
deleteDELETEkeysId, projectsIdDeletes the specified key.
patchUPDATEkeysId, projectsIdUpdates the specified key.
migrateEXECkeysId, projectsIdMigrates 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.

SELECT examples

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

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

INSERT example

Use the following StackQL query and manifest file to create a new keys resource.

/*+ create */
INSERT INTO google.recaptchaenterprise.keys (
projectsId,
wafSettings,
name,
iosSettings,
testingOptions,
webSettings,
androidSettings,
labels,
displayName,
expressSettings
)
SELECT
'{{ projectsId }}',
'{{ wafSettings }}',
'{{ name }}',
'{{ iosSettings }}',
'{{ testingOptions }}',
'{{ webSettings }}',
'{{ androidSettings }}',
'{{ labels }}',
'{{ displayName }}',
'{{ expressSettings }}'
;

UPDATE example

Updates a keys resource.

/*+ update */
UPDATE google.recaptchaenterprise.keys
SET
wafSettings = '{{ wafSettings }}',
name = '{{ name }}',
iosSettings = '{{ iosSettings }}',
testingOptions = '{{ testingOptions }}',
webSettings = '{{ webSettings }}',
androidSettings = '{{ androidSettings }}',
labels = '{{ labels }}',
displayName = '{{ displayName }}',
expressSettings = '{{ expressSettings }}'
WHERE
keysId = '{{ keysId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified keys resource.

/*+ delete */
DELETE FROM google.recaptchaenterprise.keys
WHERE keysId = '{{ keysId }}'
AND projectsId = '{{ projectsId }}';