Skip to content

TrustCaptcha API (Legacy)

Called by the TrustCaptcha backend libraries 3.x (legacy guide). The result has the same fields as in v3, except for the names of the four booleans, and the error answers differ:

v2 fieldv3 field
verificationPassedisVerificationPassed
gatewayFailoverActiveisGatewayFailoverActive
riskScoringEnabledisRiskScoringEnabled
minimalDataModeEnabledisMinimalDataModeEnabled
GET https://api.trustcomponent.com/captcha/v2/verifications/{verificationId}/results

Returns the result of a verification

Call it from your server with the verification id from the token the widget put into your form. A 429 here means the result reached its maximum retrieval count and comes without Retry-After; it is final and is not retried.

Authentication: API key as bearer token. Operation getResultV2.

Example request
Terminal window
# The verification id is the "verificationId" inside the token the widget wrote into your form.
curl "https://api.trustcomponent.com/captcha/v2/verifications/<verification_id>/results" \
-H "Authorization: Bearer <your_api_key>"
Example response (200)
{
"captchaId": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a",
"verificationId": "cc2e2d5e-d1ef-4a7f-a7bd-dec5b37df47a",
"verificationPassed": true,
"score": 0.3,
"decisionType": "STANDARD",
"decisionAction": "ALLOW",
"gatewayFailoverActive": false,
"riskScoringEnabled": true,
"minimalDataModeEnabled": false,
"origin": "https://www.example.com",
"ipAddress": "203.0.113.7",
"countryCode": "DE",
"deviceFamily": "Mac",
"operatingSystem": "Mac OS X",
"browser": "Firefox",
"verificationStartedAt": "2020-01-01T13:30:05.941Z",
"verificationFinishedAt": "2020-01-01T13:30:09.512Z",
"resultExpiresAt": "2020-01-01T13:45:09.512Z",
"resultFirstFetchedAt": "2020-01-01T13:30:10.106Z",
"resultLastFetchedAt": "2020-01-01T13:30:10.106Z"
}

Path parameters

NameTypeDescription
verificationIdrequiredstring (uuid)ID of a verification

Response 200 · application/json

FieldTypeDescription
captchaIdstring (uuid)Id of the captcha (in the dashboard) the verification ran on.
verificationIdstring (uuid)Id of the verification, the one from the token.
verificationPassedbooleanWhether the visitor passed the CAPTCHA. The field most integrations act on.
scorenumberRisk that the request is automated, from 0 (probably human) to 1 (probably automated). · 0 to 1
decisionTypestringHow the verification outcome was determined. Possible values include STANDARD, BYPASS_KEY, CUSTOM_ACCESS_RULE, GLOBAL_IP_ACCESS_RULE, FAILOVER, FAILOVER_TOLERANCE.
decisionActionstringThe recommended action for this verification. Possible values include NO_ACTION, ALLOW, BLOCK, CUSTOM.
gatewayFailoverActivebooleanTrue when the gateway synthesized this result because the captcha service was unreachable.
riskScoringEnabledbooleanWhether the risk analysis of the captcha was switched on for this verification.
minimalDataModeEnabledbooleanWhether the captcha runs in minimal data mode; then origin, IP address and device fields are empty.
originstringOrigin of the page the widget ran on.
ipAddressstringIP address of the visitor.
countryCodestringTwo-letter ISO 3166-1 alpha-2 country code derived from the client IP. Empty string if not resolvable.
deviceFamilystringDevice family of the visitor, from the user agent.
operatingSystemstringOperating system of the visitor, from the user agent.
browserstringBrowser of the visitor, from the user agent.
verificationStartedAtstringWhen the widget started the verification.
verificationFinishedAtstringWhen the visitor finished the verification.
resultExpiresAtstringUntil when the result can be retrieved.
resultFirstFetchedAtmay be nullstringWhen the result was retrieved for the first time.
resultLastFetchedAtmay be nullstringWhen the result was retrieved for the last time.

Status codes

StatusMeaning
200Result object
403Authorization header missing or api key invalid
404Could not find a result for given Id
410The result has expired and can no longer be retrieved
412Client failover claimed, but no recent outage is on record
423Result is not yet released
429The result has reached its maximum retrieval count and can no longer be retrieved

The same operation also answers under the older path /v2/verifications/{verificationId}/results, without the /captcha prefix.

v2 answerv3 answer
403 for a missing or invalid key401 with credentials_missing or credentials_invalid
423 while not finished409, code: result_not_released
429 once retrieved (without Retry-After)410, code: result_retrieval_limit_reached
410 once expired410, code: result_expired

The test verification ids work in v2 only together with the test key ak_ followed by 49 × x: to try the example, use it as <your_api_key> and 00000000-0000-0000-0000-000000000000 as <verification_id>.

Called by the TrustCaptcha backend libraries 1.x and 2.x (legacy guide). It authenticates with one of two credentials: an API key of the project (or the older secret key of the captcha) in the tc-authorization header, or the access token the widget issued with the verification as query parameter accessToken. It returns a smaller result than v2.

Example request
curl "https://api.trustcomponent.com/verifications/{verificationId}/assessments" \
-H "tc-authorization: <your_api_key>"
StatusMeaning
200The assessment: captchaId, verificationId, verificationPassed, score, reason, mode, origin, ipAddress, deviceFamily, operatingSystem, browser and three timestamps
403No credential, or the key or access token is invalid
404No assessment with this id
410Already retrieved
423Not released yet