OTP

OTP Verify Request

Verify the code a recipient submitted against the active OTP for their phone number. Returns verification: true on a match, otherwise false.

A wrong code is a normal false result with HTTP 200 — not an error. A correct code is accepted once: verifying clears it.

Voice OTP. While the call is still in progress the response is verification: false with in_progress: true; verify again after the call.

Errors. 400 no active code for this recipient · 429 too many wrong codes (wait for the cool-down). Errors use the standard error envelope.

Authentication: OTP token (the stream token of an OTP stream) in the Authorization header (see Authentication in the API Overview).

post/otp/verify

Request

  • Base URL
    https://api.commpeak.com/textpeak/streams
  • URL
    https://api.commpeak.com/textpeak/streams/otp/verify
  • Auth
    API key in header Authorization

Request body

recipient_phonestring required

The phone number the code was sent to, in international format.

codestring required

The code your user entered, as a string (keep leading zeros).

Example request

{
  "code": "48213",
  "recipient_phone": "12125551234"
}

Response

Successful Response

verificationboolean required

true when the code matches the active code for this recipient.

in_progressboolean nullable

true while a voice OTP call is still in progress: verification is false for now, so ask again after the call.

Example response

{
  "verification": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.