v1

latestOpenAPI 3.1.0AGPLv32026-07-26168262527.5 KB
entitlements

Create an entitlement

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. 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 body

entitlementsobject required

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.

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"
            ]
          }
        }
      ]
    }
  ]
}