Update scheduled grant
curl --request PUT \
--url https://api.opal.dev/v1/scheduled-grants/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_at": "2026-12-01T17:00:00.000Z",
"duration_minutes": 60
}
'import requests
url = "https://api.opal.dev/v1/scheduled-grants/{id}"
payload = {
"start_at": "2026-12-01T17:00:00.000Z",
"duration_minutes": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({start_at: '2026-12-01T17:00:00.000Z', duration_minutes: 60})
};
fetch('https://api.opal.dev/v1/scheduled-grants/{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/scheduled-grants/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'start_at' => '2026-12-01T17:00:00.000Z',
'duration_minutes' => 60
]),
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/scheduled-grants/{id}"
payload := strings.NewReader("{\n \"start_at\": \"2026-12-01T17:00:00.000Z\",\n \"duration_minutes\": 60\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.opal.dev/v1/scheduled-grants/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_at\": \"2026-12-01T17:00:00.000Z\",\n \"duration_minutes\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/scheduled-grants/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_at\": \"2026-12-01T17:00:00.000Z\",\n \"duration_minutes\": 60\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"start_at": "2026-12-01T17:00:00.000Z",
"expiration": "2023-11-07T05:31:56Z",
"duration_minutes": 123,
"principal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"principal_type": "GROUP",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_type": "GROUP",
"access_level_remote_id": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"failed_at": "2023-11-07T05:31:56Z",
"failed_reason": "<string>"
}Update scheduled grant
Sets when a pending scheduled grant starts and how long its access lasts. Requires permission to edit the assignments of the grant’s resource or group. Only grants added directly by an admin can be updated; a grant created by approving a request keeps its approved window, so cancel the request and submit a new one instead.
PUT
/
scheduled-grants
/
{id}
Update scheduled grant
curl --request PUT \
--url https://api.opal.dev/v1/scheduled-grants/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_at": "2026-12-01T17:00:00.000Z",
"duration_minutes": 60
}
'import requests
url = "https://api.opal.dev/v1/scheduled-grants/{id}"
payload = {
"start_at": "2026-12-01T17:00:00.000Z",
"duration_minutes": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({start_at: '2026-12-01T17:00:00.000Z', duration_minutes: 60})
};
fetch('https://api.opal.dev/v1/scheduled-grants/{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/scheduled-grants/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'start_at' => '2026-12-01T17:00:00.000Z',
'duration_minutes' => 60
]),
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/scheduled-grants/{id}"
payload := strings.NewReader("{\n \"start_at\": \"2026-12-01T17:00:00.000Z\",\n \"duration_minutes\": 60\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.opal.dev/v1/scheduled-grants/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_at\": \"2026-12-01T17:00:00.000Z\",\n \"duration_minutes\": 60\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/scheduled-grants/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_at\": \"2026-12-01T17:00:00.000Z\",\n \"duration_minutes\": 60\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"start_at": "2026-12-01T17:00:00.000Z",
"expiration": "2023-11-07T05:31:56Z",
"duration_minutes": 123,
"principal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"principal_type": "GROUP",
"entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entity_type": "GROUP",
"access_level_remote_id": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"failed_at": "2023-11-07T05:31:56Z",
"failed_reason": "<string>"
}Authorizations
Body
application/json
When a scheduled grant starts and how long its access lasts.
Response
The updated scheduled grant.
Approved access waiting for its start time. The recipient has no access until start_at.
Was this page helpful?