> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pacifica.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Disable Two-Factor Authentication

> This endpoint allows users to turn off two-factor authentication and delete every factor and recovery key.

```http theme={null}
POST /api/v1/account/2fa/disable
```

Turns off [two-factor authentication](https://docs.pacifica.fi/api-documentation/api/rest-api/two-factor). Pacifica deletes every factor and every recovery key on the account. After that, withdrawals and factor changes do not need a proof.

#### Operation Type (for Signing)

| Header Field | Type | Content |
| - | - | - |
| `"type"` | string | `"disable_two_factor"` |

#### Request Body

<table><thead><tr><th width="176">Field</th><th width="98">Type</th><th width="95">Need</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>`"account"`</td><td>string</td><td>required</td><td>User's wallet address</td><td>`42trU9A5...`</td></tr><tr><td>`"signature"`</td><td>string</td><td>required</td><td>Cryptographic signature</td><td>`5j1Vy9Uq...`</td></tr><tr><td>`"timestamp"`</td><td>integer</td><td>required</td><td>Current timestamp in milliseconds</td><td>`1716200000000`</td></tr><tr><td>`"proof"`</td><td>object</td><td>required</td><td>Proof. A recovery key works. Not part of the signed payload. See [Proofs](https://docs.pacifica.fi/api-documentation/api/rest-api/two-factor#proofs)</td><td>`{"type": "totp", "code": "123456"}`</td></tr><tr><td>`"expiry_window"`</td><td>integer</td><td>optional</td><td>Signature expiry in milliseconds</td><td>`30000`</td></tr></tbody></table>

```json theme={null}
{
  "account": "42trU9A5...",
  "signature": "5j1Vy9Uq...",
  "timestamp": 1716200000000,
  "proof": {
    "type": "totp",
    "code": "123456"
  },
  "expiry_window": 30000
}
```

Sign this request with the account's own key. Agent wallets cannot sign it. The account must be a main account.

This call also ends every enrollment in progress. To turn 2FA on again, enroll a new factor. Your first new factor comes with a new set of recovery keys.

#### Signing

The `data` object is empty. Do not sign `proof`. For the request above, the message to sign is:

```json theme={null}
{"data":{},"expiry_window":30000,"timestamp":1716200000000,"type":"disable_two_factor"}
```

#### Response

* Status 200: Two-factor authentication turned off

```json theme={null}
{
  "success": true,
  "data": null,
  "error": null,
  "code": null
}
```

* Status 400: Invalid request parameters or signature
* Status 401: The proof is wrong, expired, or already used
* Status 403: The account is a subaccount, or it does not exist
* Status 422: The account has never started an enrollment (`set up two-factor authentication before continuing`)
* Status 429: Too many proof attempts
* Status 500: Internal server error
* Status 503: The two-factor service is unavailable. Retry later

#### Code Example (Python)

```python theme={null}
import requests

payload = {
    "account": "42trU9A5...",
    "signature": "5j1Vy9Uq...",
    "timestamp": 1716200000000,
    "proof": {"type": "totp", "code": "123456"}
}

response = requests.post(
    "/api/v1/account/2fa/disable",
    json=payload,
    headers={"Content-Type": "application/json"}
)

data = response.json()
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.