Get HITL status for a run
curl --request GET \
--url https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-statusimport requests
url = "https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-status"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-status', 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.getgranite.ai/api/agent-runs/{run_id}/hitl-status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-status"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-status")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"has_active_manager": true,
"is_paused": true,
"is_cancelled": true,
"pending_requests": [
{
"request_id": "<string>",
"request_type": "<string>",
"data": {},
"created_at": "<string>"
}
],
"stats": {
"run_id": "<string>",
"total_requests": 123,
"pending": 123,
"answered": 123,
"expired": 123,
"cancelled": 123
},
"manager_state": {
"questions": [
"<string>"
],
"approvals": [
"<string>"
],
"is_paused": true,
"pause_reason": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Agent
HITL Status
Get the current Human-in-the-Loop status including pending requests
GET
/
api
/
agent-runs
/
{run_id}
/
hitl-status
Get HITL status for a run
curl --request GET \
--url https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-statusimport requests
url = "https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-status"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-status', 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.getgranite.ai/api/agent-runs/{run_id}/hitl-status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-status"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-status")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getgranite.ai/api/agent-runs/{run_id}/hitl-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"has_active_manager": true,
"is_paused": true,
"is_cancelled": true,
"pending_requests": [
{
"request_id": "<string>",
"request_type": "<string>",
"data": {},
"created_at": "<string>"
}
],
"stats": {
"run_id": "<string>",
"total_requests": 123,
"pending": 123,
"answered": 123,
"expired": 123,
"cancelled": 123
},
"manager_state": {
"questions": [
"<string>"
],
"approvals": [
"<string>"
],
"is_paused": true,
"pause_reason": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Path Parameters
Response
Successful Response
HITL status for a run.
Run ID
Whether an active HITL manager exists
Whether pipeline is paused
Whether pipeline is cancelled
Pending HITL requests
Show child attributes
Show child attributes
HITL statistics
Show child attributes
Show child attributes
Manager state if active
Show child attributes
Show child attributes
⌘I