Skip to navigation

Check a one-time code

Checks the code the person typed. A correct code marks the challenge verified and returns the record. No proof token is returned, and a contact proved here cannot be carried into a verification submission.

Every call spends one attempt, including a repeat call on a challenge that is already verified. A wrong code answers 400 invalid_code with attemptsRemaining.

Billing. The check is charged once, when a code is first accepted, in production only. chargedAmount reports the cost. A repeat call does not charge again.

Error codes

errorStatusMeaning
invalid_request400The body failed validation.
invalid_code400The code is wrong. attemptsRemaining says how many tries are left.
secret_key_required403A publishable key was used. This endpoint accepts secret keys only.
environment_mismatch403The key belongs to an environment this deployment does not serve.
ip_not_allowed403The key has an IP allowlist and the calling address is not on it.
organization_suspended403The organisation is suspended. The response carries reason and suspendedAt.
business_not_approved403A live key was used before the business was approved for production.
challenge_not_found404No challenge with that id for this organisation and environment, or it was not created through this API.
challenge_expired410The five minute window has closed. Send a new code.
too_many_attempts429The attempt allowance is spent. Send a new code.

A missing or unknown key answers 401, where error is a short sentence rather than a code.

Requires a secret (sk_) key. A publishable key receives 403 secret_key_required.

Authentication

AuthorizationBearer
Send the API key as a Bearer token. Each operation states whether a publishable key is enough or a secret key is required.

Path parameters

idstringRequired
The contact verification id returned when the code was sent.

Request

This endpoint expects an object.
codestringRequired4-12 characters
The code the person typed.

Response

The code was accepted.
contactVerificationobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
410
Gone Error
429
Too Many Requests Error