Set User Admin Access Endpoint
curl --request PATCH \
--url https://cloud.onyx.app/api/manage/admin/users/admin-access \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_email": "<string>",
"is_admin": true
}
'import requests
url = "https://cloud.onyx.app/api/manage/admin/users/admin-access"
payload = {
"user_email": "<string>",
"is_admin": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_email: '<string>', is_admin: true})
};
fetch('https://cloud.onyx.app/api/manage/admin/users/admin-access', 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://cloud.onyx.app/api/manage/admin/users/admin-access",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'user_email' => '<string>',
'is_admin' => true
]),
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://cloud.onyx.app/api/manage/admin/users/admin-access"
payload := strings.NewReader("{\n \"user_email\": \"<string>\",\n \"is_admin\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://cloud.onyx.app/api/manage/admin/users/admin-access")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_email\": \"<string>\",\n \"is_admin\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.onyx.app/api/manage/admin/users/admin-access")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_email\": \"<string>\",\n \"is_admin\": true\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}User Management
Set User Admin Access
PATCH
/
manage
/
admin
/
users
/
admin-access
Set User Admin Access Endpoint
curl --request PATCH \
--url https://cloud.onyx.app/api/manage/admin/users/admin-access \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_email": "<string>",
"is_admin": true
}
'import requests
url = "https://cloud.onyx.app/api/manage/admin/users/admin-access"
payload = {
"user_email": "<string>",
"is_admin": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_email: '<string>', is_admin: true})
};
fetch('https://cloud.onyx.app/api/manage/admin/users/admin-access', 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://cloud.onyx.app/api/manage/admin/users/admin-access",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'user_email' => '<string>',
'is_admin' => true
]),
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://cloud.onyx.app/api/manage/admin/users/admin-access"
payload := strings.NewReader("{\n \"user_email\": \"<string>\",\n \"is_admin\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://cloud.onyx.app/api/manage/admin/users/admin-access")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_email\": \"<string>\",\n \"is_admin\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.onyx.app/api/manage/admin/users/admin-access")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_email\": \"<string>\",\n \"is_admin\": true\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Required permission: Admin (
admin).This endpoint applies to Onyx v4.7 and later. It replaces
PATCH /manage/set-user-role,
which was removed with the role model in v4.7. For older versions,
see Set User Role. To grant any other permission,
add the user to a group that grants it.- You cannot remove yourself from the Admin group. Ask another admin to do it.
- You cannot remove the last admin. Grant another user admin access first.
- This endpoint cannot change admin access for service accounts, bot accounts, external permission accounts, or anonymous accounts. To grant an API key admin access, assign its service account to the Admin group.
Was this page helpful?
⌘I