> ## 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.

# Remove Factor

> This endpoint allows users to remove one factor.

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

Removes one [two-factor](https://docs.pacifica.fi/api-documentation/api/rest-api/two-factor) factor. Your other factors and your recovery keys stay. To get factor IDs, call [Get two-factor status](https://docs.pacifica.fi/api-documentation/api/rest-api/two-factor/get-two-factor-status.md).

You cannot remove the last factor. To remove it, [disable two-factor authentication](https://docs.pacifica.fi/api-documentation/api/rest-api/two-factor/disable-two-factor.md).

#### Operation Type (for Signing)

| Header Field | Type | Content |
| - | - | - |
| `"type"` | string | `"remove_two_factor_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>`"factor_id"`</td><td>string</td><td>required</td><td>ID (UUID) of the factor to remove</td><td>`c9f0f895-fb98-4b91-a3b5-6e9e7c2f1d4a`</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,
  "factor_id": "c9f0f895-fb98-4b91-a3b5-6e9e7c2f1d4a",
  "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.

Pacifica checks that the factor exists and is not the last one before it checks the proof. A request that fails these checks does not use up your proof.

This call also ends every enrollment in progress.

#### Signing

Sign `factor_id` as the `data` object. Do not sign `proof`. For the request above, the message to sign is:

```json theme={null}
{"data":{"factor_id":"c9f0f895-fb98-4b91-a3b5-6e9e7c2f1d4a"},"expiry_window":30000,"timestamp":1716200000000,"type":"remove_two_factor_factor"}
```

#### Response

* Status 200: Factor removed

```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 factor cannot be removed. The `error` field says why:

| `error` | Meaning |
| - | - |
| `the last factor cannot be removed. Disable two-factor instead.` | This is the account's only factor |
| `unknown factor` | No factor on the account has this `factor_id` |
| `two-factor is not enabled` | 2FA is off |

* 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,
    "factor_id": "c9f0f895-fb98-4b91-a3b5-6e9e7c2f1d4a",
    "proof": {"type": "totp", "code": "123456"}
}

response = requests.post(
    "/api/v1/account/2fa/factors/remove",
    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.