# Update member user fields

`PUT /api/members/{memberId}/user-fields`

- **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 user fields](https://support.gladstonesoftware.cloud/reference/members/update-member-user-fields)

## Overview

Sets the values of a member's user fields — the custom fields each tenant defines for itself, such as a referral source, a locker number or a linked staff member. The field definitions live in configuration, not here; list them with [Get all user field configurations](../configuration/get-all-user-field-configurations.md) and read a member's current values with [List all of a member's user fields](list-all-of-a-members-user-fields.md).

**This is a merge, not a replacement.** Only the fields you send are written; a field the member already has and you do not mention keeps its value. Send an array containing just the fields you are changing.

The type of each field is taken from its configuration, and `value` is validated against that type before anything is written:

| Field type | What to send in `value` |
|---|---|
| Free format | A string. |
| Hyperlink | A string. |
| Options | A string matching one of the field's configured option descriptions, compared case-insensitively. The option's description — not its id — is what gets stored. |
| Date | An ISO 8601 date or date-time string, such as `2026-03-14` or `2026-03-14T10:30:00Z`. `14/03/2026` is rejected. |
| Numeric | A number. |
| Currency | A decimal number, without a currency symbol. |
| Member | A member id, which must exist. |
| User | A staff username, which must exist. |

**Clearing a value only works for free-format and hyperlink fields**, by sending `""` — the value is then deleted. Sending `""` for any other type is rejected with `400`. There is no way to clear a date, numeric, currency, member or options value through this endpoint.

The whole array is validated before anything is saved, so one bad entry rejects the entire request and nothing is written. Values are normalised when saved — dates to `dd/MM/yyyy`, currency and numerics to invariant formatting — so what you read back may not be byte-identical to what you sent.

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

## Endpoint

`PUT {base_url}/api/members/{memberId}/user-fields`

`{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 user field values are written. Must match the member id in your access token, or be a member linked to it. A member that does not exist returns `404` — but only after every value in the array has passed validation. |

## Request body

The body is a JSON array. An empty array is accepted and changes nothing.

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `[].userFieldId` | integer (int32) | Yes | The id of the user field being set, from [Get all user field configurations](../configuration/get-all-user-field-configurations.md). It determines how `value` is interpreted. An id with no matching configuration is rejected with `400`, and the same id must not appear twice in one request. |
| `[].value` | string | Yes | The value to store, sent as whatever JSON type the field's configured type expects — see the table in the Overview; it is not always a string. `""` deletes the value for free-format and hyperlink fields and is rejected for every other type. |

## Sample request

```bash title="cURL"
curl -X PUT '{base_url}/api/members/{memberId}/user-fields' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "userFieldId": 12345,
    "value": "Referred by a friend"
  }
]'
```

## Errors

A successful call returns `204 No Content`. Validation is all-or-nothing: if any entry fails, no entry is written.

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | The same `userFieldId` appears more than once: `One or more of the request objects contained duplicated user field IDs` |
| `400` | Bad request | The field id is not configured for this tenant: `There is no user field that matches the ID: {userFieldId}` |
| `400` | Bad request | A date value is not ISO 8601: `The given date of: {value} is not in a valid ISO date format` |
| `400` | Bad request | A numeric or currency value will not parse: `The given value of: {value} for user field {userFieldId} is not a valid decimal` |
| `400` | Bad request | An options value is not one of the field's configured options: `The given value of: {value} is not a valid option for the user field ID {userFieldId}` |
| `400` | Bad request | A member-type field points at a member that does not exist: `The given value of {value} does not match any member` |
| `400` | Bad request | A user-type field names a staff user that does not exist: `The given value of {value} does not match any user` |
| `404` | Not found | No member exists with that id: `No member could be found with the member ID of: {memberId}` |
| `500` | Internal server error | The update could not be saved, or another unexpected server-side failure occurred. No detail is returned in the body. |
