# Update an account

`PUT https://app.shuttleglobal.com/c/api/instances/{instance_key}/accounts/{account_id}`

Update an existing account's details. You can address the account by its ID or `crm_key`.

## Authentication

- basicAuth: Basic Authentication using secret key
- bearerAuth: OAuth 2.0 Bearer Token Authentication

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `account_id` | path | string | yes | The account's ID (`acc_...`), or its `crm_key`. If more than one account has that `crm_key`, the most recently updated one is used. |

## Request body (`application/json`), required

- `account` (object, required)
  - `address` (object): Address fields. All fields are optional and any values are accepted to prevent interrupting payments due to address validation issues. Field behavior: 1. When updating an address, the entire address object is replaced with the new values 2. To clear/null out all address fields, set each field to an empty string Client applications can implement their own validation if needed.
    - `country` (string): Country code (any format accepted). Set to empty string to clear.
    - `line1` (string): First line of the address. Set to empty string to clear.
    - `line2` (string): Second line of the address. Set to empty string to clear.
    - `line3` (string): Third line of the address. Set to empty string to clear.
    - `line4` (string): City/Town. Set to empty string to clear.
    - `line5` (string): Postcode/ZIP. Set to empty string to clear.
    - `line6` (string): State/Region. Set to empty string to clear.
  - `company` (string): Company name
  - `email` (string): Email address. Invalid addresses are accepted to prevent interrupting payments due to email validation issues. Client applications can implement their own validation if needed.
  - `first_name` (string): First name of the account holder
  - `last_name` (string): Last name of the account holder
  - `locale` (string): Locale of the user
  - `metadata` (object): Custom key-value pairs stored on the account
  - `phone` (string): Phone number. Any format is accepted to prevent interrupting payments due to phone validation issues. Client applications can implement their own validation if needed.
  - `tags` (string): CSV of tags/references for searching
  - `timezone` (string): Timezone in IANA format

## Responses

### 200: Updated account

```json
{
  "account": {
    "address": {
      "country": "string",
      "line1": "string",
      "line2": "string",
      "line3": "string",
      "line4": "string",
      "line5": "string",
      "line6": "string"
    },
    "bolton_values": {},
    "channels": [
      "string"
    ],
    "code": "string",
    "company": "string",
    "created": "2026-01-01T12:00:00Z",
    "created_session": "string",
    "crm": "string",
    "crm_key": "string",
    "disconnected_account": true,
    "divisions": [
      "string"
    ],
    "email": "string",
    "first_name": "string",
    "full_address": "string",
    "giftaid_ineligible": true,
    "id": "string",
    "initiatives": [
      "string"
    ],
    "last_name": "string",
    "last_transacted": "2026-01-01T12:00:00Z",
    "last_transaction": "string",
    "locale": "string",
    "metadata": {},
    "name": "string",
    "phone": "string",
    "status": "ACTIVE",
    "tags": "string",
    "timezone": "string",
    "updated": "2026-01-01T12:00:00Z",
    "updated_session": "string",
    "v": 0
  }
}
```

### 400: Bad request

```json
{
  "code": "string",
  "message": "string"
}
```

### 401: Invalid credentials (authentication is validated before instance key)

```json
{
  "code": "UNAUTHORIZED",
  "message": "Unauthorised"
}
```

### 404: Instance not found (only checked after successful authentication)

```json
{
  "code": "string",
  "message": "string"
}
```

## Example request

```sh
curl --request PUT \
  --url https://app.shuttleglobal.com/c/api/instances/YOUR_INSTANCE_KEY/accounts/ACCOUNT_ID \
  --header 'Authorization: Basic <base64 of SECRET_KEY:>' \
  --header 'Content-Type: application/json' \
  --data '{
  "account": {}
}'
```

Reference page: https://docs.shuttleglobal.com/platforms/reference/operations/updateaccount/