Skip to main content
PUT
/
sessions
/
{session_id}
/
review
Update Review Status By Sid
curl --request PUT \
  --url https://use.hoop.dev/api/sessions/{session_id}/review \
  --header 'Content-Type: application/json' \
  --data '
{
  "status": "APPROVED",
  "force_review": false,
  "rejection_reason": "This command is not allowed in production."
}
'
import requests

url = "https://use.hoop.dev/api/sessions/{session_id}/review"

payload = {
"status": "APPROVED",
"force_review": False,
"rejection_reason": "This command is not allowed in production."
}
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
status: 'APPROVED',
force_review: false,
rejection_reason: 'This command is not allowed in production.'
})
};

fetch('https://use.hoop.dev/api/sessions/{session_id}/review', 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://use.hoop.dev/api/sessions/{session_id}/review",
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([
'status' => 'APPROVED',
'force_review' => false,
'rejection_reason' => 'This command is not allowed in production.'
]),
CURLOPT_HTTPHEADER => [
"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://use.hoop.dev/api/sessions/{session_id}/review"

payload := strings.NewReader("{\n \"status\": \"APPROVED\",\n \"force_review\": false,\n \"rejection_reason\": \"This command is not allowed in production.\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

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://use.hoop.dev/api/sessions/{session_id}/review")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"APPROVED\",\n \"force_review\": false,\n \"rejection_reason\": \"This command is not allowed in production.\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://use.hoop.dev/api/sessions/{session_id}/review")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"APPROVED\",\n \"force_review\": false,\n \"rejection_reason\": \"This command is not allowed in production.\"\n}"

response = http.request(request)
puts response.read_body
{
  "access_duration": 0,
  "access_request_rule_name": "default-access-request-rule",
  "created_at": "2024-07-25T15:56:35.317601Z",
  "force_approval_groups": [
    "sre-team"
  ],
  "id": "9F9745B4-C77B-4D52-84D3-E24F67E3623C",
  "min_approvals": 2,
  "rejection_reason": "This command is not allowed in production.",
  "review_groups_data": [
    {
      "forced_review": false,
      "group": "sre",
      "id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
      "review_date": "2024-07-25T19:36:41Z",
      "reviewed_by": {
        "email": "john.wick@bad.org",
        "id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
        "name": "John Wick",
        "slack_id": "U053ELZHB53"
      },
      "status": "APPROVED"
    }
  ],
  "revoke_at": "",
  "session": "35DB0A2F-E5CE-4AD8-A308-55C3108956E5",
  "time_window": {
    "configuration": {
      "end_time": "18:00",
      "start_time": "09:00"
    },
    "type": "time_range"
  }
}
{
"message": "the error description"
}
{
"message": "the error description"
}
{
"message": "the error description"
}
{
"message": "the error description"
}

Path Parameters

session_id
string
required

Resource identifier of the session

Body

application/json

The request body resource

status
enum<string>
required

The reviewed status

  • APPROVED - Approve the review resource
  • REJECTED - Reject the review resource
  • REVOKED - Revoke an approved review
Available options:
APPROVED,
REJECTED,
REVOKED
Example:

"APPROVED"

force_review
boolean
Example:

false

rejection_reason
string
Example:

"This command is not allowed in production."

time_window
object

Response

OK

access_duration
integer
default:1800000000000
read-only

The amount of time (nanoseconds) to allow access to the connection. It's valid only for jit type reviews

Example:

0

access_request_rule_name
string
read-only

The name of the access request rule that triggered this review, if null means it was triggered by the review plugin

Example:

"default-access-request-rule"

created_at
string
read-only

The time the resource was created

Example:

"2024-07-25T15:56:35.317601Z"

force_approval_groups
string[]
read-only

Groups that can force approve sessions for this review

Example:
["sre-team"]
id
string<uuid>
read-only

Resource identifier

Example:

"9F9745B4-C77B-4D52-84D3-E24F67E3623C"

min_approvals
integer
read-only

The minimum number of approvals required for this review

Example:

2

rejection_reason
string
read-only

The reason provided by the reviewer when rejecting this review

Example:

"This command is not allowed in production."

review_groups_data
object[]
read-only

Contains the groups that requires to approve this review

revoke_at
string
read-only

The time when this review was revoked

Example:

""

session
string<uuid>
read-only

The id of session

Example:

"35DB0A2F-E5CE-4AD8-A308-55C3108956E5"

status
enum<string>

The status of the review

  • PENDING - The resource is waiting to be reviewed
  • APPROVED - The resource is fully approved
  • REJECTED - The resource is fully rejected
  • REVOKED - The resource was revoked after being approved
  • PROCESSING - The review is being executed
  • EXECUTED - The review was executed
  • UNKNOWN - Unable to know the status of the review
Available options:
PENDING,
APPROVED,
REJECTED,
REVOKED,
PROCESSING,
EXECUTED,
UNKNOWN
time_window
object

The time window configuration that can execute the session

type
enum<string>

The type of the review

  • onetime - Represents a one time execution
  • jit - Represents a time based review
Available options:
onetime,
jit