POST
/
generate
curl --request POST \
  --url https://api.fastotp.co/generate \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "numeric",
  "identifier": "<string>",
  "delivery": {
    "email": "<string>"
  },
  "validity": 123,
  "token_length": 4
}'
{
  "otp": {
    "id": "9b202659-fee7-46ab-836b-cdd310c4f327",
    "identifier": "trojan",
    "type": "alpha_numeric",
    "status": "pending",
    "delivery_methods": [
      "email"
    ],
    "delivery_details": {
      "email": "[email protected]"
    },
    "expires_at": "2024-01-19T17:04:06.000000Z",
    "created_at": "2024-01-19T00:24:06.000000Z",
    "updated_at": "2024-01-19T00:24:06.000000Z"
  }
}

Supported delivery channels

NameAttributeStatusRelease date
E-mailemailActive ✅20-Jan-2024
TelegramtelegramWIP 🟡N/A
WhatsappwhatsappWIP 🟡N/A

Headers

x-api-key
string

your API key

Body

application/json
type
enum<string>
required

token type

Available options:
numeric,
alpha,
alpha_numeric
identifier
string
required

unique identifier tied to the token

delivery
object
required

delivery options

validity
integer
required

token validity in minutes

token_length
integer
default:4
required

character length of the token

Required range: 4 <= x <= 10

Response

200
application/json
OK
otp
object