---
title: "Send OTP"
method: POST
path: "/dev/otp/send"
---

# Send OTP

`POST /dev/otp/send`

## Request

- Base URL: `https://www.fast2sms.com`
- URL: `https://www.fast2sms.com/dev/otp/send`
- Auth: none declared. Required headers: `Authorization`

Send an OTP to a mobile number using a predefined OTP template. You can customize the OTP length, expiry, and provide values for variables in your DLT template.

## Headers

- `Authorization` string, required

## Request body

- object
  - `mobile` string, required: 10-digit Indian mobile number.
  - `otp_id` string, required: Your unique OTP Template ID.
  - `otp_expiry` integer: OTP expiry time in minutes (Min: 1, Max: 10080, Default: 15).
  - `otp_length` integer: OTP length (Min: 4, Max: 10, Default: 6).
  - `otp` string: Optional: Pass your own OTP value if you don't want Fast2SMS to generate otp. (max 10)
  - `variables_values` string: Values of {#var#} variables used in the template (if any), separated by pipe (|). Pass {otp} to send the original OTP value in multiple variables.
  - `udf1` string: User Defined Field 1 – Optional custom value passed via API and returned in the webhook for your internal reference or tracking.
  - `udf2` string: User Defined Field 2 – Optional custom value passed via API and returned in the webhook for your internal reference or tracking.
  - `udf3` string: User Defined Field 3 – Optional custom value passed via API and returned in the webhook for your internal reference or tracking.

## Response `200`

OTP sent successfully

- object
  - `return` boolean
  - `status_code` integer
  - `request_id` string
  - `message` string

## Other responses

- `400`: Bad Request - Validation or logic error
- `401`: Unauthorized - Invalid or missing Authorization key

---

[API](https://skmtc.dev/fast2sms/apis/otp-api.md) - [All operations](https://skmtc.dev/fast2sms/apis/otp-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fast2sms/apis/otp-api/revisions/273b6f3afe06?raw)
