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

# Update Account

<mark style="color:purple;">`PATCH`</mark> `/api/v2/directory/accounts/{reference_id}`

This endpoint is utilized to modify/update the details of a specific account identified by `reference_id`.

**Path Parameters**

<table><thead><tr><th width="142">Name</th><th width="102">Type</th><th width="375">Description</th><th>Required</th></tr></thead><tbody><tr><td><code>reference_id</code></td><td>string</td><td>Unique identifier for the account, previously external_id. Example: <mark style="color:orange;"><code>transfer7890</code></mark></td><td>True</td></tr></tbody></table>

**Body**

<table><thead><tr><th width="142">Name</th><th width="102">Type</th><th width="375">Description</th><th>Required</th></tr></thead><tbody><tr><td><code>field</code></td><td>array</td><td>The name of the field to be updated. Examples:  <mark style="color:orange;"><code>individual</code></mark>, <mark style="color:orange;"><code>individual_name</code></mark>, <mark style="color:orange;"><code>name_first</code></mark></td><td>True</td></tr><tr><td><code>value</code></td><td>string, integer, date</td><td>The value of the field to be updated to. Example: <mark style="color:orange;"><code>Mark</code></mark></td><td></td></tr><tr><td><code>fields</code></td><td>array</td><td>An array of the fields to be updated.</td><td></td></tr></tbody></table>

**Sample Request**&#x20;

{% tabs %}
{% tab title="Body" %}

```json
{
  "fields": [
    {
      "field": [
        "individual",
        "individual_name",
        "name_first"
      ],
      "value": "John"
    },
    {
      "field": [
        "individual",
        "individual_name",
        "name_last"
      ],
      "value": "Doe"
    },
    {
      "field": [
        "email"
      ],
      "value": "you@company.com"
    }
  ]
}
```

{% endtab %}

{% tab title="200" %}

```json
{
  "status": "success",
  "data": {
    "reference_id": "johndoe",
    "account_type": "individual",
    "email": "john@company.com",
    "individual": {
      "individual_name": {
        "name_type": "LEGL",
        "name_first": "John",
        "name_middle": "Mark",
        "name_last": "Doe"
      },
      "individual_localname": {
        "name_type": "LEGL",
        "name_first": "John",
        "name_middle": "Mark",
        "name_last": "Doe"
      },
      "date_of_birth": "1988-06-27",
      "place_of_birth": "Singapore, Singapore",
      "nationality_country": "SG",
      "residence_country": "SG"
    },
    "address": {
      "address_type": "GEOG",
      "address_line": "Apt 123",
      "address_street_no": "456",
      "address_street_name": "Elm Street",
      "address_building_name": "Elmwood Apartments",
      "address_floor": "15",
      "address_room": "1503",
      "address_department": null,
      "address_subdepartment": null,
      "address_postbox": "PO Box 789",
      "address_city_location": null,
      "address_city": "New York",
      "address_region": "New York",
      "address_district": "Manhattan",
      "address_postcode": "10001",
      "address_country_code": "US"
    },
    "created": "2024-02-26 21:57:18.000 +0800",
    "last_modified": "2024-02-27 10:37:20.000 +0800"
  }
}
```

{% endtab %}
{% endtabs %}
