---
title: "Verify email OTP"
method: POST
path: "/auth/otp/verify"
tags: ["auth"]
---

# Verify email OTP

`POST /auth/otp/verify`

## Request

- Base URL: `https://www.dench.com/api/v1`
- URL: `https://www.dench.com/api/v1/auth/otp/verify`
- Auth: none declared

Verify an email OTP sign-in code.

## Request body

- object
  - `email` string, required
  - `code` string, required: 6+ digit code from the email.
  - `agentName` string, required
  - `agentKind` string, required
  - `sessionTokenHash` string, required: sha256 hex of the local session token.
  - `intent` 'join_existing' | 'create_workspace', required: Whether to join an existing workspace or create a new one.
  - `proposedOrganizationName` string
  - `organizationSelector` string
  - `userAgent` string

## Response `200`

Successful response

- object
  - `ok` boolean, required
  - `result` union, required
    - object
      - `kind` 'completed', required
      - `organization` object
        - `id` string, required
        - `name` string, required
        - `slug` string, required
      - `sessionExpiresAt` number
    - object
      - `kind` 'requiresOrgChoice', required
      - `authToken` string, required: Pass to /auth/otp/finalize with the chosen org.
      - `organizations` object[], required
        - `id` string, required
        - `name` string, required
        - `slug` string, required
      - `expiresAt` number, required

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid authentication
- `404`: Operation or resource not found
- `500`: Server error

---

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