Skip to main content
POST
/
otp
/
code
/
validate
OTP Code - Validate Code
curl --request POST \
  --url https://api.crunchz.app/api/otp/code/validate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contact_id": "[email protected]",
  "code": "123456"
}
'
{}

Overview

This endpoint verifies OTPs generated by the “Request and Send OTP Code” endpoint. It allows you to validate whether the OTP code provided by a user matches the one that was sent.

Request Parameters

contact_id
string
required
The contact ID that received the OTP code. Format: [email protected]
code
string
required
The OTP code to validate. Example: “123456”

Response

success
boolean
Indicates whether the request was successful.
message
string
A message describing the result of the operation.
data
object

Error Codes

403
object
Authorization Exception - Occurs when the request is not properly authorized.
422
object
Validation Exception - Occurs when the request parameters fail validation.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
contact_id
string
required

Contact ID.

Required string length: 10 - 50
code
string
required

OTP Code.

Required string length: 4 - 8
Example:

"123456"

Response

  • Option 1
  • ValidateOtpCodeResource

The response is of type object.