# Generate and dispatch OTP verification code
URL: /docs/api-reference/two-factor-verification-otp/sendOtp

## POST `/api/v1/public/otp/send`

**Summary:** Generate and dispatch OTP verification code
**Operation ID:** `sendOtp`

Generates a cryptographically secure random verification code (4, 6, or 8 digits), reserves credits, and dispatches via priority OTP queue with automatic 30-second cooldown protection. Supports WhatsApp-first delivery with SMS fallback.

**Authentication:** `X-Api-Key: sk_live_...` or `Authorization: Bearer sk_live_...`

### Request Body (`application/json`)

```json
{
  "type": "object",
  "required": [
    "phoneNumber"
  ],
  "properties": {
    "phoneNumber": {
      "type": "string",
      "example": "+233241234567"
    },
    "senderId": {
      "type": "string",
      "maxLength": 11,
      "example": "VERIFY"
    },
    "digits": {
      "type": "integer",
      "enum": [
        4,
        6,
        8
      ],
      "default": 6,
      "example": 6
    },
    "expirySeconds": {
      "type": "integer",
      "default": 300,
      "example": 300
    },
    "template": {
      "type": "string",
      "example": "Your verification code is {code}. Valid for {expiryMinutes} minutes."
    },
    "strategy": {
      "type": "string",
      "enum": [
        "AUTO",
        "SMS_ONLY",
        "WHATSAPP_FIRST"
      ],
      "default": "AUTO",
      "description": "Delivery channel strategy. AUTO delivers via WhatsApp first if available, falling back to SMS."
    }
  }
}
```

### Responses

- **`200`**: OTP verification dispatched successfully

```json
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "example": "success"
    },
    "message": {
      "type": "string",
      "example": "Verification code dispatched successfully"
    },
    "data": {
      "$ref": "#/components/schemas/OtpSendResponse"
    }
  }
}
```
- **`401`**: Authentication failed or API key missing
- **`429`**: Rate limit exceeded for the API key