Update membership type restrictions

PUT /api/configuration/membership-types/{id}/restrictions

Overview

Sets how many members a group membership of this type may contain in total, and how that total may be split across price levels — for example a family membership capped at five members, of whom at most two may be adults.

This only works on group membership types. A membership type that is not configured to apply to links as a group is rejected with 422 Price level restrictions can only be assigned to group memberships.

Both parts are full replacements, not partial updates. maxCapacity is written on every call, and the existing price level restrictions are deleted and rebuilt from the priceLevels array — so an entry you leave out is removed. Send the complete intended set every time; an empty array removes all price level restrictions and leaves only the overall capacity.

maxCapacity of 0 means unlimited. When it is 0 the per-price-level values are not checked against it; for any other value, no price level may allow or require more members than the total.

Two practical limits worth knowing:

Validation order matters when reading errors: the capacity and price level checks run before the membership type is looked up, so an invalid body returns 422 even when the membership type in the path does not exist. Nothing is written unless every check passes.

On success the response is 204 No Content.

Endpoint

PUT {base_url}/api/configuration/membership-types/{id}/restrictions

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

Path parameters

NameTypeRequiredDescription
idstringYesIdentifier of the membership type to restrict. If it matches nothing the request fails with 404 Unable to find Membership Type {id} to update. — but only after the body has passed the checks described in the Overview.

Request body

FieldTypeRequiredDescription
maxCapacityinteger (int32)NoTotal number of members a group membership of this type may hold. 0 means unlimited, and also switches off the check that each price level's figures fit within the total. Negative values are rejected (Max capacity must be 0 or higher). Omitting it writes 0 — unlimited — rather than leaving the current cap in place. Keep it within 0–32767: larger values are accepted by validation and stored incorrectly.
priceLevelsarray of objectYesThe complete set of per-price-level limits for this membership type. Existing restrictions are deleted and rebuilt from this array, so an entry you omit is removed; send [] to remove them all. Must be present — null or a missing property fails with 500, not 400. Each price level may appear only once (422 You can not supply duplicate price levels), and every price level must already exist (422 One or more price levels don't exist).
priceLevels[].idstringYesIdentifier of an existing price level, from GET /api/configuration/price-levels. Mandatory (A price level ID must be supplied). Existence is checked for the whole array at once, so one unknown id fails the entire request with 422 One or more price levels don't exist without naming which.
priceLevels[].minimumMembersPerPriceLevelinteger (int32)NoSmallest number of members on this price level a group membership must have — for example at least one adult. Nullable: omit it or send null for no minimum. When supplied it must be 0 or higher (Minimum required must be 0 or higher), must not exceed maximumMembersPerPriceLevel (422 The minimum required value for a price level can not be larger than the maximum allowed) and, unless maxCapacity is 0, must not exceed maxCapacity (422 Max allowed and min required values for a price level can not be greater than the total max capacity).
priceLevels[].maximumMembersPerPriceLevelinteger (int32)YesLargest number of members on this price level a group membership may have. Mandatory (A max value must be supplied) and 0 or higher (Max value must be 0 or higher). Unless maxCapacity is 0, it must not exceed maxCapacity, or the request fails with 422 Max allowed and min required values for a price level can not be greater than the total max capacity. Note that 0 here means no members on this price level are allowed — it is not a synonym for unlimited, unlike maxCapacity.

Sample request

cURL
curl -X PUT '{base_url}/api/configuration/membership-types/{id}/restrictions' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "maxCapacity": 1,
  "priceLevels": [
    {
      "id": "string",
      "minimumMembersPerPriceLevel": 1,
      "maximumMembersPerPriceLevel": 1
    }
  ]
}'

Errors

StatusMeaningWhen
400Bad requestValidation failed: maxCapacity negative, a price level entry missing id or maximumMembersPerPriceLevel, or either members figure negative. The body is a validation problem document keyed by field and array index.
404Not foundNo membership type matches the path identifier — Unable to find Membership Type {id} to update. Raised only after the body has passed validation, so a 422 can mask it.
422Unprocessable entityA price level allows or requires more members than maxCapacity, where maxCapacity is not 0 — Max allowed and min required values for a price level can not be greater than the total max capacity.
422Unprocessable entityA price level's minimum exceeds its maximum — The minimum required value for a price level can not be larger than the maximum allowed.
422Unprocessable entityThe same price level appears more than once — You can not supply duplicate price levels.
422Unprocessable entityOne or more price level ids do not exist — One or more price levels don't exist. The offending ids are not named.
422Unprocessable entityThe membership type is not a group membership — Price level restrictions can only be assigned to group memberships.
500Internal server errorpriceLevels was null or omitted. Also any other unexpected server-side failure while saving. No detail is returned.

This page as markdown · All pages · llms.txt