Groups
Set a member's group permissions
Requires group.manage. Reconciles the member’s group grants to exactly the set supplied — send an empty array to remove them from the group. Doing it in one call instead of several /grants calls avoids notification spam and never exposes an intermediate permission set.
PUT
/
groups
/
{id}
/
members
/
{userID}
/
permissions
Set a member's group permissions
curl --request PUT \
--url https://custos.example.com/groups/{id}/members/{userID}/permissions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
"<string>"
]
}
'import requests
url = "https://custos.example.com/groups/{id}/members/{userID}/permissions"
payload = { "permissions": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({permissions: ['<string>']})
};
fetch('https://custos.example.com/groups/{id}/members/{userID}/permissions', 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://custos.example.com/groups/{id}/members/{userID}/permissions",
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([
'permissions' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://custos.example.com/groups/{id}/members/{userID}/permissions"
payload := strings.NewReader("{\n \"permissions\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://custos.example.com/groups/{id}/members/{userID}/permissions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"permissions\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://custos.example.com/groups/{id}/members/{userID}/permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"permissions\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"name": "<string>",
"display_name": "<string>",
"role": "<string>",
"status": "<string>",
"permissions": [
"<string>"
],
"grants": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"permission": "<string>",
"granted_at": "2023-11-07T05:31:56Z"
}
]
}Authorizations
An opaque access token from /login or /refresh. Tokens are checked against the database on every request, so revocation is immediate.
Body
application/json
Any permission grantable on a group: the group permissions plus every host, credential, set and backup permission, which cascade to the group's contents.
⌘I
Set a member's group permissions
curl --request PUT \
--url https://custos.example.com/groups/{id}/members/{userID}/permissions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
"<string>"
]
}
'import requests
url = "https://custos.example.com/groups/{id}/members/{userID}/permissions"
payload = { "permissions": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({permissions: ['<string>']})
};
fetch('https://custos.example.com/groups/{id}/members/{userID}/permissions', 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://custos.example.com/groups/{id}/members/{userID}/permissions",
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([
'permissions' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://custos.example.com/groups/{id}/members/{userID}/permissions"
payload := strings.NewReader("{\n \"permissions\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://custos.example.com/groups/{id}/members/{userID}/permissions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"permissions\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://custos.example.com/groups/{id}/members/{userID}/permissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"permissions\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"name": "<string>",
"display_name": "<string>",
"role": "<string>",
"status": "<string>",
"permissions": [
"<string>"
],
"grants": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"permission": "<string>",
"granted_at": "2023-11-07T05:31:56Z"
}
]
}