curl --request POST \
--url https://api.example.com/api/directory/resources.revoke-roles \
--header 'Content-Type: application/json' \
--data '
{
"resource_ids": [
"872815618512410358"
],
"role_ids": [
"872815618512410358"
],
"team_ids": "*"
}
'import requests
url = "https://api.example.com/api/directory/resources.revoke-roles"
payload = {
"resource_ids": ["872815618512410358"],
"role_ids": ["872815618512410358"],
"team_ids": "*"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
resource_ids: ['872815618512410358'],
role_ids: ['872815618512410358'],
team_ids: '*'
})
};
fetch('https://api.example.com/api/directory/resources.revoke-roles', 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.example.com/api/directory/resources.revoke-roles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource_ids' => [
'872815618512410358'
],
'role_ids' => [
'872815618512410358'
],
'team_ids' => '*'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/directory/resources.revoke-roles"
payload := strings.NewReader("{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"role_ids\": [\n \"872815618512410358\"\n ],\n \"team_ids\": \"*\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/directory/resources.revoke-roles")
.header("Content-Type", "application/json")
.body("{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"role_ids\": [\n \"872815618512410358\"\n ],\n \"team_ids\": \"*\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/directory/resources.revoke-roles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"role_ids\": [\n \"872815618512410358\"\n ],\n \"team_ids\": \"*\"\n}"
response = http.request(request)
puts response.read_bodyRevoke roles
Revokes role access, or narrows its team scope (see “team_ids”). Only resources whose kind supports roles (employees and integrations) can have one revoked. The role that defines the kind of a resource can only have its teams revoked, never the role itself. Revoking a role, or a team, that such a resource does not have changes nothing.
curl --request POST \
--url https://api.example.com/api/directory/resources.revoke-roles \
--header 'Content-Type: application/json' \
--data '
{
"resource_ids": [
"872815618512410358"
],
"role_ids": [
"872815618512410358"
],
"team_ids": "*"
}
'import requests
url = "https://api.example.com/api/directory/resources.revoke-roles"
payload = {
"resource_ids": ["872815618512410358"],
"role_ids": ["872815618512410358"],
"team_ids": "*"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
resource_ids: ['872815618512410358'],
role_ids: ['872815618512410358'],
team_ids: '*'
})
};
fetch('https://api.example.com/api/directory/resources.revoke-roles', 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.example.com/api/directory/resources.revoke-roles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource_ids' => [
'872815618512410358'
],
'role_ids' => [
'872815618512410358'
],
'team_ids' => '*'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/directory/resources.revoke-roles"
payload := strings.NewReader("{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"role_ids\": [\n \"872815618512410358\"\n ],\n \"team_ids\": \"*\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/directory/resources.revoke-roles")
.header("Content-Type", "application/json")
.body("{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"role_ids\": [\n \"872815618512410358\"\n ],\n \"team_ids\": \"*\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/directory/resources.revoke-roles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_ids\": [\n \"872815618512410358\"\n ],\n \"role_ids\": [\n \"872815618512410358\"\n ],\n \"team_ids\": \"*\"\n}"
response = http.request(request)
puts response.read_bodyBody
Teams to revoke from the role. Omitting it removes the role from the resources entirely. Sending "" revokes every team and keeps the role assigned on no team, as does revoking its last remaining teams. Revoking specific teams from a role held on "" turns it into the explicit list of the remaining enabled teams, which no longer follows the teams created afterwards. An empty array is rejected.
* "*"
Response
Resource roles revoked.