Skip to content

Request a Sign-In Code

Start the OTP flow and send a sign-in code to the correct email address.

Best for Human member and CLI user Updated April 3, 2026
API In this interface
4 steps Steps
1 examples Examples
Use this path when

Start the OTP flow over REST so the user receives the right sign-in or sign-up code.

What you'll finish here
  • Start the OTP flow correctly.
  • Use the correct purpose value for sign-in or sign-up.
  • Handle cooldowns and lockouts without guessing.

Where this happens

LabelValueNotes
EndpointPOST /api/v1/auth/request-otpStarts the OTP flow for a human principal.
Before you start
  • No bearer token is required for this call.

Same Task, Other Interfaces

Use the version that matches where you are working now. The subject matter stays the same; the delivery changes by surface.

Do the work

  1. 1. Send a JSON body with `email` and, optionally, `purpose`.
  2. 2. Use `signin` for an existing user flow or `signup` for a first-run flow.
  3. 3. Read the JSON response and capture the `expiresAt` value so the next step happens before the code expires.
  4. 4. If the server returns a cooldown or lockout response, wait for the provided retry window.

Keep this clear

  • A valid email address is required. Invalid or blank email input fails immediately.

Request an OTP over REST

bash
curl -X POST http://localhost:5173/api/v1/auth/request-otp   -H 'content-type: application/json'   -d '{"email":"you@example.com","purpose":"signin"}'

Keep Going in Sign In and Sessions

Stay in the same interface and move to the next closest task in this topic when needed.

Nearby Guides

These guides stay close to the current workflow so you can keep moving without restarting discovery.