curl --request PATCH \
--url https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"access_level_name": "<string>",
"policy": "<string>",
"requestable_by_default": true,
"stackable_sensitivity_index": 123,
"clear_stackable_sensitivity_index": true
}
'import requests
url = "https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_id}"
payload = {
"access_level_name": "<string>",
"policy": "<string>",
"requestable_by_default": True,
"stackable_sensitivity_index": 123,
"clear_stackable_sensitivity_index": 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({
access_level_name: '<string>',
policy: '<string>',
requestable_by_default: true,
stackable_sensitivity_index: 123,
clear_stackable_sensitivity_index: true
})
};
fetch('https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_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_URL => "https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_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([
'access_level_name' => '<string>',
'policy' => '<string>',
'requestable_by_default' => true,
'stackable_sensitivity_index' => 123,
'clear_stackable_sensitivity_index' => 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://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_id}"
payload := strings.NewReader("{\n \"access_level_name\": \"<string>\",\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123,\n \"clear_stackable_sensitivity_index\": 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://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"access_level_name\": \"<string>\",\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123,\n \"clear_stackable_sensitivity_index\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_id}")
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 \"access_level_name\": \"<string>\",\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123,\n \"clear_stackable_sensitivity_index\": true\n}"
response = http.request(request)
puts response.read_body{
"resource_custom_access_level_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"access_level": {
"access_level_name": "AdminRole",
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
},
"requestable_by_default": true,
"policy": "<string>",
"stackable_sensitivity_index": 123,
"member_resource_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Updates a custom access level identified by its remote ID. If the resource is a parent type, the update fans out to all child resources.
curl --request PATCH \
--url https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"access_level_name": "<string>",
"policy": "<string>",
"requestable_by_default": true,
"stackable_sensitivity_index": 123,
"clear_stackable_sensitivity_index": true
}
'import requests
url = "https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_id}"
payload = {
"access_level_name": "<string>",
"policy": "<string>",
"requestable_by_default": True,
"stackable_sensitivity_index": 123,
"clear_stackable_sensitivity_index": 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({
access_level_name: '<string>',
policy: '<string>',
requestable_by_default: true,
stackable_sensitivity_index: 123,
clear_stackable_sensitivity_index: true
})
};
fetch('https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_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_URL => "https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_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([
'access_level_name' => '<string>',
'policy' => '<string>',
'requestable_by_default' => true,
'stackable_sensitivity_index' => 123,
'clear_stackable_sensitivity_index' => 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://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_id}"
payload := strings.NewReader("{\n \"access_level_name\": \"<string>\",\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123,\n \"clear_stackable_sensitivity_index\": 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://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"access_level_name\": \"<string>\",\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123,\n \"clear_stackable_sensitivity_index\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels/{access_level_remote_id}")
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 \"access_level_name\": \"<string>\",\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123,\n \"clear_stackable_sensitivity_index\": true\n}"
response = http.request(request)
puts response.read_body{
"resource_custom_access_level_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"access_level": {
"access_level_name": "AdminRole",
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
},
"requestable_by_default": true,
"policy": "<string>",
"stackable_sensitivity_index": 123,
"member_resource_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the resource.
The remote ID of the access level.
Body
Info for updating a custom access level.
The new human-readable name.
The new policy document.
Whether the role is requestable.
The new sensitivity index.
Set to true to remove from the hierarchy.
Response
The updated custom access level.
A custom access level for a resource.
The unique ID of the custom access level.
The resource this access level belongs to.
Access Level Object
Description
The AccessLevel object is used to represent the level of access that a principal has. The "default" access
level is a AccessLevel object whose fields are all empty strings.
Usage Example
View the AccessLevel of a resource/user or resource/group pair to see the level of access granted to the resource.
Show child attributes
Show child attributes
{
"access_level_name": "AdminRole",
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
}
Whether this role is requestable.
The policy document for this access level.
The sensitivity index in the access hierarchy. Null if unranked.
When addressed via a parent resource, lists the child resource IDs that back this aggregated entry.
Was this page helpful?