curl --request PUT \
--url https://{region}.api.plerion.com/v1/organization/roles/{roleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Finding triage",
"description": "Triage and dismiss findings on the production accounts",
"permissions": [
{
"actions": [
"Finding:Read",
"Finding:Triage"
],
"resources": [
"e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b"
]
},
{
"actionGroup": "read-only",
"resources": "*"
}
]
}
'import requests
url = "https://{region}.api.plerion.com/v1/organization/roles/{roleId}"
payload = {
"name": "Finding triage",
"description": "Triage and dismiss findings on the production accounts",
"permissions": [
{
"actions": ["Finding:Read", "Finding:Triage"],
"resources": ["e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b"]
},
{
"actionGroup": "read-only",
"resources": "*"
}
]
}
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({
name: 'Finding triage',
description: 'Triage and dismiss findings on the production accounts',
permissions: [
{
actions: ['Finding:Read', 'Finding:Triage'],
resources: ['e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b']
},
{actionGroup: 'read-only', resources: '*'}
]
})
};
fetch('https://{region}.api.plerion.com/v1/organization/roles/{roleId}', 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://{region}.api.plerion.com/v1/organization/roles/{roleId}",
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([
'name' => 'Finding triage',
'description' => 'Triage and dismiss findings on the production accounts',
'permissions' => [
[
'actions' => [
'Finding:Read',
'Finding:Triage'
],
'resources' => [
'e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b'
]
],
[
'actionGroup' => 'read-only',
'resources' => '*'
]
]
]),
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://{region}.api.plerion.com/v1/organization/roles/{roleId}"
payload := strings.NewReader("{\n \"name\": \"Finding triage\",\n \"description\": \"Triage and dismiss findings on the production accounts\",\n \"permissions\": [\n {\n \"actions\": [\n \"Finding:Read\",\n \"Finding:Triage\"\n ],\n \"resources\": [\n \"e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b\"\n ]\n },\n {\n \"actionGroup\": \"read-only\",\n \"resources\": \"*\"\n }\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://{region}.api.plerion.com/v1/organization/roles/{roleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Finding triage\",\n \"description\": \"Triage and dismiss findings on the production accounts\",\n \"permissions\": [\n {\n \"actions\": [\n \"Finding:Read\",\n \"Finding:Triage\"\n ],\n \"resources\": [\n \"e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b\"\n ]\n },\n {\n \"actionGroup\": \"read-only\",\n \"resources\": \"*\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/organization/roles/{roleId}")
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 \"name\": \"Finding triage\",\n \"description\": \"Triage and dismiss findings on the production accounts\",\n \"permissions\": [\n {\n \"actions\": [\n \"Finding:Read\",\n \"Finding:Triage\"\n ],\n \"resources\": [\n \"e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b\"\n ]\n },\n {\n \"actionGroup\": \"read-only\",\n \"resources\": \"*\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scope": "organization",
"permissions": [
{
"actions": [
"<string>"
],
"resources": "*"
}
],
"builtIn": true,
"description": "<string>",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>"
}
}{
"errors": [
{
"code": "BuiltinRoleImmutable",
"message": "built-in roles cannot be modified"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "RoleNotFound",
"message": "role not found"
}
]
}Update a custom role
Replaces the name, description and permissions of a custom role. The scope and tenant cannot change. The permission rules are the same as for creating a role. A built-in role answers 400 BuiltinRoleImmutable. Users and API keys holding the role receive the new permissions within their token lifetime. Requires the readWrite access level.
curl --request PUT \
--url https://{region}.api.plerion.com/v1/organization/roles/{roleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Finding triage",
"description": "Triage and dismiss findings on the production accounts",
"permissions": [
{
"actions": [
"Finding:Read",
"Finding:Triage"
],
"resources": [
"e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b"
]
},
{
"actionGroup": "read-only",
"resources": "*"
}
]
}
'import requests
url = "https://{region}.api.plerion.com/v1/organization/roles/{roleId}"
payload = {
"name": "Finding triage",
"description": "Triage and dismiss findings on the production accounts",
"permissions": [
{
"actions": ["Finding:Read", "Finding:Triage"],
"resources": ["e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b"]
},
{
"actionGroup": "read-only",
"resources": "*"
}
]
}
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({
name: 'Finding triage',
description: 'Triage and dismiss findings on the production accounts',
permissions: [
{
actions: ['Finding:Read', 'Finding:Triage'],
resources: ['e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b']
},
{actionGroup: 'read-only', resources: '*'}
]
})
};
fetch('https://{region}.api.plerion.com/v1/organization/roles/{roleId}', 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://{region}.api.plerion.com/v1/organization/roles/{roleId}",
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([
'name' => 'Finding triage',
'description' => 'Triage and dismiss findings on the production accounts',
'permissions' => [
[
'actions' => [
'Finding:Read',
'Finding:Triage'
],
'resources' => [
'e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b'
]
],
[
'actionGroup' => 'read-only',
'resources' => '*'
]
]
]),
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://{region}.api.plerion.com/v1/organization/roles/{roleId}"
payload := strings.NewReader("{\n \"name\": \"Finding triage\",\n \"description\": \"Triage and dismiss findings on the production accounts\",\n \"permissions\": [\n {\n \"actions\": [\n \"Finding:Read\",\n \"Finding:Triage\"\n ],\n \"resources\": [\n \"e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b\"\n ]\n },\n {\n \"actionGroup\": \"read-only\",\n \"resources\": \"*\"\n }\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://{region}.api.plerion.com/v1/organization/roles/{roleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Finding triage\",\n \"description\": \"Triage and dismiss findings on the production accounts\",\n \"permissions\": [\n {\n \"actions\": [\n \"Finding:Read\",\n \"Finding:Triage\"\n ],\n \"resources\": [\n \"e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b\"\n ]\n },\n {\n \"actionGroup\": \"read-only\",\n \"resources\": \"*\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/organization/roles/{roleId}")
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 \"name\": \"Finding triage\",\n \"description\": \"Triage and dismiss findings on the production accounts\",\n \"permissions\": [\n {\n \"actions\": [\n \"Finding:Read\",\n \"Finding:Triage\"\n ],\n \"resources\": [\n \"e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b\"\n ]\n },\n {\n \"actionGroup\": \"read-only\",\n \"resources\": \"*\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"scope": "organization",
"permissions": [
{
"actions": [
"<string>"
],
"resources": "*"
}
],
"builtIn": true,
"description": "<string>",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>"
}
}{
"errors": [
{
"code": "BuiltinRoleImmutable",
"message": "built-in roles cannot be modified"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"errors": [
{
"code": "RoleNotFound",
"message": "role not found"
}
]
}Authorizations
Plerion organization API key (plerion_oak_…), created by an organization admin in the Plerion app. GET operations work with a key of either access level; POST, PUT and DELETE require the readWrite access level.
Path Parameters
The role id, built-in or custom.
Body
1 - 1201One permission: either actions or an actionGroup, optionally narrowed with resources. resources is * for every integration or a list of integration ids, and is required for actions whose resourceType is integration and not accepted otherwise.
- Option 1
- Option 2
Show child attributes
Show child attributes
500Response
The updated role.
Show child attributes
Show child attributes
Was this page helpful?