# List all of a member's addresses

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

- **Success:** `200 OK`
- **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: [List all of a member's addresses](https://support.gladstonesoftware.cloud/reference/members/list-all-of-a-members-addresses)

## Overview

Returns the addresses held against a member. A member record has exactly two address slots and no more: `address1` is the member's home address and `address2` is their work address. There is no address-type field to read and no way to add a third address — the slots are positional, and their meaning comes from which one you are looking at.

Both objects are always present in a 200 response, even for a member with nothing recorded. An empty slot is returned as an object whose lines are all null, not as an omitted or null `address1`/`address2`. Test for content by inspecting the lines; do not test for the presence of the key.

Access is checked against the token: the member id in the route must be the member the token was issued for, or a member linked to them. Requesting someone else's addresses returns 403 rather than an empty result.

## Endpoint

`GET {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 you want. Must be the member your token was issued for, or one linked to them. A member id that does not exist returns 404; `0`, a non-member record or a purged record returns 400. |

## Sample request

```bash title="cURL"
curl -X GET '{base_url}/api/members/{memberId}/addresses' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `address1` | object | The member's home address. Always present in the response — when the member has no home address recorded, the object is returned with every line null. |
| `address1.addressLine1` | string | First line of the home address: the property — typically the house name or number. Null when not recorded. |
| `address1.addressLine2` | string | Second line of the home address: the street. Null when not recorded. |
| `address1.addressLine3` | string | Third line of the home address: the locality — the district or village below town level. Null when not recorded. |
| `address1.townCity` | string | Town or city of the home address. Null when not recorded. |
| `address1.region` | string | County, state or equivalent region of the home address. Null when not recorded. |
| `address1.postalCode` | string | Postcode or ZIP code of the home address. Null when not recorded. Free text: no format is enforced, so do not assume a valid postcode. |
| `address1.country` | string | Country of the home address. Null when not recorded. |
| `address1.isPrimary` | boolean | True when address1 is the member's chosen primary address — the address to use for correspondence. A member has a single primary-address choice, so at most one of `address1` and `address2` can be true, and both are false when no primary address has been chosen. Do not assume the home address is primary by default. |
| `address2` | object | The member's work address. Always present in the response — when the member has no work address recorded, the object is returned with every line null. |
| `address2.addressLine1` | string | First line of the work address: the property — typically the house name or number. Null when not recorded. |
| `address2.addressLine2` | string | Second line of the work address: the street. Null when not recorded. |
| `address2.addressLine3` | string | Third line of the work address: the locality — the district or village below town level. Null when not recorded. |
| `address2.townCity` | string | Town or city of the work address. Null when not recorded. |
| `address2.region` | string | County, state or equivalent region of the work address. Null when not recorded. |
| `address2.postalCode` | string | Postcode or ZIP code of the work address. Null when not recorded. Free text: no format is enforced, so do not assume a valid postcode. |
| `address2.country` | string | Country of the work address. Null when not recorded. |
| `address2.isPrimary` | boolean | True when address2 is the member's chosen primary address — the address to use for correspondence. A member has a single primary-address choice, so at most one of `address1` and `address2` can be true, and both are false when no primary address has been chosen. Do not assume the home address is primary by default. |

## Sample response

```json title="200 OK"
{
  "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

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | The id is not a usable member record. A non-member record is rejected with `0 is an invalid member ID`; a purged member record is also rejected with 400. |
| `404` | Not found | MemberId does not exist. |
| `500` | Internal server error | |
