> ## Documentation Index
> Fetch the complete documentation index at: https://rideshare.docs.sumit-dhondikar.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Request OTP

> Send a one-time password to an email address before completing signup.

Send a one-time password (OTP) to the provided email address. You must call this endpoint and receive the OTP before calling [Sign Up](/api-reference/auth/signup).

## Request

**`POST /auth/signup/request-otp`**

<ParamField body="email" type="string" required>
  The email address to send the OTP to.
</ParamField>

<ParamField body="name" type="string">
  The user's display name. You can provide this here or during the signup step.
</ParamField>

## Response

<ResponseField name="message" type="string">
  A human-readable status message describing the result.
</ResponseField>

<ResponseField name="emailSent" type="boolean">
  Indicates whether the OTP was successfully delivered to the email address.
</ResponseField>

<ResponseField name="devOtp" type="string">
  The raw OTP value, returned only in non-production environments for testing. Empty string in production.
</ResponseField>

<ResponseField name="expiresAt" type="string">
  ISO 8601 timestamp indicating when the OTP expires. Empty string if unavailable.
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST http://localhost:8080/auth/signup/request-otp \
    -H "Content-Type: application/json" \
    -d '{"email": "alex@example.com", "name": "Alex"}'
  ```

  ```json Response theme={null}
  {
    "message": "OTP sent successfully.",
    "emailSent": true,
    "devOtp": "",
    "expiresAt": "2026-04-02T12:15:00Z"
  }
  ```
</CodeGroup>

<Note>
  This endpoint is rate limited. If you call it too frequently, you receive a `429` response with a `retryAfterSeconds` field telling you how long to wait before trying again.
</Note>

## Error codes

| Status | Meaning                                                                |
| ------ | ---------------------------------------------------------------------- |
| 400    | `email` is missing or blank                                            |
| 429    | Too many OTP requests — check `retryAfterSeconds` in the response body |
