Update EGYM membership type groups
PUT /api/configuration/egym/membership-type-groups
Success: 204 No Content
- Products: Operator (
FOH), Integrations (INTEGRATIONS) (any one of these products, not all) - Features: Front of House Generic Access (
FOHGENERIC),EGYMSYNC(any one of these features, not all)
Overview
Sets which membership type groups qualify members for the EGYM integration. Only members with an active membership in one of these groups, at a site enabled for EGYM, are sent to EGYM. The groups apply to every EGYM site in your tenant and govern both the initial sync and the ongoing real-time sync.
The call replaces the whole set. Any group not in the request is removed, so to add a group, read the current set with List EGYM membership type groups and send it back with the new identifier included. To remove one, send the set without it.
Sending an empty array removes every group, and is accepted even while sites are enabled for EGYM. From then on no members are sent to EGYM from any site until a group is added again. Members already at EGYM are not removed.
Every identifier is checked before anything is saved: if any is unknown, the request is rejected and the existing set is left unchanged.
Endpoint
PUT {base_url}/api/configuration/egym/membership-type-groups
{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
[] | array of string | Yes | The complete set of membership type group identifiers to enable, each the id returned by Get all membership type groups. Maximum 15 characters each. Matching ignores case and surrounding spaces; blank entries are ignored, and repeated identifiers are kept once. |
Sample request
curl -X PUT '{base_url}/api/configuration/egym/membership-type-groups' \
-H 'Authorization: Bearer {accessToken}' \
-H 'X-Use-SSO: true' \
-H 'Content-Type: application/json' \
-d '[
"FULL",
"STAFF"
]'Sample response
HTTP/1.1 204 No ContentErrors
Validation failures return a plain JSON string containing the message shown below, not a problem document. The exception is a malformed body, which returns a validation problem document (application/problem+json) with an errors map keyed by field name. In every 400 case, the existing set is left unchanged.
| Status | Meaning | When |
|---|---|---|
400 | Bad request | The body is missing, is not valid JSON, or is not an array of strings. Returned as a validation problem document. |
400 | Bad request | An identifier is longer than 15 characters — Group id '{groupId}' exceeds the maximum length of 15 characters. |
400 | Bad request | One identifier is not a membership type group in your tenant — Group id '{groupId}' does not exist. |
400 | Bad request | Several identifiers are unknown. All of them are named — Group ids '{groupId}', '{groupId}' do not exist. |
401 | Unauthorised | The Authorization header is missing or the token is invalid or expired. |
403 | Forbidden | The token is a member or anonymous token, or does not carry the products or features this endpoint requires. |
500 | Internal server error | An unexpected server-side failure. The body is empty. The call replaces the set, so it is safe to retry with the same body. |