---
title: "Sign in with email and password"
method: POST
path: "/api/v1/auth/login"
tags: ["Auth"]
---

# Sign in with email and password

`POST /api/v1/auth/login`

## Request

- Base URL: `https://otprun.com`
- URL: `https://otprun.com/api/v1/auth/login`
- Auth: none declared

Unknown email answers 401 with code no_account, a wrong password answers 401 with code wrong_password. Answers 410 with code passwords_disabled once sign-in by email code is turned on.

## Headers

- `User-Agent` string

## Request body

- LoginInputBody
  - `email` string, email, required
  - `password` string, required

## Response `200`

OK

- SessionBody
  - `access_token` string, required
  - `expires_at` string, date-time, required
  - `needs_profile` boolean, required: True until the name and workspace steps of the welcome screen are done
  - `token_type` 'Bearer', required
  - `user` AccountUserBody, required
    - `created_at` string, date-time, required
    - `email` string, nullable, required: Null for accounts created with a phone number
    - `email_verified` boolean, required: True once the email was confirmed with a code or a sign-in link
    - `has_password` boolean, required
    - `id` integer, required
    - `is_admin` boolean, required
    - `locale` string, required
    - `name` string, required: Empty until the person enters a name
    - `phone` string, nullable, required: E.164 number the account signs in with, null for email accounts
    - `public_id` string, uuid, required
  - `workspace` AccountWorkspaceBody, required
    - `created_at` string, date-time, required
    - `id` integer, required
    - `name` string, required
    - `plan` 'free' | 'starter' | 'growth' | 'scale', required
    - `role` 'owner' | 'admin' | 'developer' | 'viewer', required
    - `slug` string, required
    - `trial_ends_at` string, date-time, nullable, required

## Other responses

- `401`: Unauthorized
- `410`: Gone
- `422`: Unprocessable Entity
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/otprun/apis/otp-run-api.md) · [All operations](https://skmtc.dev/otprun/apis/otp-run-api/llms.txt) · [OpenAPI document](https://skmtc.dev/otprun/apis/otp-run-api/revisions/43d40d5f4050?raw)
