v1

latestOpenAPI 3.0.32026-07-24156161.2 MB
Streams Service

OTP Auth Request

Send a one-time password (OTP) to a recipient. TextPeak generates the code, delivers it using the stream's configured OTP template and channel, and returns a request_uuid you reference when verifying.

  • Fails with 402 if the account balance is depleted, or 429 if the recipient's OTP request cap is reached.
  • Use retry: true to resend to the same recipient.

Authentication: stream token in the Authorization header (see Authentication in the API Overview).

post/streams/otp/auth

Request body

recipient_phonestring required

Recipient phone number in international format, digits only.

eventstring

Optional. The event/template to send the OTP with. Provide it only to override the default OTP template configured for this channel.

template_variablesobject

Optional. Values for any additional placeholders in the template beyond the built-in [code] placeholder. Keys are the placeholder names.

retryboolean

Set to true to resend the OTP to the same recipient.

Example request

{
  "recipient_phone": "447700900123",
  "event": "verification_code",
  "template_variables": {
    "first_name": "Lando"
  },
  "retry": true
}

Response

The OTP was accepted for delivery.

statusboolean

Whether the OTP was accepted for sending.

request_uuidstring

Identifier for this OTP request; pass the code to the verify endpoint to complete it.

codestring

Returned only when the stream is configured to expose the OTP code in the response.

Example response

{
  "status": true,
  "request_uuid": "b3f1c2a4-5d6e-47f8-9a0b-1c2d3e4f5a6b",
  "code": "4821"
}