Update member's communication channel consent preferences

PUT /api/members/{memberId}/communication-channels

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:

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

NameTypeRequiredDescription
memberIdinteger (int32)YesThe member whose channel consents are replaced. Must match the member id in your access token, or be a member linked to it.

Request body

FieldTypeRequiredDescription
siteIdstringNoThe 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.
optInForAllCommunicationChannelsConfiguredbooleanNoConsent 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.
channelPreferencesarray of stringNoThe 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
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.

StatusMeaningWhen
400Bad requestoptInForAllCommunicationChannelsConfigured 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.
400Bad requestAn entry in channelPreferences is an empty string: An empty channel ID cannot be entered
400Bad requestAn entry is longer than 50 characters: The channel ID is greater than 50 characters. [ChannelId: {channelId}]
400Bad requestAn entry is not a configured channel: The channel ID is not valid. [ChannelId: {channelId}]
400Bad requestsiteId 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.
404Not foundNo member exists with that id: The given member doesn't exist. [MemberId: {memberId}]
409ConflictNot returned by this endpoint.
422Unprocessable entityoptInForAllCommunicationChannelsConfigured 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: …]
500Internal server errorThe update could not be saved, or another unexpected server-side failure occurred. No detail is returned in the body.

This page as markdown · All pages · llms.txt