cURL
curl --request POST \
--url https://api.opal.dev/v1/requests/{id}/deny \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"comment": "Denied due to insufficient justification",
"level": "REGULAR"
}
'import requests
url = "https://api.opal.dev/v1/requests/{id}/deny"
payload = {
"comment": "Denied due to insufficient justification",
"level": "REGULAR"
}
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({comment: 'Denied due to insufficient justification', level: 'REGULAR'})
};
fetch('https://api.opal.dev/v1/requests/{id}/deny', 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/{id}/deny",
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([
'comment' => 'Denied due to insufficient justification',
'level' => 'REGULAR'
]),
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/{id}/deny"
payload := strings.NewReader("{\n \"comment\": \"Denied due to insufficient justification\",\n \"level\": \"REGULAR\"\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/{id}/deny")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"Denied due to insufficient justification\",\n \"level\": \"REGULAR\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/requests/{id}/deny")
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 \"comment\": \"Denied due to insufficient justification\",\n \"level\": \"REGULAR\"\n}"
response = http.request(request)
puts response.read_body{
"request": {
"id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"created_at": "2021-01-06T20:00:00.000Z",
"updated_at": "2021-01-06T20:00:00.000Z",
"requester_id": "c86c85d-0651-43e2-a748-d69d658418e8",
"target_user_id": "r86c85d-0651-43e2-a748-d69d658418e8",
"target_group_id": "r86c85d-0651-43e2-a748-d69d658418e8",
"status": "pending",
"reason": "I need this resource.",
"duration_minutes": 1440,
"request_comments": [
{
"id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"created_at": "2021-01-06T20:00:00.000Z",
"updated_at": "2021-01-06T20:00:00.000Z",
"request_id": "4c86c85d-0651-43e2-a748-d69d658418e8",
"user_id": "c86c85d-0651-43e2-a748-d69d658418e8",
"comment": "This is a comment."
}
],
"reviewer_stages": [
{
"requestedRoleName": "Admin",
"requestedItemName": "AWS Production Account",
"stages": [
{
"stage": 1,
"operator": "AND",
"reviewers": [
{
"id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"status": "PENDING"
}
]
},
{
"stage": 2,
"operator": "OR",
"reviewers": [
{
"id": "8d86c85d-0651-43e2-a748-d69d658418e9",
"status": "APPROVED"
}
]
}
]
}
]
}
}Deny an access request
POST
/
requests
/
{id}
/
deny
cURL
curl --request POST \
--url https://api.opal.dev/v1/requests/{id}/deny \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"comment": "Denied due to insufficient justification",
"level": "REGULAR"
}
'import requests
url = "https://api.opal.dev/v1/requests/{id}/deny"
payload = {
"comment": "Denied due to insufficient justification",
"level": "REGULAR"
}
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({comment: 'Denied due to insufficient justification', level: 'REGULAR'})
};
fetch('https://api.opal.dev/v1/requests/{id}/deny', 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/{id}/deny",
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([
'comment' => 'Denied due to insufficient justification',
'level' => 'REGULAR'
]),
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/{id}/deny"
payload := strings.NewReader("{\n \"comment\": \"Denied due to insufficient justification\",\n \"level\": \"REGULAR\"\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/{id}/deny")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"Denied due to insufficient justification\",\n \"level\": \"REGULAR\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/requests/{id}/deny")
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 \"comment\": \"Denied due to insufficient justification\",\n \"level\": \"REGULAR\"\n}"
response = http.request(request)
puts response.read_body{
"request": {
"id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"created_at": "2021-01-06T20:00:00.000Z",
"updated_at": "2021-01-06T20:00:00.000Z",
"requester_id": "c86c85d-0651-43e2-a748-d69d658418e8",
"target_user_id": "r86c85d-0651-43e2-a748-d69d658418e8",
"target_group_id": "r86c85d-0651-43e2-a748-d69d658418e8",
"status": "pending",
"reason": "I need this resource.",
"duration_minutes": 1440,
"request_comments": [
{
"id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"created_at": "2021-01-06T20:00:00.000Z",
"updated_at": "2021-01-06T20:00:00.000Z",
"request_id": "4c86c85d-0651-43e2-a748-d69d658418e8",
"user_id": "c86c85d-0651-43e2-a748-d69d658418e8",
"comment": "This is a comment."
}
],
"reviewer_stages": [
{
"requestedRoleName": "Admin",
"requestedItemName": "AWS Production Account",
"stages": [
{
"stage": 1,
"operator": "AND",
"reviewers": [
{
"id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"status": "PENDING"
}
]
},
{
"stage": 2,
"operator": "OR",
"reviewers": [
{
"id": "8d86c85d-0651-43e2-a748-d69d658418e9",
"status": "APPROVED"
}
]
}
]
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the request to deny
Body
application/json
Denial parameters
Response
200 - application/json
Request successfully denied
Request Object
Description
The Request object is used to represent a request.
Usage Example
Returned from the GET Requests endpoint.
Show child attributes
Show child attributes
Example:
{
"id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"created_at": "2021-01-06T20:00:00.000Z",
"updated_at": "2021-01-06T20:00:00.000Z",
"requester_id": "c86c85d-0651-43e2-a748-d69d658418e8",
"target_user_id": "r86c85d-0651-43e2-a748-d69d658418e8",
"target_group_id": "r86c85d-0651-43e2-a748-d69d658418e8",
"status": "pending",
"reason": "I need this resource.",
"duration_minutes": 1440,
"request_comments": [
{
"id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"created_at": "2021-01-06T20:00:00.000Z",
"updated_at": "2021-01-06T20:00:00.000Z",
"request_id": "4c86c85d-0651-43e2-a748-d69d658418e8",
"user_id": "c86c85d-0651-43e2-a748-d69d658418e8",
"comment": "This is a comment."
}
],
"reviewer_stages": [
{
"requestedRoleName": "Admin",
"requestedItemName": "AWS Production Account",
"stages": [
{
"stage": 1,
"operator": "AND",
"reviewers": [
{
"id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"status": "PENDING"
}
]
},
{
"stage": 2,
"operator": "OR",
"reviewers": [
{
"id": "8d86c85d-0651-43e2-a748-d69d658418e9",
"status": "APPROVED"
}
]
}
]
}
]
}
Last modified on July 23, 2026
Was this page helpful?
⌘I