Update member's communication channel consent preferences
PUT /api/members/{memberId}/communication-channels
- 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)
Overview
Sets which communication channels — for example email, SMS, telephone or post — a member has agreed to be contacted through.
This is a full replacement, not an incremental opt-in. Every channel consent the member currently holds is deleted and the list is recreated from your request. Send the member's complete set of channels on every call; anything you leave out is withdrawn. Omitting channelPreferences altogether, or sending [], removes all of the member's channel consents. Campaign consents are managed separately and are not touched by this call.
There are two mutually exclusive ways to call it:
- Name the channels. Leave
optInForAllCommunicationChannelsConfiguredasfalseand list the channel ids inchannelPreferences. - Opt in to everything configured. Set
optInForAllCommunicationChannelsConfiguredtotrueand omitchannelPreferencesentirely. Sending both — including an empty array alongsidetrue— is rejected with400. The member is then consented to exactly the channels in the tenant's join-time opt-in configuration forsiteId.
As with campaign consent, a member younger than the tenant's configured age of consent returns 204 No Content and nothing is written. There is no error to signal this, so check the member's date of birth if the outcome matters.
Linked members are permitted — a token issued for a member linked to {memberId} may call this endpoint.
Endpoint
PUT {base_url}/api/members/{memberId}/communication-channels
{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
memberId | integer (int32) | Yes | The member whose channel consents are replaced. Must match the member id in your access token, or be a member linked to it. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
siteId | string | No | The centre whose join-time opt-in configuration is read when optInForAllCommunicationChannelsConfigured is true. Maximum 15 characters. Ignored when you list the channels yourself. Omit it to fall back to the tenant-wide configuration value. |
optInForAllCommunicationChannelsConfigured | boolean | No | Consent the member to every channel named in the tenant's join opt-in configuration instead of listing them yourself. Defaults to false when omitted. When true, channelPreferences must be absent, and the call fails with 422 if that configuration is missing or names channels that do not exist. |
channelPreferences | array of string | No | The complete set of channel ids the member consents to — each id maximum 50 characters, and each must be a configured channel. Retrieve valid ids from Get all configured communication channels. Omitting the field, or sending [], withdraws all existing channel consents. Must be absent when optInForAllCommunicationChannelsConfigured is true. An empty string in the array is rejected. |
Sample request
curl -X PUT '{base_url}/api/members/{memberId}/communication-channels' \
-H 'Authorization: Bearer {accessToken}' \
-H 'X-Use-SSO: true' \
-H 'Content-Type: application/json' \
-d '{
"siteId": "string",
"optInForAllCommunicationChannelsConfigured": false,
"channelPreferences": [
"EMAIL"
]
}'Errors
A successful call returns 204 No Content — including the silent no-op for junior members described in the Overview.
| Status | Meaning | When |
|---|---|---|
400 | Bad request | optInForAllCommunicationChannelsConfigured is true and channelPreferences is present, even as an empty array: When opting for allocating all configured communication channels to a member, the channel preferences does not need to be set. |
400 | Bad request | An entry in channelPreferences is an empty string: An empty channel ID cannot be entered |
400 | Bad request | An entry is longer than 50 characters: The channel ID is greater than 50 characters. [ChannelId: {channelId}] |
400 | Bad request | An entry is not a configured channel: The channel ID is not valid. [ChannelId: {channelId}] |
400 | Bad request | siteId exceeds 15 characters: The maximum length for Site Identifier is 15 characters. Returned as a validation error object keyed by field name rather than a plain string. |
404 | Not found | No member exists with that id: The given member doesn't exist. [MemberId: {memberId}] |
409 | Conflict | Not returned by this endpoint. |
422 | Unprocessable entity | optInForAllCommunicationChannelsConfigured is true but the tenant has no join opt-in configuration, or it names channels that do not exist: No configuration value was found for the configuration key or the value does not match with the communication channels found. [ConfigurationKey: …] |
500 | Internal server error | The update could not be saved, or another unexpected server-side failure occurred. No detail is returned in the body. |