curl --request POST \
--url https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"access_level": {
"access_level_name": "AdminRole",
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
},
"policy": "<string>",
"requestable_by_default": true,
"stackable_sensitivity_index": 123
}
'import requests
url = "https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels"
payload = {
"access_level": {
"access_level_name": "AdminRole",
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
},
"policy": "<string>",
"requestable_by_default": True,
"stackable_sensitivity_index": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
access_level: {
access_level_name: 'AdminRole',
access_level_remote_id: 'arn:aws:iam::590304332660:role/AdministratorAccess'
},
policy: '<string>',
requestable_by_default: true,
stackable_sensitivity_index: 123
})
};
fetch('https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'access_level' => [
'access_level_name' => 'AdminRole',
'access_level_remote_id' => 'arn:aws:iam::590304332660:role/AdministratorAccess'
],
'policy' => '<string>',
'requestable_by_default' => true,
'stackable_sensitivity_index' => 123
]),
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"
payload := strings.NewReader("{\n \"access_level\": {\n \"access_level_name\": \"AdminRole\",\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\n },\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"access_level\": {\n \"access_level_name\": \"AdminRole\",\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\n },\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"access_level\": {\n \"access_level_name\": \"AdminRole\",\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\n },\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123\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"
}Creates a custom access level on a resource. If the resource is a parent type, the role is created on all child resources.
curl --request POST \
--url https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"access_level": {
"access_level_name": "AdminRole",
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
},
"policy": "<string>",
"requestable_by_default": true,
"stackable_sensitivity_index": 123
}
'import requests
url = "https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels"
payload = {
"access_level": {
"access_level_name": "AdminRole",
"access_level_remote_id": "arn:aws:iam::590304332660:role/AdministratorAccess"
},
"policy": "<string>",
"requestable_by_default": True,
"stackable_sensitivity_index": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
access_level: {
access_level_name: 'AdminRole',
access_level_remote_id: 'arn:aws:iam::590304332660:role/AdministratorAccess'
},
policy: '<string>',
requestable_by_default: true,
stackable_sensitivity_index: 123
})
};
fetch('https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'access_level' => [
'access_level_name' => 'AdminRole',
'access_level_remote_id' => 'arn:aws:iam::590304332660:role/AdministratorAccess'
],
'policy' => '<string>',
'requestable_by_default' => true,
'stackable_sensitivity_index' => 123
]),
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"
payload := strings.NewReader("{\n \"access_level\": {\n \"access_level_name\": \"AdminRole\",\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\n },\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"access_level\": {\n \"access_level_name\": \"AdminRole\",\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\n },\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/resources/{resource_id}/custom-access-levels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"access_level\": {\n \"access_level_name\": \"AdminRole\",\n \"access_level_remote_id\": \"arn:aws:iam::590304332660:role/AdministratorAccess\"\n },\n \"policy\": \"<string>\",\n \"requestable_by_default\": true,\n \"stackable_sensitivity_index\": 123\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.
Body
Info for creating a custom access level.
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"
}
The policy document.
Whether the role is requestable. Defaults to false.
The sensitivity index. Null to leave unranked.
Response
The created 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?