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

# Rename Factor

> This endpoint allows users to change a factor's label.

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

Changes the label of one [two-factor](https://docs.pacifica.fi/api-documentation/api/rest-api/two-factor) factor. 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).

This call needs no proof, because a label grants no access. It does not end enrollments in progress.

#### Operation Type (for Signing)

| Header Field | Type | Content |
| - | - | - |
| `"type"` | string | `"rename_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 rename</td><td>`c9f0f895-fb98-4b91-a3b5-6e9e7c2f1d4a`</td></tr><tr><td>`"label"`</td><td>string</td><td>required</td><td>New name for the factor. 1 to 64 characters, with no control characters and no leading or trailing spaces</td><td>`Phone`</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",
  "label": "Phone",
  "expiry_window": 30000
}
```

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

#### Signing

Sign `factor_id` and `label` as the `data` object. For the request above, the message to sign is:

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

#### Response

* Status 200: Factor renamed

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

* Status 400: Invalid request parameters, label, or signature
* Status 403: The account is a subaccount, or it does not exist
* Status 422: No factor on the account has this `factor_id` (`unknown factor`)
* 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",
    "label": "Phone"
}

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