> For the complete documentation index, see [llms.txt](https://docs.delos.financial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.delos.financial/accounts/update-account.md).

# Update Account

Updates an existing account's properties, including its name, default flag, and status. Returns the updated account details.

**Endpoint**

<kbd>`PATCH`</kbd>`/v2/account/{id}`

**Link**

{% embed url="<https://partner.sandbox.delos.financial/openapi/v2.html#/operations/Accounts_UpdateAccount>" %}

### **Request**

#### **Path Parameters**

<table><thead><tr><th>Parameter</th><th>Type</th><th>Description</th><th width="108">Required</th><th>Example</th></tr></thead><tbody><tr><td><strong><code>id</code></strong></td><td><code>string</code></td><td><strong>Account ID</strong> to update.</td><td>Yes</td><td><code>"UhcPVBEpjmtR"</code></td></tr></tbody></table>

#### **Headers**

| Key             | Value              | Required |
| --------------- | ------------------ | -------- |
| `Authorization` | `<JWT>`            | Yes      |
| `Content-Type`  | `application/json` | Yes      |
| `Accept`        | `application/json` | Yes      |

#### **Request Body (JSON)**

All fields are optional - only include the fields you want to update.

| Field             | Type      | Description & Values                                                                                                                                                                                                        | Example              |
| ----------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
| **`name`**        | `string`  | New account name.                                                                                                                                                                                                           | `"New Account Name"` |
| **`currencyIso`** | `string`  | New currency code (ISO 4217, e.g., `USD`).                                                                                                                                                                                  | `"EUR"`              |
| **`isDefault`**   | `boolean` | Set as default account (`true`/`false`).                                                                                                                                                                                    | `true`               |
| **`status`**      | `string`  | <p>New account status:<br>- <code>NEW</code><br>- <code>PRE\_MODERATION</code><br>- <code>MODERATION</code><br>- <code>ACCEPTED</code><br>- <code>REJECTED</code><br>- <code>BANNED</code><br>- <code>PROCESSING</code></p> | `"ACCEPTED"`         |

**Example Request Body:**

json

```
{
  "name": "Updated Business Account",
  "isDefault": true,
  "status": "ACCEPTED"
}
```

***

### **Response (200 OK)**

Returns the updated `Account entity v2` object in JSON format (same structure as Get Account by ID).

#### **Key Response Fields**

* **`name`**: Updated account name
* **`currencyIso`**: Updated currency (if changed)
* **`isDefault`**: New default status
* **`status`**: Updated account status
* **`updatedAt`**: New timestamp reflecting update time

**Example Response:**

json

```
{
  "item": {
    "id": "UhcPVBEpjmtR",
    "name": "Updated Business Account",
    "isDefault": true,
    "status": "ACCEPTED",
    "currencyIso": "USD",
    "updatedAt": "2024-05-21T09:15:00Z",
    // Other fields unchanged...
  }
}
```

### Error Cases

1. **Invalid Status Transition**:

   json

   ```
   { "error": "Cannot change status from REJECTED to ACCEPTED" }
   ```
2. **Currency Change Restrictions**:

   json

   ```
   { "error": "Currency cannot be modified after account creation" }
   ```
3. **Account Not Found**:

   json

   ```
   { "error": "Account ID not found" }
   ```

***

### **Notes**

* **Partial Updates**: Only included fields are modified; omitted fields remain unchanged.
* **Immutable Fields**: Some fields (e.g., `customerId`) cannot be updated.
* **Status Flow**: Ensure valid status transitions (e.g., `NEW` → `ACCEPTED` is valid, but `BANNED` → `ACCEPTED` may be blocked).

### Examples

**Real request**&#x20;

```postman_json
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE2NCwiZXhwIjoxNzYzNTQ3ODk4LCJrZXkiOiI1Y2ZiOGZjN2RmYjk4ZjVkYmIyZTgwNTVkZWFhN2U2Zjk4MzEyYmE3Iiwib3RwX3ZlcmlmaWVkIjpmYWxzZX0.p4m7Y6i9wSCYm6iVUsqMWD1-idNinUgqDiMn-4E9Uts
accountId*: UrpI6jMzHnsP

{
  "customerId": "D7k3xbc-ERrj-lde9k1t3XuaE",
  "name": "USDT ERC20 1",
  "currencyCode": "USDT_ERC20",
  "isDefault": true,
  "status": "NEW"
}

```

**Real response**&#x20;

200 OK

```postman_json
{
  "item": {
    "accountId": "UrpI6jMzHnsP",
    "customer": {
      "id": "",
      "name": "",
      "email": "",
      "phone": "",
      "status": "NEW",
      "customerType": "CORPORATE"
    },
    "isDefault": true,
    "name": "USDT ERC20 1",
    "status": "NEW",
    "balance": {
      "balance": {
        "money": {
          "currencyCode": "USDT_ERC20",
          "units": "0",
          "nanos": 0
        },
        "default": {
          "currencyCode": "USD",
          "units": "0",
          "nanos": 0
        }
      },
      "hold": {
        "money": {
          "currencyCode": "USDT_ERC20",
          "units": "0",
          "nanos": 0
        },
        "default": {
          "currencyCode": "USD",
          "units": "0",
          "nanos": 0
        }
      }
    },
    "currencyCode": "USDT_ERC20",
    "requisites": [],
    "createdAt": "0001-01-01T00:00:00Z",
    "updatedAt": "0001-01-01T00:00:00Z"
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.delos.financial/accounts/update-account.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
