curl --request DELETE \
--url https://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}', 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://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}",
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://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}"
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://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}")
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{
"errors": [
{
"code": "TenantWildcardNotAllowed",
"message": "tenantId must name one tenant; \"*\" is not accepted on this API"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "RoleNotFound",
"message": "role not found"
}
]
}{
"errors": [
{
"code": "RoleHasAssignments",
"message": "role has active assignments; revoke them first"
}
]
}Revoke a role
Removes one assignment. For the built-in Tenant admin and Tenant read-only roles, the tenantId query parameter names which tenant’s grant to revoke and is required; for every other role it is not accepted. For a user and a built-in role, the grant is removed wherever it is held, including one made in the Plerion app, in the one call. Answers 404 AssignmentNotFound when the principal does not hold the role, and 409 UserRecordChanged when the user was edited at the same moment; retry. Requires the readWrite access level.
curl --request DELETE \
--url https://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}', 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://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}",
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://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}"
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://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/organization/role-assignments/{roleId}/{principalType}/{principalId}")
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{
"errors": [
{
"code": "TenantWildcardNotAllowed",
"message": "tenantId must name one tenant; \"*\" is not accepted on this API"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "RoleNotFound",
"message": "role not found"
}
]
}{
"errors": [
{
"code": "RoleHasAssignments",
"message": "role has active assignments; revoke them first"
}
]
}Authorizations
Plerion organization API key (plerion_oak_…), created by an organization admin in the Plerion app. GET operations work with a key of either access level; POST, PUT and DELETE require the readWrite access level.
Path Parameters
The role id, built-in or custom.
users or groups.
users, groups The user id or user group id.
Query Parameters
The tenant of the grant to revoke. Built-in tenant roles only.
Response
Revoked.
Was this page helpful?