Description
Summary: Initiates a one-time password (OTP) authentication request via the TextPeak Streams API. Details: This endpoint triggers an OTP delivery to a specified recipient phone number. The OTP is sent using a predefined event template (identified by the event field) and a designated sender. This is designed for authentication flows such as login verification, account confirmation, or two-factor authentication (2FA). The platform handles OTP generation and delivery; the caller only needs to specify the recipient, sender, and the event that defines the OTP template and delivery channel. Authentication is performed via a stream token passed in the Authorization header.
Authentication & Scopes
Authentication is handled via a stream token provided in the Authorization header. No OAuth scopes are defined; access is granted or denied based on the validity of the token.
| Method | Details |
|---|---|
| Stream Token | Pass your token directly in the Authorization header value (not as a Bearer token). |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | The stream token that verifies your access to the API. |
Content-Type | Yes | Must be set to application/json. The API only accepts JSON-formatted request bodies. |
Parameters
This endpoint does not use path or query parameters.
Request Body
The request body is a flat JSON object specifying the recipient, sender, and the OTP event to trigger.
| Field | Type | Required | Description |
|---|---|---|---|
recipient_phone | string | Yes | The phone number of the recipient who will receive the OTP, in international format (e.g., "972507445456"). |
sender | string | Yes | The sender's identifier displayed to the recipient (e.g., "OTP"). |
event | string | Yes | The name of the predefined OTP event template to trigger. Defines the message format and delivery channel (e.g., "login_commpeak"). |
Examples
This endpoint has a saved example demonstrating usage:
- OTP Auth Request — Triggering an OTP delivery for a login authentication event.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||