# Turn off two-factor sign-in

`DELETE /api/v1/auth/totp`

Turns two-factor sign-in off with a current code from the app. Sign-in then needs only the password.

Sign-in: a dashboard session only. API tokens and OAuth sign-ins get `403 token.not_allowed`.

Section: Sign-in and account. Operation id in openapi.json: `disable_totp`.

## Request body

Required: yes.

`application/json`: CodeInput

| Field | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | Six digits from the authenticator. |

## Responses

Errors are `application/problem+json` (`Problem`); branch on `type`.

### 204

Turned off.

### 400

Bad Request.

- `request.malformed`: the body or a parameter is not of the expected shape
- `auth.credentials_conflict`: the request carries both a session cookie and a token

### 401

Unauthorized.

- `auth.unauthenticated`, `auth.session_expired`: no session, or it ended
- `token.invalid`: the token is malformed, unknown, revoked or expired, or its creator left the workspace

### 403

Forbidden.

- `auth.forbidden`: your role is too low for this
- `token.not_allowed`: this operation needs a signed-in session; tokens cannot call it
- `request.origin_mismatch`, `request.header_required`: a changing request with a session comes from another site or lacks `X-Monitorly-Request: 1`

### 409

Conflict.

- `auth.totp_not_enrolled`: TOTP is not enabled or confirmation was not started

### 413

Payload Too Large.

- `request.too_large`: the body is larger than 256 KiB

### 422

Unprocessable Entity.

- `field.required`, `field.too_long`, `field.invalid`: a field breaks a rule; `errors` points at it
- `auth.totp_invalid`: wrong TOTP code
- `auth.totp_replayed`: TOTP code for this step was already used

### 429

Too Many Requests.

- `session.rate_limited`: more than 5 changes a second from your sessions
- `auth.rate_limited`: too many failed attempts; `Retry-After` in seconds

Schemas named above are listed with their fields in [the schema list](https://docs.monitorly.cloud/api/reference/schemas.md).
