> 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 %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ospree.io/developers/accounts-directory/update-account.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
