cURL
curl -X POST 'https://api.gumloop.com/api/v1/sessions/sess_xYz789AbCd/approvals' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"approval_responses": [
{"action_request_id": "areq_9f3k2m", "action": "accept"}
]
}'import requests
url = "https://api.gumloop.com/api/v1/sessions/{session_id}/approvals"
payload = { "approval_responses": [
{
"action_request_id": "areq_9f3k2m",
"reason": "<string>",
"response": { "values": { "email_subject": "Q3 pipeline review" } }
}
] }
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({
approval_responses: [
{
action_request_id: 'areq_9f3k2m',
reason: '<string>',
response: {values: {email_subject: 'Q3 pipeline review'}}
}
]
})
};
fetch('https://api.gumloop.com/api/v1/sessions/{session_id}/approvals', 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.gumloop.com/api/v1/sessions/{session_id}/approvals",
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([
'approval_responses' => [
[
'action_request_id' => 'areq_9f3k2m',
'reason' => '<string>',
'response' => [
'values' => [
'email_subject' => 'Q3 pipeline review'
]
]
]
]
]),
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.gumloop.com/api/v1/sessions/{session_id}/approvals"
payload := strings.NewReader("{\n \"approval_responses\": [\n {\n \"action_request_id\": \"areq_9f3k2m\",\n \"reason\": \"<string>\",\n \"response\": {\n \"values\": {\n \"email_subject\": \"Q3 pipeline review\"\n }\n }\n }\n ]\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.gumloop.com/api/v1/sessions/{session_id}/approvals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"approval_responses\": [\n {\n \"action_request_id\": \"areq_9f3k2m\",\n \"reason\": \"<string>\",\n \"response\": {\n \"values\": {\n \"email_subject\": \"Q3 pipeline review\"\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gumloop.com/api/v1/sessions/{session_id}/approvals")
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 \"approval_responses\": [\n {\n \"action_request_id\": \"areq_9f3k2m\",\n \"reason\": \"<string>\",\n \"response\": {\n \"values\": {\n \"email_subject\": \"Q3 pipeline review\"\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"session": {
"id": "sess_xYz789AbCd",
"agent_id": "abc123DEFghiJKL",
"state": "processing",
"pending_approvals": []
},
"results": [
{
"action_request_id": "areq_9f3k2m",
"action": "accept",
"outcome": "accepted"
}
],
"stream_cursor": null
}Resolve approvals
Answer pending asks on a session that is paused in the approval_required state — tool approvals, human input requests, and checkpoints.
List the pending asks with Retrieve session: each entry in pending_approvals carries the action_request_id to answer, and human_input asks include the questions to fill in via response.values. Resolutions are processed in order; the agent resumes once the pending asks are answered.
POST
/
sessions
/
{session_id}
/
approvals
cURL
curl -X POST 'https://api.gumloop.com/api/v1/sessions/sess_xYz789AbCd/approvals' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"approval_responses": [
{"action_request_id": "areq_9f3k2m", "action": "accept"}
]
}'import requests
url = "https://api.gumloop.com/api/v1/sessions/{session_id}/approvals"
payload = { "approval_responses": [
{
"action_request_id": "areq_9f3k2m",
"reason": "<string>",
"response": { "values": { "email_subject": "Q3 pipeline review" } }
}
] }
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({
approval_responses: [
{
action_request_id: 'areq_9f3k2m',
reason: '<string>',
response: {values: {email_subject: 'Q3 pipeline review'}}
}
]
})
};
fetch('https://api.gumloop.com/api/v1/sessions/{session_id}/approvals', 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.gumloop.com/api/v1/sessions/{session_id}/approvals",
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([
'approval_responses' => [
[
'action_request_id' => 'areq_9f3k2m',
'reason' => '<string>',
'response' => [
'values' => [
'email_subject' => 'Q3 pipeline review'
]
]
]
]
]),
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.gumloop.com/api/v1/sessions/{session_id}/approvals"
payload := strings.NewReader("{\n \"approval_responses\": [\n {\n \"action_request_id\": \"areq_9f3k2m\",\n \"reason\": \"<string>\",\n \"response\": {\n \"values\": {\n \"email_subject\": \"Q3 pipeline review\"\n }\n }\n }\n ]\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.gumloop.com/api/v1/sessions/{session_id}/approvals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"approval_responses\": [\n {\n \"action_request_id\": \"areq_9f3k2m\",\n \"reason\": \"<string>\",\n \"response\": {\n \"values\": {\n \"email_subject\": \"Q3 pipeline review\"\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gumloop.com/api/v1/sessions/{session_id}/approvals")
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 \"approval_responses\": [\n {\n \"action_request_id\": \"areq_9f3k2m\",\n \"reason\": \"<string>\",\n \"response\": {\n \"values\": {\n \"email_subject\": \"Q3 pipeline review\"\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"session": {
"id": "sess_xYz789AbCd",
"agent_id": "abc123DEFghiJKL",
"state": "processing",
"pending_approvals": []
},
"results": [
{
"action_request_id": "areq_9f3k2m",
"action": "accept",
"outcome": "accepted"
}
],
"stream_cursor": null
}Authorizations
Path Parameters
ID of the session with pending approvals.
Body
application/json
Answers to pending asks. Each action_request_id may appear at most once.
Required array length:
1 - 20 elementsShow child attributes
Show child attributes
Response
Resolutions applied. results reports the outcome per ask; session reflects the state after resolution.
Was this page helpful?
⌘I
