curl --request POST \
--url https://api.opal.dev/v1/delegations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"delegator_user_id": "123e4567-e89b-12d3-a456-426614174000",
"delegate_user_id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"start_time": "2023-10-01T12:00:00.000Z",
"end_time": "2023-10-01T12:00:00.000Z",
"reason": "I need to be out of the office"
}
'import requests
url = "https://api.opal.dev/v1/delegations"
payload = {
"delegator_user_id": "123e4567-e89b-12d3-a456-426614174000",
"delegate_user_id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"start_time": "2023-10-01T12:00:00.000Z",
"end_time": "2023-10-01T12:00:00.000Z",
"reason": "I need to be out of the office"
}
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({
delegator_user_id: '123e4567-e89b-12d3-a456-426614174000',
delegate_user_id: '7c86c85d-0651-43e2-a748-d69d658418e8',
start_time: '2023-10-01T12:00:00.000Z',
end_time: '2023-10-01T12:00:00.000Z',
reason: 'I need to be out of the office'
})
};
fetch('https://api.opal.dev/v1/delegations', 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/delegations",
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([
'delegator_user_id' => '123e4567-e89b-12d3-a456-426614174000',
'delegate_user_id' => '7c86c85d-0651-43e2-a748-d69d658418e8',
'start_time' => '2023-10-01T12:00:00.000Z',
'end_time' => '2023-10-01T12:00:00.000Z',
'reason' => 'I need to be out of the office'
]),
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/delegations"
payload := strings.NewReader("{\n \"delegator_user_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegate_user_id\": \"7c86c85d-0651-43e2-a748-d69d658418e8\",\n \"start_time\": \"2023-10-01T12:00:00.000Z\",\n \"end_time\": \"2023-10-01T12:00:00.000Z\",\n \"reason\": \"I need to be out of the office\"\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/delegations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"delegator_user_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegate_user_id\": \"7c86c85d-0651-43e2-a748-d69d658418e8\",\n \"start_time\": \"2023-10-01T12:00:00.000Z\",\n \"end_time\": \"2023-10-01T12:00:00.000Z\",\n \"reason\": \"I need to be out of the office\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/delegations")
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 \"delegator_user_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegate_user_id\": \"7c86c85d-0651-43e2-a748-d69d658418e8\",\n \"start_time\": \"2023-10-01T12:00:00.000Z\",\n \"end_time\": \"2023-10-01T12:00:00.000Z\",\n \"reason\": \"I need to be out of the office\"\n}"
response = http.request(request)
puts response.read_body{
"id": "4aed3e8a-727b-4d72-8010-3b8710c50bec",
"delegator_user_id": "123e4567-e89b-12d3-a456-426614174000",
"delegate_user_id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"start_time": "2023-10-01T12:00:00.000Z",
"end_time": "2023-10-01T12:00:00.000Z",
"reason": "I need to be out of the office",
"created_at": "2023-10-01T12:00:00.000Z",
"updated_at": "2023-10-01T12:00:00.000Z"
}Post delegations
Creates a new request reviewer delegation to delegate access review requests from one user to another.
curl --request POST \
--url https://api.opal.dev/v1/delegations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"delegator_user_id": "123e4567-e89b-12d3-a456-426614174000",
"delegate_user_id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"start_time": "2023-10-01T12:00:00.000Z",
"end_time": "2023-10-01T12:00:00.000Z",
"reason": "I need to be out of the office"
}
'import requests
url = "https://api.opal.dev/v1/delegations"
payload = {
"delegator_user_id": "123e4567-e89b-12d3-a456-426614174000",
"delegate_user_id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"start_time": "2023-10-01T12:00:00.000Z",
"end_time": "2023-10-01T12:00:00.000Z",
"reason": "I need to be out of the office"
}
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({
delegator_user_id: '123e4567-e89b-12d3-a456-426614174000',
delegate_user_id: '7c86c85d-0651-43e2-a748-d69d658418e8',
start_time: '2023-10-01T12:00:00.000Z',
end_time: '2023-10-01T12:00:00.000Z',
reason: 'I need to be out of the office'
})
};
fetch('https://api.opal.dev/v1/delegations', 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/delegations",
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([
'delegator_user_id' => '123e4567-e89b-12d3-a456-426614174000',
'delegate_user_id' => '7c86c85d-0651-43e2-a748-d69d658418e8',
'start_time' => '2023-10-01T12:00:00.000Z',
'end_time' => '2023-10-01T12:00:00.000Z',
'reason' => 'I need to be out of the office'
]),
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/delegations"
payload := strings.NewReader("{\n \"delegator_user_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegate_user_id\": \"7c86c85d-0651-43e2-a748-d69d658418e8\",\n \"start_time\": \"2023-10-01T12:00:00.000Z\",\n \"end_time\": \"2023-10-01T12:00:00.000Z\",\n \"reason\": \"I need to be out of the office\"\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/delegations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"delegator_user_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegate_user_id\": \"7c86c85d-0651-43e2-a748-d69d658418e8\",\n \"start_time\": \"2023-10-01T12:00:00.000Z\",\n \"end_time\": \"2023-10-01T12:00:00.000Z\",\n \"reason\": \"I need to be out of the office\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/delegations")
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 \"delegator_user_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"delegate_user_id\": \"7c86c85d-0651-43e2-a748-d69d658418e8\",\n \"start_time\": \"2023-10-01T12:00:00.000Z\",\n \"end_time\": \"2023-10-01T12:00:00.000Z\",\n \"reason\": \"I need to be out of the office\"\n}"
response = http.request(request)
puts response.read_body{
"id": "4aed3e8a-727b-4d72-8010-3b8710c50bec",
"delegator_user_id": "123e4567-e89b-12d3-a456-426614174000",
"delegate_user_id": "7c86c85d-0651-43e2-a748-d69d658418e8",
"start_time": "2023-10-01T12:00:00.000Z",
"end_time": "2023-10-01T12:00:00.000Z",
"reason": "I need to be out of the office",
"created_at": "2023-10-01T12:00:00.000Z",
"updated_at": "2023-10-01T12:00:00.000Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for creating a new delegation of access review requests from one user to another.
The ID of the user delegating their access review requests.
"123e4567-e89b-12d3-a456-426614174000"
The ID of the user being delegated to.
"7c86c85d-0651-43e2-a748-d69d658418e8"
The start time of the delegation.
"2023-10-01T12:00:00.000Z"
The end time of the delegation.
"2023-10-01T12:00:00.000Z"
The reason for the delegation.
"I need to be out of the office"
Response
Delegation created successfully.
Delegation Object
Description
The Delegation object represents a delegation of access review requests from one user to another.
Usage Example
List from the GET Delegations endpoint.
Get from the GET Delegation endpoint.
The ID of the delegation.
"4aed3e8a-727b-4d72-8010-3b8710c50bec"
The ID of the user delegating their access review requests.
"123e4567-e89b-12d3-a456-426614174000"
The ID of the user being delegated to.
"7c86c85d-0651-43e2-a748-d69d658418e8"
The start time of the delegation.
"2023-10-01T12:00:00.000Z"
The end time of the delegation.
"2023-10-01T12:00:00.000Z"
The reason for the delegation.
"I need to be out of the office"
The creation time of the delegation.
"2023-10-01T12:00:00.000Z"
The last updated time of the delegation.
"2023-10-01T12:00:00.000Z"
Was this page helpful?