POST
/
otp
/
code
/
global
curl --request POST \
  --url https://api.crunchz.app/api/otp/code/global \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "contact_id": "xxx@c.us",
  "length": 4,
  "useLetter": false,
  "useNumber": true,
  "allCapital": false,
  "name": "Your Company Name",
  "expires": 1800
}'
{}

Overview

This endpoint allows you to request a one-time password (OTP) code for global use. GLOBAL means the system will randomize the channel to send or receive the message from or to the user. This endpoint generates a One-Time Password (OTP) with customizable validation settings.

Request Parameters

contact_id
string
required

The contact ID to send the OTP code to. Format: xxx@c.us

length
number
required

Length of the OTP code. Maximum value is 6.

useLetter
boolean
required

Whether to include letters in the OTP code.

useNumber
boolean
required

Whether to include numbers in the OTP code.

allCapital
boolean
required

Whether to use uppercase letters for the OTP code.

name
string
required

Application name that will be displayed to the user.

expires
number
required

Expiration time in seconds. For example, 1800 seconds (30 minutes).

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.