curl --request PUT \
--url https://api.example.com/api/auth/roles/{name} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"description": "<string>",
"grants": {}
}
'import requests
url = "https://api.example.com/api/auth/roles/{name}"
payload = {
"description": "<string>",
"grants": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: '<string>', grants: {}})
};
fetch('https://api.example.com/api/auth/roles/{name}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'grants' => [
]
]),
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}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"grants\": {}\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/api/auth/roles/{name}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"grants\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/roles/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"grants\": {}\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>"
}Edit a role's grant map
Edit a role’s per-tag grant map + description (the base-tier jq is seed-fixed, not
editable here). Admin-only; guards the reserved admin role and the block-downgrade
of any allow_all role. Both inputs are omit-means-keep — an absent grants/
description preserves the stored value, so a description-only edit never wipes the
grant map. Validates a supplied grant map before persist; LIVE — the edit changes every
holder’s reach on their next request via the policy-version bump. Audits.
curl --request PUT \
--url https://api.example.com/api/auth/roles/{name} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"description": "<string>",
"grants": {}
}
'import requests
url = "https://api.example.com/api/auth/roles/{name}"
payload = {
"description": "<string>",
"grants": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: '<string>', grants: {}})
};
fetch('https://api.example.com/api/auth/roles/{name}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'grants' => [
]
]),
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}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"grants\": {}\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/api/auth/roles/{name}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"grants\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/roles/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"grants\": {}\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
The edit-role request body: only the per-tag grant map + description are editable;
the base-tier jq / base_tier are seed-fixed and rejected on any change attempt. Both
fields are omit-means-keep — an absent grants (None) preserves the stored grant
map (it is never silently wiped), and an absent description preserves the stored
description.
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

