curl --request POST \
--url https://api.example.com/api/auth/roles/{name}/grants \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"remove": [
"<string>"
],
"set": {}
}
'import requests
url = "https://api.example.com/api/auth/roles/{name}/grants"
payload = {
"remove": ["<string>"],
"set": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({remove: ['<string>'], set: {}})
};
fetch('https://api.example.com/api/auth/roles/{name}/grants', 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/auth/roles/{name}/grants",
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([
'remove' => [
'<string>'
],
'set' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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/auth/roles/{name}/grants"
payload := strings.NewReader("{\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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/auth/roles/{name}/grants")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/roles/{name}/grants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"description": "<string>",
"grants": {},
"name": "<string>",
"allow_all": false,
"base_tier": "<string>",
"condition": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
},
"scopes": [
"<string>"
]
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Set/remove single tag grants on a role
Set (upsert) and/or remove single tag grants on a role WITHOUT replacing the whole
map. Admin-only; guards the reserved admin role and the block-downgrade of any
allow_all role. set overwrites a tag’s level (the one sanctioned overwrite); a
remove tag absent from the stored map is a loud 404. Validates the merged map before
persist; LIVE via the policy-version bump. Audits as edit.
curl --request POST \
--url https://api.example.com/api/auth/roles/{name}/grants \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"remove": [
"<string>"
],
"set": {}
}
'import requests
url = "https://api.example.com/api/auth/roles/{name}/grants"
payload = {
"remove": ["<string>"],
"set": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({remove: ['<string>'], set: {}})
};
fetch('https://api.example.com/api/auth/roles/{name}/grants', 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/auth/roles/{name}/grants",
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([
'remove' => [
'<string>'
],
'set' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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/auth/roles/{name}/grants"
payload := strings.NewReader("{\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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/auth/roles/{name}/grants")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/roles/{name}/grants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"remove\": [\n \"<string>\"\n ],\n \"set\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"description": "<string>",
"grants": {},
"name": "<string>",
"allow_all": false,
"base_tier": "<string>",
"condition": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
},
"scopes": [
"<string>"
]
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Path Parameters
Body
Response
Success.
An operator-authored role: the ONE validated shape the enforcer / membership-check, the management operations, and the generated Studio SDK all share.
A role composes TWO layers. Layer 1 is a KEPT jq security base — carried on
the condition field (from ConditionMixin) so the body round-trips it,
but NEVER authored through the grant map: the seed sets it (admin → None,
editor/viewer → their base jq) and a new role inherits it from its
base_tier. Layer 2 is the editable grants — a per-tag ACCESS LEVEL
map (feature-group TAG name → none/read/write) naming the role's
level on each feature group. An absent tag means level none (deny).
Show child attributes
Show child attributes

