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

# Sign in with email + password

`POST /v1/auth/login`

## Request

- Base URL: `https://api.stackdata.io`
- URL: `https://api.stackdata.io/v1/auth/login`
- Auth: one of:
  - none
  - API key in header `X-API-Key`

## Request body

- object
  - `email` string, email, required
  - `password` string, required

## Response `200`

Signed in.

- AuthSession: Returned by register/login. The `session` token also arrives as an httpOnly cookie.
  - `user` User: The signed-in user. Never includes the password hash or raw session.
    - `id` string
    - `nickname` string
    - `email` string: May be null for an OAuth-only account.
    - `email_verified` boolean
    - `avatar_seed` string: Seed for GET /v1/avatar/{seed}.
    - `has_password` boolean
    - `tier` string
    - `default_visibility` 'public' | 'private'
    - `providers` string[]: Linked OAuth providers.
    - `created_at` string
  - `session` string: Bearer token — send as Authorization for cross-origin calls.
  - `verify_token_dev` string: Dev-only — the email-verification token, present on non-https hosts since no mailer is wired.

## Other responses

- `401`: Wrong email or password.
- `403`: Account not yet verified — `code` is `email_unverified`.

---

[API](https://skmtc.dev/stackdata/apis/stackdata-api.md) · [All operations](https://skmtc.dev/stackdata/apis/stackdata-api/llms.txt) · [OpenAPI document](https://skmtc.dev/stackdata/apis/stackdata-api/revisions/91358ae3f6e8?raw)
