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": "xxx@c.us",
  "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: xxx@c.us
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

Response

200
application/json

The response is of type object.