Karibu OTP API Documentation
The Karibu OTP API provides a robust solution for generating, verifying, resending, invalidating, and checking the status of One-Time Passwords (OTPs) for user authentication workflows. This API is designed to be developer-friendly, secure, and flexible for integration into various applications.Authentication
All API endpoints require anX-API-Key
header for authentication.
Header | Type | Required | Description |
---|---|---|---|
X-API-Key | string | Yes | Your API key. |
Endpoints Overview
The Karibu OTP API supports the following endpoints:Endpoint | Method | Description |
---|---|---|
/v1/otp/request | POST | Generates a new OTP for a phone number. |
/v1/otp/verify | POST | Verifies an OTP entered by the user. |
/v1/otp/resend | POST | Resends a new OTP to a phone number. |
/v1/otp/invalidate | POST | Invalidates an existing OTP. |
/v1/otp/status | GET | Retrieves the current status of an OTP. |
1. Request OTP
Generate a new OTP and send it to the specified phone number.Endpoint
Request Body
Field | Type | Required | Default | Description |
---|---|---|---|---|
phone_number | string | Yes | — | Phone number in E.164 format (e.g., +255712345678 ). |
app_key | string | Yes | — | Developer application key. |
sender_id | string | No | BRIQ OTP | Sender ID for SMS. |
otp_length | int | No | 6 | Length of the OTP code. |
minutes_to_expire | int | No | 10 | OTP expiry time in minutes. |
delivery_method | string | No | sms | Delivery method: sms or call . |
message_template | string | No | — | Custom message template (use {code} for OTP). |
Request Example
Response Example
2. Verify OTP
Verify an OTP entered by the user.Endpoint
Request Body
Field | Type | Required | Description |
---|---|---|---|
phone_number | string | Yes | Phone number in E.164 format. |
app_key | string | Yes | Developer application key. |
code | string | Yes | OTP code to verify. |
Request Example
Response Example
3. Resend OTP
Resend a new OTP to the specified phone number.Endpoint
Request Body
Field | Type | Required | Default | Description |
---|---|---|---|---|
phone_number | string | Yes | — | Phone number in E.164 format. |
app_key | string | Yes | — | Developer application key. |
sender_id | string | No | BRIQ OTP | Sender ID for SMS. |
otp_length | int | No | 6 | Length of the OTP code. |
minutes_to_expire | int | No | 10 | OTP expiry time in minutes. |
delivery_method | string | No | sms | Delivery method: sms or call . |
message_template | string | No | — | Custom message template (use {code} ). |
Request Example
Response Example
4. Invalidate OTP
Invalidate an existing OTP for a phone number.Endpoint
Request Body
Field | Type | Required | Description |
---|---|---|---|
phone_number | string | Yes | Phone number in E.164 format. |
app_key | string | Yes | Developer application key. |
Request Example
Response Example
5. Check OTP Status
Retrieve the current status of an OTP for a phone number.Endpoint
Query Parameters
Field | Type | Required | Description |
---|---|---|---|
phone_number | string | Yes | Phone number in E.164 format. |
app_key | string | Yes | Developer application key. |