---
title: "Begin 2FA enrolment — returns the otpauth URI + secret"
method: POST
path: "/api/auth/2fa/setup"
tags: ["Auth"]
---

# Begin 2FA enrolment — returns the otpauth URI + secret

`POST /api/auth/2fa/setup`

## Request

- Base URL: `https://hiveship.app/api`
- URL: `https://hiveship.app/api/api/auth/2fa/setup`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `hiveship_access`
  - HTTP bearer

## Response `200`

Pending secret created; render the QR client-side

## Other responses

- `400`: 2FA already enabled

---

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