Skip to main content
DELETE
/
plans
/
{code}
/
entitlements
/
{feature_code}
/
privileges
/
{privilege_code}
Remove a privilege from an entitlement
curl --request DELETE \
  --url https://api.getlago.com/api/v1/plans/{code}/entitlements/{feature_code}/privileges/{privilege_code} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.getlago.com/api/v1/plans/{code}/entitlements/{feature_code}/privileges/{privilege_code}"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.getlago.com/api/v1/plans/{code}/entitlements/{feature_code}/privileges/{privilege_code}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.getlago.com/api/v1/plans/{code}/entitlements/{feature_code}/privileges/{privilege_code}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getlago.com/api/v1/plans/{code}/entitlements/{feature_code}/privileges/{privilege_code}"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://api.getlago.com/api/v1/plans/{code}/entitlements/{feature_code}/privileges/{privilege_code}")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.getlago.com/api/v1/plans/{code}/entitlements/{feature_code}/privileges/{privilege_code}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "entitlement": {
    "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"
          ]
        }
      }
    ]
  }
}
{
  "status": 401,
  "error": "Unauthorized"
}
{
  "status": 404,
  "error": "Not Found",
  "code": "object_not_found"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

code
string
required

Code of the existing plan.

Example:

"startup"

feature_code
string
required

Code of the existing feature.

Example:

"seats"

privilege_code
string
required

Code of the privilege to remove from the entitlement.

Example:

"max_admins"

Response

Entitlement with privilege removed

entitlement
object
required