curl --request PATCH \
--url https://api.nozle.app/core/api/v1/plans/{code}/entitlements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entitlements": {
"seats": {
"max": 20,
"max_admins": 10,
"root": false
},
"sso": {
"provider": "microsoft"
}
}
}
'import requests
url = "https://api.nozle.app/core/api/v1/plans/{code}/entitlements"
payload = { "entitlements": {
"seats": {
"max": 20,
"max_admins": 10,
"root": False
},
"sso": { "provider": "microsoft" }
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entitlements: {seats: {max: 20, max_admins: 10, root: false}, sso: {provider: 'microsoft'}}
})
};
fetch('https://api.nozle.app/core/api/v1/plans/{code}/entitlements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nozle.app/core/api/v1/plans/{code}/entitlements"
payload := strings.NewReader("{\n \"entitlements\": {\n \"seats\": {\n \"max\": 20,\n \"max_admins\": 10,\n \"root\": false\n },\n \"sso\": {\n \"provider\": \"microsoft\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.nozle.app/core/api/v1/plans/{code}/entitlements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entitlements\": {\n \"seats\": {\n \"max\": 20,\n \"max_admins\": 10,\n \"root\": false\n },\n \"sso\": {\n \"provider\": \"microsoft\"\n }\n }\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nozle.app/core/api/v1/plans/{code}/entitlements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'entitlements' => [
'seats' => [
'max' => 20,
'max_admins' => 10,
'root' => false
],
'sso' => [
'provider' => 'microsoft'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://api.nozle.app/core/api/v1/plans/{code}/entitlements")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entitlements\": {\n \"seats\": {\n \"max\": 20,\n \"max_admins\": 10,\n \"root\": false\n },\n \"sso\": {\n \"provider\": \"microsoft\"\n }\n }\n}")
.asString();{
"entitlements": [
{
"feature_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"feature_type": "config",
"usage_limit": null,
"hard_limit": null,
"min_margin_percent": null,
"margin_enforcement_mode": null,
"enforce_plan_margin": null,
"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",
"microsoft"
]
}
}
]
}
]
}{
"status": 400,
"error": "Bad request"
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {}
}Partial update of an entitlement
This accepts a list of entitlements to update. If the feature isn’t part of the plan yet, it’s added with all the privileges from the payload. If the feature is already part of the plan, the privilege and values are updated or added. All privileges must be valid for the feature. All features and privileges not part of the payload are left untouched. For a feature that is already part of the plan, the metered settings the payload leaves out (usage_limit, hard_limit, min_margin_percent, margin_enforcement_mode, enforce_plan_margin) keep their current values, so sending only hard_limit set to false keeps the usage limit, and sending only usage_limit keeps a soft limit soft. POST replaces the whole entitlement and applies the defaults. To remove privileges or features, use the DELETE endpoints. In a plan family, features and privileges are written to every plan of the family, but usage_limit and hard_limit are set on the plan in the path only, so each billing interval keeps its own limits, because usage is counted per billing period. A plan of the family that gets a metered feature for the first time this way has no limit until one is set on it.
curl --request PATCH \
--url https://api.nozle.app/core/api/v1/plans/{code}/entitlements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entitlements": {
"seats": {
"max": 20,
"max_admins": 10,
"root": false
},
"sso": {
"provider": "microsoft"
}
}
}
'import requests
url = "https://api.nozle.app/core/api/v1/plans/{code}/entitlements"
payload = { "entitlements": {
"seats": {
"max": 20,
"max_admins": 10,
"root": False
},
"sso": { "provider": "microsoft" }
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entitlements: {seats: {max: 20, max_admins: 10, root: false}, sso: {provider: 'microsoft'}}
})
};
fetch('https://api.nozle.app/core/api/v1/plans/{code}/entitlements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nozle.app/core/api/v1/plans/{code}/entitlements"
payload := strings.NewReader("{\n \"entitlements\": {\n \"seats\": {\n \"max\": 20,\n \"max_admins\": 10,\n \"root\": false\n },\n \"sso\": {\n \"provider\": \"microsoft\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.nozle.app/core/api/v1/plans/{code}/entitlements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entitlements\": {\n \"seats\": {\n \"max\": 20,\n \"max_admins\": 10,\n \"root\": false\n },\n \"sso\": {\n \"provider\": \"microsoft\"\n }\n }\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nozle.app/core/api/v1/plans/{code}/entitlements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'entitlements' => [
'seats' => [
'max' => 20,
'max_admins' => 10,
'root' => false
],
'sso' => [
'provider' => 'microsoft'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://api.nozle.app/core/api/v1/plans/{code}/entitlements")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entitlements\": {\n \"seats\": {\n \"max\": 20,\n \"max_admins\": 10,\n \"root\": false\n },\n \"sso\": {\n \"provider\": \"microsoft\"\n }\n }\n}")
.asString();{
"entitlements": [
{
"feature_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"feature_type": "config",
"usage_limit": null,
"hard_limit": null,
"min_margin_percent": null,
"margin_enforcement_mode": null,
"enforce_plan_margin": null,
"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",
"microsoft"
]
}
}
]
}
]
}{
"status": 400,
"error": "Bad request"
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Code of the existing plan.
"startup"
Body
Entitlement payload
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.
Show child attributes
Show child attributes
{ "seats": { "max": 20, "max_admins": 10, "root": false }, "sso": { "provider": "microsoft" } }
Response
Entitlement updated
Show child attributes
Show child attributes