---
title: "Request a one-time login/signup code by email"
method: POST
path: "/auth/otp/request"
tags: ["auth"]
---

# Request a one-time login/signup code by email

`POST /auth/otp/request`

## Request

- Base URL: `https://mbag.ai/api`
- URL: `https://mbag.ai/api/auth/otp/request`
- Auth: none required

Issues a 6-digit code (10-minute expiry) and emails it to the given
address. Signing in is signing up: the first successful verify for a
new email provisions a user and a free-tier welcome mailbox. Rate
limited to 5 requests per email per rolling 15-minute window.

## Request body

- object
  - `email` string, required

## Response `200`

Code issued and emailed. Body is always an empty object.

- object

## Other responses

- `400`: `email` does not contain an `@`.
- `429`: Too many recent requests for this email (5 per 15 minutes).
- `500`: Failed to issue or send the code. Body is an empty object.

---

[API](https://skmtc.dev/mailbuttons/apis/mailbuttons-agent-mail-api.md) · [All operations](https://skmtc.dev/mailbuttons/apis/mailbuttons-agent-mail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mailbuttons/apis/mailbuttons-agent-mail-api/revisions/fe2761823978?raw)
