entitlements

Create an entitlement

Changed on

This endpoint creates new entitlements by adding features to a plan. Note that all existing entitlements will be deleted and replaced by the ones provided. Sending an empty entitlements object, or omitting the key, therefore removes every entitlement of the plan. To add a new entitlement without removing the existing ones, use PATCH. The feature must exist and all privileges must be valid for the feature.

post/plans/{code}/entitlements

Request

Request body

entitlementsobject

Feature entitlements with their privilege values. Each key is a feature code, and the value is an object containing privilege codes with their associated values. The key is optional and defaults to an empty object. On the replacing endpoints (POST) an omitted or empty object removes every entitlement. On the partial update endpoints (PATCH) it changes nothing.

Example request

{
  "entitlements": {
    "seats": {
      "max": 20,
      "max_admins": 10,
      "root": false
    },
    "sso": {
      "provider": "okta"
    }
  }
}

Response

Entitlement created

Example response

{
  "entitlements": [
    {
      "code": "seats",
      "name": "Number of seats",
      "description": "Number of users of the account",
      "privileges": [
        {
          "code": "max",
          "name": "Maximum",
          "value_type": "integer",
          "config": {},
          "value": 10
        },
        {
          "code": "max_admins",
          "name": "Max Admins",
          "value_type": "integer",
          "config": {},
          "value": 5
        },
        {
          "code": "root",
          "name": "Allow root user",
          "value_type": "boolean",
          "config": {},
          "value": true
        },
        {
          "code": "provider",
          "name": "SSO Provider",
          "value_type": "select",
          "value": "google",
          "config": {
            "select_options": [
              "google",
              "okta"
            ]
          }
        }
      ]
    }
  ]
}

Changes