cURL
curl --request POST \
--url https://api.opal.dev/v1/requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resources": [
{
"id": "group283-ca87-4a8a-bdbb-df212eca5353",
"access_level_remote_id": "arn:aws:iam::490306337630:role/SupportUser",
"access_level_name": "arn:aws:iam::490306337630:role/SupportUser"
}
],
"groups": [
{
"id": "f454d283-ca87-4a8a-bdbb-df212eca5353",
"access_level_remote_id": "arn:aws:iam::490306337630:role/SupportUser",
"access_level_name": "arn:aws:iam::490306337630:role/SupportUser"
}
],
"reason": "<string>",
"duration_minutes": 0,
"target_user_id": "userd283-ca87-4a8a-bdbb-df212eca5353",
"target_group_id": "userd283-ca87-4a8a-bdbb-df212eca5353",
"custom_metadata": [
{
"name": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.opal.dev/v1/requests"
payload = {
"resources": [
{
"id": "group283-ca87-4a8a-bdbb-df212eca5353",
"access_level_remote_id": "arn:aws:iam::490306337630:role/SupportUser",
"access_level_name": "arn:aws:iam::490306337630:role/SupportUser"
}
],
"groups": [
{
"id": "f454d283-ca87-4a8a-bdbb-df212eca5353",
"access_level_remote_id": "arn:aws:iam::490306337630:role/SupportUser",
"access_level_name": "arn:aws:iam::490306337630:role/SupportUser"
}
],
"reason": "<string>",
"duration_minutes": 0,
"target_user_id": "userd283-ca87-4a8a-bdbb-df212eca5353",
"target_group_id": "userd283-ca87-4a8a-bdbb-df212eca5353",
"custom_metadata": [
{
"name": "<string>",
"value": "<string>"
}
]
}
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({
resources: [
{
id: 'group283-ca87-4a8a-bdbb-df212eca5353',
access_level_remote_id: 'arn:aws:iam::490306337630:role/SupportUser',
access_level_name: 'arn:aws:iam::490306337630:role/SupportUser'
}
],
groups: [
{
id: 'f454d283-ca87-4a8a-bdbb-df212eca5353',
access_level_remote_id: 'arn:aws:iam::490306337630:role/SupportUser',
access_level_name: 'arn:aws:iam::490306337630:role/SupportUser'
}
],
reason: '<string>',
duration_minutes: 0,
target_user_id: 'userd283-ca87-4a8a-bdbb-df212eca5353',
target_group_id: 'userd283-ca87-4a8a-bdbb-df212eca5353',
custom_metadata: [{name: '<string>', value: '<string>'}]
})
};
fetch('https://api.opal.dev/v1/requests', 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/requests",
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([
'resources' => [
[
'id' => 'group283-ca87-4a8a-bdbb-df212eca5353',
'access_level_remote_id' => 'arn:aws:iam::490306337630:role/SupportUser',
'access_level_name' => 'arn:aws:iam::490306337630:role/SupportUser'
]
],
'groups' => [
[
'id' => 'f454d283-ca87-4a8a-bdbb-df212eca5353',
'access_level_remote_id' => 'arn:aws:iam::490306337630:role/SupportUser',
'access_level_name' => 'arn:aws:iam::490306337630:role/SupportUser'
]
],
'reason' => '<string>',
'duration_minutes' => 0,
'target_user_id' => 'userd283-ca87-4a8a-bdbb-df212eca5353',
'target_group_id' => 'userd283-ca87-4a8a-bdbb-df212eca5353',
'custom_metadata' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
]),
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/requests"
payload := strings.NewReader("{\n \"resources\": [\n {\n \"id\": \"group283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"groups\": [\n {\n \"id\": \"f454d283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"reason\": \"<string>\",\n \"duration_minutes\": 0,\n \"target_user_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"target_group_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"custom_metadata\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\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/requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resources\": [\n {\n \"id\": \"group283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"groups\": [\n {\n \"id\": \"f454d283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"reason\": \"<string>\",\n \"duration_minutes\": 0,\n \"target_user_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"target_group_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"custom_metadata\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/requests")
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 \"resources\": [\n {\n \"id\": \"group283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"groups\": [\n {\n \"id\": \"f454d283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"reason\": \"<string>\",\n \"duration_minutes\": 0,\n \"target_user_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"target_group_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"custom_metadata\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "4baf8423-db0a-4037-a4cf-f79c60cb67a5"
}Create an access request
POST
/
requests
cURL
curl --request POST \
--url https://api.opal.dev/v1/requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resources": [
{
"id": "group283-ca87-4a8a-bdbb-df212eca5353",
"access_level_remote_id": "arn:aws:iam::490306337630:role/SupportUser",
"access_level_name": "arn:aws:iam::490306337630:role/SupportUser"
}
],
"groups": [
{
"id": "f454d283-ca87-4a8a-bdbb-df212eca5353",
"access_level_remote_id": "arn:aws:iam::490306337630:role/SupportUser",
"access_level_name": "arn:aws:iam::490306337630:role/SupportUser"
}
],
"reason": "<string>",
"duration_minutes": 0,
"target_user_id": "userd283-ca87-4a8a-bdbb-df212eca5353",
"target_group_id": "userd283-ca87-4a8a-bdbb-df212eca5353",
"custom_metadata": [
{
"name": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.opal.dev/v1/requests"
payload = {
"resources": [
{
"id": "group283-ca87-4a8a-bdbb-df212eca5353",
"access_level_remote_id": "arn:aws:iam::490306337630:role/SupportUser",
"access_level_name": "arn:aws:iam::490306337630:role/SupportUser"
}
],
"groups": [
{
"id": "f454d283-ca87-4a8a-bdbb-df212eca5353",
"access_level_remote_id": "arn:aws:iam::490306337630:role/SupportUser",
"access_level_name": "arn:aws:iam::490306337630:role/SupportUser"
}
],
"reason": "<string>",
"duration_minutes": 0,
"target_user_id": "userd283-ca87-4a8a-bdbb-df212eca5353",
"target_group_id": "userd283-ca87-4a8a-bdbb-df212eca5353",
"custom_metadata": [
{
"name": "<string>",
"value": "<string>"
}
]
}
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({
resources: [
{
id: 'group283-ca87-4a8a-bdbb-df212eca5353',
access_level_remote_id: 'arn:aws:iam::490306337630:role/SupportUser',
access_level_name: 'arn:aws:iam::490306337630:role/SupportUser'
}
],
groups: [
{
id: 'f454d283-ca87-4a8a-bdbb-df212eca5353',
access_level_remote_id: 'arn:aws:iam::490306337630:role/SupportUser',
access_level_name: 'arn:aws:iam::490306337630:role/SupportUser'
}
],
reason: '<string>',
duration_minutes: 0,
target_user_id: 'userd283-ca87-4a8a-bdbb-df212eca5353',
target_group_id: 'userd283-ca87-4a8a-bdbb-df212eca5353',
custom_metadata: [{name: '<string>', value: '<string>'}]
})
};
fetch('https://api.opal.dev/v1/requests', 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/requests",
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([
'resources' => [
[
'id' => 'group283-ca87-4a8a-bdbb-df212eca5353',
'access_level_remote_id' => 'arn:aws:iam::490306337630:role/SupportUser',
'access_level_name' => 'arn:aws:iam::490306337630:role/SupportUser'
]
],
'groups' => [
[
'id' => 'f454d283-ca87-4a8a-bdbb-df212eca5353',
'access_level_remote_id' => 'arn:aws:iam::490306337630:role/SupportUser',
'access_level_name' => 'arn:aws:iam::490306337630:role/SupportUser'
]
],
'reason' => '<string>',
'duration_minutes' => 0,
'target_user_id' => 'userd283-ca87-4a8a-bdbb-df212eca5353',
'target_group_id' => 'userd283-ca87-4a8a-bdbb-df212eca5353',
'custom_metadata' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
]),
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/requests"
payload := strings.NewReader("{\n \"resources\": [\n {\n \"id\": \"group283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"groups\": [\n {\n \"id\": \"f454d283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"reason\": \"<string>\",\n \"duration_minutes\": 0,\n \"target_user_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"target_group_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"custom_metadata\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\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/requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resources\": [\n {\n \"id\": \"group283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"groups\": [\n {\n \"id\": \"f454d283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"reason\": \"<string>\",\n \"duration_minutes\": 0,\n \"target_user_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"target_group_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"custom_metadata\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/requests")
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 \"resources\": [\n {\n \"id\": \"group283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"groups\": [\n {\n \"id\": \"f454d283-ca87-4a8a-bdbb-df212eca5353\",\n \"access_level_remote_id\": \"arn:aws:iam::490306337630:role/SupportUser\",\n \"access_level_name\": \"arn:aws:iam::490306337630:role/SupportUser\"\n }\n ],\n \"reason\": \"<string>\",\n \"duration_minutes\": 0,\n \"target_user_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"target_group_id\": \"userd283-ca87-4a8a-bdbb-df212eca5353\",\n \"custom_metadata\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "4baf8423-db0a-4037-a4cf-f79c60cb67a5"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Resources to be updated
All the information needed for creating a request
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The duration of the request in minutes. -1 represents an indefinite duration
Required range:
x >= -1The ID of the user to be granted access. Should not be specified if target_group_id is specified.
Example:
"userd283-ca87-4a8a-bdbb-df212eca5353"
The ID of the group the request is for. Should not be specified if target_user_id is specified.
Example:
"userd283-ca87-4a8a-bdbb-df212eca5353"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
200 - application/json
The resulting request.
Example:
"4baf8423-db0a-4037-a4cf-f79c60cb67a5"
Last modified on July 23, 2026
Was this page helpful?
⌘I