Stay organized with collections
Save and categorize content based on your preferences.
This document shows you how to migrate from the v1beta1 version to the v1
version of the reCAPTCHA Enterprise API.
To migrate your assessment calls from v1beta1 to v1, do the following:
Replace calls to create assessments.
Replace https://recaptchaenterprise.googleapis.com/v1beta1/projects/PROJECT_ID/assessments?key=API_KEY
with https://recaptchaenterprise.googleapis.com/v1/projects/PROJECT_ID/assessments?key=API_KEY
Understand the changes in the assessment's JSON response:
When you use v1, the reasons and score fields are encapsulated in
riskAnalysis in the response, and when you use v1beta1, thereasons and
score fields are not encapsulated in the response.
Update your environment to use the reasons and score fields from the JSON response for
v1.
The following sample code shows the fields that are used from the response of v1
and v1beta1:
v1
.....
.....
# Get the risk score and the reason(s)forreasoninresponse.risk_analysis.reasons:
print(reason)
print("The reCAPTCHA score for this token is: "+str(response.risk_analysis.score))
....
....
v1beta1
.....
.....
# Get the risk score and the reason(s)forreasoninresponse.reasons:
print(reason)
print("The reCAPTCHA score for this token is: "+str(response.score))
....
....
Replace calls to annotate assessments.
Replace https://recaptchaenterprise.googleapis.com/v1beta1/projects/PROJECT_ID/assessments}:annotate
with https://recaptchaenterprise.googleapis.com/v1/projects/PROJECT_ID/assessments}:annotate
If you are currently logging your create and annotate API calls using
audit logging it is
recommended to use
platform logging
(available for v1 only).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Migrate to the v1 API\n\nThis document shows you how to migrate from the `v1beta1` version to the `v1`\nversion of the reCAPTCHA Enterprise API.\n| **Caution:** On August 31st, 2025, the `v1beta1` version of the reCAPTCHA Enterprise API will be deprecated. To avoid any disruption to your service, migrate to the `v1` version of the reCAPTCHA Enterprise API before August 31st, 2025.\n\nTo migrate your assessment calls from `v1beta1` to `v1`, do the following:\n\n1. Replace calls to create assessments.\n\n Replace `https://recaptchaenterprise.googleapis.com/v1beta1/projects/PROJECT_ID/assessments?key=API_KEY`\n with `https://recaptchaenterprise.googleapis.com/v1/projects/PROJECT_ID/assessments?key=API_KEY`\n | **Note:** You can use the same API key.\n2. Understand the changes in the assessment's JSON response:\n\n When you use `v1`, the `reasons` and `score` fields are encapsulated in\n `riskAnalysis` in the response, and when you use `v1beta1`, the`reasons` and\n `score` fields are not encapsulated in the response. \n\n ### v1\n\n\n ```bash\n {\n \"event\":{\n \"expectedAction\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eEXPECTED_ACTION\u003c/var\u003e\",\n \"hashedAccountId\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eACCOUNT_ID\u003c/var\u003e\",\n \"siteKey\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eKEY_ID\u003c/var\u003e\",\n \"token\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eTOKEN\u003c/var\u003e\",\n \"userAgent\":\"(USER-PROVIDED STRING)\",\n \"userIpAddress\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eUSER_PROVIDED_IP_ADDRESS\u003c/var\u003e\"\n },\n \"name\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eASSESSMENT_ID\u003c/var\u003e\",\n \"riskAnalysis\":{\n \"reasons\":[],\n \"score\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eSCORE\u003c/var\u003e\n },\n \"tokenProperties\":{\n \"action\":\"USER_INTERACTION\",\n \"createTime\":\"TIMESTAMP\",\n \"hostname\":\"HOSTNAME\",\n \"invalidReason\":\"(ENUM)\",\n \"valid\":(BOOLEAN)\n }\n }\n ```\n\n \u003cbr /\u003e\n\n ### v1beta1\n\n\n ```bash\n {\n \"event\":{\n \"expectedAction\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eEXPECTED_ACTION\u003c/var\u003e\",\n \"hashedAccountId\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eACCOUNT_ID\u003c/var\u003e\",\n \"siteKey\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eKEY_ID\u003c/var\u003e\",\n \"token\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eTOKEN\u003c/var\u003e\",\n \"userAgent\":\"(USER-PROVIDED STRING)\",\n \"userIpAddress\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eUSER_PROVIDED_IP_ADDRESS\u003c/var\u003e\"\n },\n \"name\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eASSESSMENT_ID\u003c/var\u003e\",\n \"reasons\":[],\n \"score\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eSCORE\u003c/var\u003e\",\n\n \"tokenProperties\":{\n \"action\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eUSER_INTERACTION\u003c/var\u003e\",\n \"createTime\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eTIMESTAMP\u003c/var\u003e\",\n \"hostname\":\"\u003cvar class=\"readonly\" translate=\"no\"\u003eHOSTNAME\u003c/var\u003e\",\n \"invalidReason\":\"(ENUM)\",\n \"valid\":(BOOLEAN)\n }\n }\n ```\n\n \u003cbr /\u003e\n\n3. Update your environment to use the `reasons` and `score` fields from the JSON response for\n `v1`.\n\n The following sample code shows the fields that are used from the response of `v1`\n and `v1beta1`: \n\n ### v1\n\n ```bash\n .....\n .....\n # Get the risk score and the reason(s)\n for reason in response.risk_analysis.reasons:\n print(reason)\n print(\n \"The reCAPTCHA score for this token is: \"\n + str(response.risk_analysis.score)\n )\n ....\n ....\n ```\n\n ### v1beta1\n\n ```bash\n .....\n .....\n # Get the risk score and the reason(s)\n for reason in response.reasons:\n print(reason)\n print(\n \"The reCAPTCHA score for this token is: \"\n + str(response.score)\n )\n ....\n ....\n ```\n4. Replace calls to annotate assessments.\n\n Replace `https://recaptchaenterprise.googleapis.com/v1beta1/projects/PROJECT_ID/assessments}:annotate`\n with `https://recaptchaenterprise.googleapis.com/v1/projects/PROJECT_ID/assessments}:annotate`\n5. If you are currently logging your `create` and `annotate` API calls using\n [audit logging](/recaptcha/docs/audit-logging) it is\n recommended to use\n [platform logging](/recaptcha/docs/platform-logging)\n (available for `v1` only).\n\nWhat's next\n-----------\n\n- [Create an assessment](/recaptcha/docs/create-assessment)\n- [Annotate an assessment](/recaptcha/docs/annotate-assessment)"]]