Replace a role
curl --request PATCH \
--url http://localhost:3000/api/admin/roles/{id} \
--header 'Content-Type: application/json' \
--cookie __Host-argus-session= \
--data '
{
"name": "Traffic officer",
"permissions": [
"cad.unit.self",
"pnc.view"
]
}
'import requests
url = "http://localhost:3000/api/admin/roles/{id}"
payload = {
"name": "Traffic officer",
"permissions": ["cad.unit.self", "pnc.view"]
}
headers = {
"cookie": "__Host-argus-session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: '__Host-argus-session=', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Traffic officer', permissions: ['cad.unit.self', 'pnc.view']})
};
fetch('http://localhost:3000/api/admin/roles/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/admin/roles/{id}",
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([
'name' => 'Traffic officer',
'permissions' => [
'cad.unit.self',
'pnc.view'
]
]),
CURLOPT_COOKIE => "__Host-argus-session=",
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 := "http://localhost:3000/api/admin/roles/{id}"
payload := strings.NewReader("{\n \"name\": \"Traffic officer\",\n \"permissions\": [\n \"cad.unit.self\",\n \"pnc.view\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "__Host-argus-session=")
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("http://localhost:3000/api/admin/roles/{id}")
.header("cookie", "__Host-argus-session=")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Traffic officer\",\n \"permissions\": [\n \"cad.unit.self\",\n \"pnc.view\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/admin/roles/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["cookie"] = '__Host-argus-session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Traffic officer\",\n \"permissions\": [\n \"cad.unit.self\",\n \"pnc.view\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cmg5x0aaa0003l508role0001",
"name": "Traffic officer",
"permissions": [
"cad.unit.self",
"pnc.view"
]
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Request validation failed.",
"details": [
{
"path": [
"name"
],
"message": "Invalid input"
}
]
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Sign in to continue."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission required: admin.manage."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "NOT_FOUND",
"message": "Role not found."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "RESERVED_ROLE",
"message": "The Administrator role is managed by the permission catalogue."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "The request could not be completed."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}Administration
Replace a role
Permission: admin.manage.
Access: Browser session only.
Replaces the role’s name and its whole permission set. The Administrator role cannot be edited; it always carries the full catalogue.
PATCH
/
admin
/
roles
/
{id}
Replace a role
curl --request PATCH \
--url http://localhost:3000/api/admin/roles/{id} \
--header 'Content-Type: application/json' \
--cookie __Host-argus-session= \
--data '
{
"name": "Traffic officer",
"permissions": [
"cad.unit.self",
"pnc.view"
]
}
'import requests
url = "http://localhost:3000/api/admin/roles/{id}"
payload = {
"name": "Traffic officer",
"permissions": ["cad.unit.self", "pnc.view"]
}
headers = {
"cookie": "__Host-argus-session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: '__Host-argus-session=', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Traffic officer', permissions: ['cad.unit.self', 'pnc.view']})
};
fetch('http://localhost:3000/api/admin/roles/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/admin/roles/{id}",
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([
'name' => 'Traffic officer',
'permissions' => [
'cad.unit.self',
'pnc.view'
]
]),
CURLOPT_COOKIE => "__Host-argus-session=",
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 := "http://localhost:3000/api/admin/roles/{id}"
payload := strings.NewReader("{\n \"name\": \"Traffic officer\",\n \"permissions\": [\n \"cad.unit.self\",\n \"pnc.view\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "__Host-argus-session=")
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("http://localhost:3000/api/admin/roles/{id}")
.header("cookie", "__Host-argus-session=")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Traffic officer\",\n \"permissions\": [\n \"cad.unit.self\",\n \"pnc.view\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/admin/roles/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["cookie"] = '__Host-argus-session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Traffic officer\",\n \"permissions\": [\n \"cad.unit.self\",\n \"pnc.view\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cmg5x0aaa0003l508role0001",
"name": "Traffic officer",
"permissions": [
"cad.unit.self",
"pnc.view"
]
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Request validation failed.",
"details": [
{
"path": [
"name"
],
"message": "Invalid input"
}
]
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Sign in to continue."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission required: admin.manage."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "NOT_FOUND",
"message": "Role not found."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "RESERVED_ROLE",
"message": "The Administrator role is managed by the permission catalogue."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "The request could not be completed."
},
"requestId": "3f1c9d5e-7a42-4f0b-9c1e-8b6d2a4e5f70"
}Authorizations
The opaque session cookie set by Discord sign-in. Named argus-session outside production. HttpOnly, so scripts cannot read it; same-origin requests send it automatically. Requests other than GET must also carry an Origin header equal to the application's own origin.
Path Parameters
Role ID. Argus record identifier.
Required string length:
1 - 64Pattern:
^[a-zA-Z0-9_-]+$Body
application/json
Required string length:
2 - 60Maximum array length:
32An Argus permission key.
Available options:
cad.unit.self, cad.view, cad.dispatch, cad.incidents.create, cad.incidents.manage, cad.units.manage, cad.calls.manage, server.view, players.view, players.lookup, sessions.view, sessions.manage, shifts.view, shifts.manage, staff.view, staff.manage, moderation.view, moderation.warn, moderation.kick, moderation.ban, moderation.history, audit.view, admin.manage, civilians.create, civilians.manage_own, civilians.manage, pnc.view, pnc.records.manage, pnc.licences.manage, pnc.warrants.manage, pnc.markers.manage, pnc.vehicles.manage Response
Success.
Show child attributes
Show child attributes