Description
Summary: Verifies a one-time password (OTP) code submitted by a user via the TextPeak Streams API.
Details: This endpoint validates an OTP code against the phone number it was originally sent to. It is the second step in the OTP authentication flow — after the OTP has been delivered via the /streams/otp/auth endpoint, the recipient submits the code they received, and this endpoint confirms whether it is valid. Use this to complete authentication flows such as login verification, account confirmation, or two-factor authentication (2FA). 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 containing the phone number and the OTP code to verify.
| Field | Type | Required | Description |
|---|---|---|---|
phone_number | string | Yes | The phone number the OTP was originally sent to, in international format (e.g., "972507445456"). Must match the number used in the corresponding /streams/otp/auth request. |
otp_code | string | Yes | The one-time password code submitted by the user for verification (e.g., "482910"). |
Examples
This endpoint has a saved example demonstrating usage:
- OTP Verify Request — Verifying an OTP code against the recipient's phone number.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||