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

# How to Integrate Email OTP

> Send a one-time password by email with OTP.ID using the public request and send endpoints.

Use this guide when you want OTP.ID to send an outbound email OTP. You send `channel: "email"` to both [`POST /v3/request`](/api-reference/request-otp) and [`POST /v3/send`](/api-reference/send-otp), and OTP.ID delivers the message to the destination email address you provide.

Email OTP fits flows where the user is already working from an inbox-centric workflow. The code arrives in the user's email inbox, so you should guide them to check their inbox and spam or junk folders if the message is not visible right away. Your client must validate the destination as a valid email address before it calls the API. When you use the request API, the destination can come from `number` or the optional `email` field; see the [POST /v3/request API reference](/api-reference/request-otp) for the field and validation rules.

## How the flow works

<Steps>
  <Step title="Create the OTP request">
    Call [`POST /v3/request`](/api-reference/request-otp) with `channel: "email"` when you want OTP.ID to generate the code for you.
  </Step>

  <Step title="Or send your own code">
    Call [`POST /v3/send`](/api-reference/send-otp) with `channel: "email"` when your application already has the code.
  </Step>

  <Step title="OTP.ID sends an email message">
    OTP.ID delivers the OTP as an outbound email to the destination address you submitted.
  </Step>

  <Step title="The user enters the code">
    Show a clear OTP entry UI in your app and let the user paste or type the code from their inbox.
  </Step>

  <Step title="You verify the code">
    Submit the transaction ID and code through the verification flow described in the [Verify OTP guide](/guides/verify-otp).
  </Step>
</Steps>

## Request example

This example uses the canonical request shape in the [POST /v3/request API reference](/api-reference/request-otp).

```bash theme={null}
curl -X POST https://api.otp.id/v3/request \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "email",
    "number": "user@example.com",
    "brand": "TokoKita",
    "ttl": 300
  }'
```

## What your UI should do

* Use a single OTP input or six separate digit boxes so the user can enter the code quickly.
* Show a resend action, but only after your own cooldown expires.
* Show the expiry time clearly so the user knows when the current code stops working.
* If delivery fails, tell the user to request a new code instead of assuming the message is still on the way.
* Keep the verification action near the input so the user can finish the flow without leaving the screen.

## Related pages

* [Send OTP with WhatsApp, SMS, Email, or Missed Call](/guides/send-otp)
* [Verify a One-Time Password](/guides/verify-otp)
* [POST /v3/request reference](/api-reference/request-otp)
* [POST /v3/send reference](/api-reference/send-otp)
