curl --request PUT \
--url https://api.opal.dev/v1/groups/{group_id}/reviewer-stages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"stages": [
{
"owner_ids": [
"7870617d-e72a-47f5-a84c-693817ab4567",
"1520617d-e72a-47f5-a84c-693817ab48ad2"
],
"service_user_ids": [
"7870617d-e72a-47f5-a84c-693817ab4568"
]
}
]
}
'import requests
url = "https://api.opal.dev/v1/groups/{group_id}/reviewer-stages"
payload = { "stages": [
{
"owner_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"],
"service_user_ids": ["7870617d-e72a-47f5-a84c-693817ab4568"]
}
] }
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({
stages: [
{
owner_ids: [
'7870617d-e72a-47f5-a84c-693817ab4567',
'1520617d-e72a-47f5-a84c-693817ab48ad2'
],
service_user_ids: ['7870617d-e72a-47f5-a84c-693817ab4568']
}
]
})
};
fetch('https://api.opal.dev/v1/groups/{group_id}/reviewer-stages', 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/groups/{group_id}/reviewer-stages",
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([
'stages' => [
[
'owner_ids' => [
'7870617d-e72a-47f5-a84c-693817ab4567',
'1520617d-e72a-47f5-a84c-693817ab48ad2'
],
'service_user_ids' => [
'7870617d-e72a-47f5-a84c-693817ab4568'
]
]
]
]),
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/groups/{group_id}/reviewer-stages"
payload := strings.NewReader("{\n \"stages\": [\n {\n \"owner_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4567\",\n \"1520617d-e72a-47f5-a84c-693817ab48ad2\"\n ],\n \"service_user_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4568\"\n ]\n }\n ]\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/groups/{group_id}/reviewer-stages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stages\": [\n {\n \"owner_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4567\",\n \"1520617d-e72a-47f5-a84c-693817ab48ad2\"\n ],\n \"service_user_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4568\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/groups/{group_id}/reviewer-stages")
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 \"stages\": [\n {\n \"owner_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4567\",\n \"1520617d-e72a-47f5-a84c-693817ab48ad2\"\n ],\n \"service_user_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4568\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"owner_ids": [
"7870617d-e72a-47f5-a84c-693817ab4567",
"1520617d-e72a-47f5-a84c-693817ab48ad2"
],
"service_user_ids": [
"7870617d-e72a-47f5-a84c-693817ab4568"
]
}
]Put groups reviewer stages
Sets the list of reviewer stages for a group.
curl --request PUT \
--url https://api.opal.dev/v1/groups/{group_id}/reviewer-stages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"stages": [
{
"owner_ids": [
"7870617d-e72a-47f5-a84c-693817ab4567",
"1520617d-e72a-47f5-a84c-693817ab48ad2"
],
"service_user_ids": [
"7870617d-e72a-47f5-a84c-693817ab4568"
]
}
]
}
'import requests
url = "https://api.opal.dev/v1/groups/{group_id}/reviewer-stages"
payload = { "stages": [
{
"owner_ids": ["7870617d-e72a-47f5-a84c-693817ab4567", "1520617d-e72a-47f5-a84c-693817ab48ad2"],
"service_user_ids": ["7870617d-e72a-47f5-a84c-693817ab4568"]
}
] }
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({
stages: [
{
owner_ids: [
'7870617d-e72a-47f5-a84c-693817ab4567',
'1520617d-e72a-47f5-a84c-693817ab48ad2'
],
service_user_ids: ['7870617d-e72a-47f5-a84c-693817ab4568']
}
]
})
};
fetch('https://api.opal.dev/v1/groups/{group_id}/reviewer-stages', 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/groups/{group_id}/reviewer-stages",
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([
'stages' => [
[
'owner_ids' => [
'7870617d-e72a-47f5-a84c-693817ab4567',
'1520617d-e72a-47f5-a84c-693817ab48ad2'
],
'service_user_ids' => [
'7870617d-e72a-47f5-a84c-693817ab4568'
]
]
]
]),
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/groups/{group_id}/reviewer-stages"
payload := strings.NewReader("{\n \"stages\": [\n {\n \"owner_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4567\",\n \"1520617d-e72a-47f5-a84c-693817ab48ad2\"\n ],\n \"service_user_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4568\"\n ]\n }\n ]\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/groups/{group_id}/reviewer-stages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stages\": [\n {\n \"owner_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4567\",\n \"1520617d-e72a-47f5-a84c-693817ab48ad2\"\n ],\n \"service_user_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4568\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/groups/{group_id}/reviewer-stages")
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 \"stages\": [\n {\n \"owner_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4567\",\n \"1520617d-e72a-47f5-a84c-693817ab48ad2\"\n ],\n \"service_user_ids\": [\n \"7870617d-e72a-47f5-a84c-693817ab4568\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"owner_ids": [
"7870617d-e72a-47f5-a84c-693817ab4567",
"1520617d-e72a-47f5-a84c-693817ab48ad2"
],
"service_user_ids": [
"7870617d-e72a-47f5-a84c-693817ab4568"
]
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the group.
Body
A list of reviewer stages.
Show child attributes
Show child attributes
Response
The updated reviewer stages for this group.
Whether this reviewer stage should require manager approval.
false
The operator of the reviewer stage. Admin and manager approval are also treated as reviewers. A stage that sets escalation must use OR; AND is rejected there, because the escalation timer joins the stage as an additional reviewer and would otherwise become a required approver that stalls every request until the timeout.
AND, OR "AND"
The IDs of owners assigned as reviewers for this stage.
Whether this reviewer stage should require admin approval.
false
The IDs of service users assigned as reviewers for this stage.
Escalation for a reviewer stage. When set, the request advances to the reviewers named here if nobody responds within delay_minutes. Timely approval by any of the stage's own reviewers resolves the stage without escalating.
owner_ids and user_ids name only who to escalate to; the stage's own reviewers are added automatically and must not be repeated here. A stage with owner_ids [X] escalating to Y sets escalation.owner_ids to [Y], and reviewing after escalation is then open to both X and Y.
Because the stage's reviewers are unioned in rather than copied, removing someone from the stage also removes them from the escalation. At least one owner or user named here must not already be a reviewer of the stage.
Show child attributes
Show child attributes
{
"delay_minutes": 60,
"owner_ids": ["7870617d-e72a-47f5-a84c-693817ab4569"]
}
Was this page helpful?