POST
/
otp
/
link
/
global
curl --request POST \
  --url https://api.crunchz.app/api/otp/link/global \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "contact_id": "xxx@c.us",
  "expires": 1800,
  "name": "Your Company Name",
  "message": {
    "prompt": "Give me link to login at TARGET App",
    "success": "Here is your login link bit.ly/any",
    "failed": "Login failed, please try again later.",
    "expired": "The link has been expired, please try another one."
  },
  "callback": {
    "success": "https://domain.com/callback/success",
    "failed": "https://domain.com/callback/failed"
  }
}'
{
  "success": true,
  "message": "<string>",
  "data": {
    "id": "<string>",
    "code": "<string>",
    "contact_id": "<string>",
    "link": "<string>",
    "app_uri": "<string>",
    "expired_at": "<string>",
    "timestamp": "<string>"
  }
}

Overview

This endpoint allows you to request a one-time password (OTP) link for global use. The OTP link can be used for authentication or verification purposes.

Request Parameters

contact_id
string
required

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

expires
number
required

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

name
string

Application name that will be displayed to the user.

message
object
callback
object

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

OtpLinkResource

The response is of type object.