# Update member address details

`PUT /api/members/{memberId}/addresses`

- **Products:** Operator (`FOH`), Consumer (`CONSUMER`) (any one of these products, not all)
- **Features:** Online Bookings (`ONLINEBOOK`), Online Joining (`ONLINEJOIN`), Front of House Generic Access (`FOHGENERIC`) (any one of these features, not all)

HTML version: [Update member address details](https://support.gladstonesoftware.cloud/reference/members/update-member-address-details)

## Overview

Updates the two postal addresses held against a member. `address1` is the member's home address and `address2` is their work address; there are no other address slots, despite what the field names might suggest.

Understand the update semantics before you call this, because they are unusual:

- **Omitting an address object entirely** (`address1` or `address2` absent) leaves that address untouched.
- **Including an address object replaces the whole address.** Each line you leave out of an included object is treated as an empty string and **wipes the stored value**, because the fields default to empty rather than null on the server. Always send the complete address, including the lines you are not changing.
- **Sending an explicit `null` for an individual line inside an included address object causes a `500`.** Send an empty string if you mean "blank".

Only `isPrimary` behaves as a true partial field: omit it on both addresses and the member's existing primary designation is preserved.

Linked members are permitted — a token issued for a member linked to `{memberId}` may call this endpoint.

## Endpoint

`PUT {base_url}/api/members/{memberId}/addresses`

`{base_url}` is the environment URL issued to your integration. See [Authenticating with Gladstone APIs](../../guides/authenticating-with-gladstone-apis.md).

## Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `memberId` | integer (int32) | Yes | The member whose addresses are updated. Must match the member id in your access token, or be a member linked to it. |

## Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `address1` | object | No | The member's home address. Omit to leave the home address exactly as it is. If you include it, send every line — any line you leave out is written as an empty string and clears the stored value. |
| `address1.addressLine1` | string | No | First line of the home address (house name or number), maximum 75 characters. |
| `address1.addressLine2` | string | No | Second line of the home address (street), maximum 75 characters. |
| `address1.addressLine3` | string | No | Third line of the home address (locality), maximum 75 characters. |
| `address1.townCity` | string | No | Town or city of the home address, maximum 75 characters. |
| `address1.region` | string | No | County, state or region of the home address, maximum 75 characters. |
| `address1.postalCode` | string | No | Postcode or ZIP code of the home address, maximum 25 characters. No format check is applied, so any string within the limit is accepted. |
| `address1.country` | string | No | Country of the home address, maximum 25 characters. Free text — it is not validated against a country list. |
| `address1.isPrimary` | boolean | No | Which of the two addresses is the member's primary one. `true` makes the home address primary; `false` makes the **work address** primary instead, so do not send `false` merely to mean "leave it alone" — omit the field for that. Sending `true` on both addresses is rejected with `400`. A home address that is primary must not be completely blank. |
| `address2` | object | No | The member's work address. Omit to leave the work address exactly as it is. The same all-or-nothing replacement rule as `address1` applies. |
| `address2.addressLine1` | string | No | First line of the work address (building name or number), maximum 75 characters. |
| `address2.addressLine2` | string | No | Second line of the work address (street), maximum 75 characters. |
| `address2.addressLine3` | string | No | Third line of the work address (locality), maximum 75 characters. |
| `address2.townCity` | string | No | Town or city of the work address, maximum 75 characters. |
| `address2.region` | string | No | County, state or region of the work address, maximum 75 characters. |
| `address2.postalCode` | string | No | Postcode or ZIP code of the work address, maximum 25 characters. |
| `address2.country` | string | No | Country of the work address, maximum 25 characters. Free text. |
| `address2.isPrimary` | boolean | No | `true` makes the work address primary; `false` makes the **home address** primary. Applied after `address1.isPrimary`, so if both objects carry the flag, `address2` wins. Sending `true` on both addresses is rejected with `400`. A work address that is primary must not be completely blank. |

## Sample request

```bash title="cURL"
curl -X PUT '{base_url}/api/members/{memberId}/addresses' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "address1": {
    "addressLine1": "string",
    "addressLine2": "string",
    "addressLine3": "string",
    "townCity": "string",
    "region": "string",
    "postalCode": "string",
    "country": "string",
    "isPrimary": true
  },
  "address2": {
    "addressLine1": "string",
    "addressLine2": "string",
    "addressLine3": "string",
    "townCity": "string",
    "region": "string",
    "postalCode": "string",
    "country": "string",
    "isPrimary": true
  }
}'
```

## Errors

A successful call returns `204 No Content`.

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | Both addresses claim to be primary: `Only one of the given addresses can be marked as primary` |
| `400` | Bad request | The address you marked primary has every line blank: `Cannot have a primary address with empty values` |
| `400` | Bad request | A field breaches its length limit — for example `AddressLine1 cannot be more than 75 characters`, `PostalCode cannot be more than 25 characters`. Returned as a model-state object rather than a plain string. |
| `404` | Not found | No member exists with that id: `Member with ID {memberId} does not exist` |
| `500` | Internal server error | An individual address line was sent as an explicit JSON `null` inside an included address object, or the change could not be saved. No detail is returned in the body. |
