OTP API Documentation

A simple REST API to send and verify OTPs via SMS. One endpoint to send, one to verify. Works with any language or framework.

Authentication

All API requests require an API key in the X-API-Key header. Create API keys from your dashboard.

X-API-Key: sm_live_your_api_key_here

Base URL

https://api.startmessaging.com

API Endpoints

POST/otp/send

Send an OTP code to a phone number via SMS. Requires phoneNumber, otp, and idempotencyKey in the request body.

POST/otp/verify

Verify an OTP code entered by the user. Requires otpRequestId and otp in the request body.

POST/otp/resend

Resend an OTP for an existing request. Generates a new OTP code and sends it to the same phone number.

Response Format

All responses follow a consistent JSON envelope:

{
  "success": true,
  "statusCode": 201,
  "requestId": "req_abc123",
  "timestamp": "2026-02-15T10:30:00.000Z",
  "data": {
    "otpRequestId": "uuid-of-otp-request",
    "messageId": "uuid-of-message",
    "status": "queued"
  }
}

Send an OTP in One API Call

Works with every language. Just a single POST request.

curl -X POST https://api.startmessaging.com/otp/send \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sm_live_your_api_key_here" \
  -d '{
    "phoneNumber": "+919876543210",
    "otp": "123456",
    "idempotencyKey": "unique-request-id-123"
  }'

API FAQ

Start Building with the OTP API

Get your API key and send your first OTP in under 5 minutes.