---
title: "Exchange a code for a session"
method: POST
path: "/v1/auth/verify"
tags: ["Auth"]
---

# Exchange a code for a session

`POST /v1/auth/verify`

## Request

- Base URL: `https://www.chatrail.dev`
- URL: `https://www.chatrail.dev/v1/auth/verify`
- Auth: none required

Every failure returns the same error — no code, wrong code, expired, too many attempts. Distinguishing them would reintroduce an oracle.

## Request body

- object
  - `email` string, email, required
  - `code` string, required

## Response `200`

A session cookie is set.

## Other responses

- `401`: That code is not valid.

---

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