Create membership type group

POST /api/configuration/membership-type-groups

Success: 201 Created

Overview

Creates a membership type group — a named bucket that membership types are sorted into, so that configuration which applies to a whole family of memberships (access-control questions, add-on entitlements and cross-sell restrictions) can be attached to the group instead of to every membership type individually.

A successful call returns 201 with the new group's identifier as a bare JSON string in the body, for example "MEMTG0000000001". Take the identifier from the body: the Location header on this response is set to the literal text CreateMembershipTypeGroup rather than a URL, so it will not resolve to anything.

You decide whether you choose the identifier or the system does, and that choice determines what a retry does. Supply id and the call is safely repeatable — a second request with the same id is rejected with 409 and nothing is written. Omit id and the system allocates the next free code in the MEMTG sequence on every attempt, so retrying after a timeout leaves you with two groups that differ only by generated code. Only the id is unique; two groups may carry the same description.

This endpoint creates the group and nothing else — the request body has no membership type list, so a new group starts empty. The group is visible to Get all membership type groups and Get membership type group by id immediately.

One thing to know before you consume group identifiers elsewhere: a group id is not interchangeable with the membership type ids inside it, and most APIs that filter by membership type will not expand a group for you. Resolve the group to its members with Get membership types by membership type groups and pass the individual type ids on.

Endpoint

POST {base_url}/api/configuration/membership-type-groups

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Request body

FieldTypeRequiredDescription
idstringNoThe group's code, unique within your tenant and quoted wherever the group is referenced. Maximum 15 characters. Omit it or send an empty string and the system generates the next code in the sequence MEMTG followed by 10 digits, for example MEMTG0000000001; the counter is derived from the highest existing id that starts with MEMTG, so groups you code yourself under a different prefix never disturb it. Supplying an id that is already in use returns 409.
descriptionstringYesThe group's display name, and the only human-readable label it has — this is what staff and reporting see, since the id is usually a generated code. Required, and no longer than 25 characters; both are enforced by request validation. Descriptions are not checked for uniqueness.
commentsstringNoFree-text notes about the group, returned as comments by the group read endpoints. Maximum 255 characters. Omit it or send null to leave it blank — it is saved verbatim and is not validated or interpreted.

Sample request

cURL
curl -X POST '{base_url}/api/configuration/membership-type-groups' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "string",
  "description": "string",
  "comments": "string"
}'

Sample response

The body is the new group's identifier as a JSON string — the id you supplied, or the one the system generated.

201 Created
"MEMTG0000000001"

Errors

StatusMeaningWhen
400Bad requestRequest validation failed: description is missing or empty (Description is required), description is longer than 25 characters, id is longer than 15 characters, or comments is longer than 255 characters. The body is a validation problem response whose errors object is keyed by field name.
400Bad requestThe request was rejected while saving the group; the body is a message describing why. No documented validation rule produces this, so treat this as an unexpected malformed-request signal rather than a rule you can predict.
409ConflictYou supplied an id that an existing group already uses — Membership type group with id {id} already exists. Nothing is saved; change the id or update the existing group instead.
500Internal server errorAny other unexpected server-side failure while saving the group, including a value that breaks a rule request validation does not check. The body is an error message.

This page as markdown · All pages · llms.txt