cURL
curl -X POST 'https://api.gumloop.com/api/v1/agents/AGENT_ID/evaluations/run' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"session_ids": ["SESSION_ID_1", "SESSION_ID_2"]}'import requests
response = requests.post(
"https://api.gumloop.com/api/v1/agents/AGENT_ID/evaluations/run",
headers={"Authorization": "Bearer YOUR_ACCESS_TOKEN"},
json={"session_ids": ["SESSION_ID_1", "SESSION_ID_2"]},
)
data = response.json()
print(data["queued"], data["skipped"])
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({session_ids: ['int_xyz789', 'int_abc123']})
};
fetch('https://api.gumloop.com/api/v1/agents/{agent_id}/evaluations/run', 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/agents/{agent_id}/evaluations/run",
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([
'session_ids' => [
'int_xyz789',
'int_abc123'
]
]),
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/agents/{agent_id}/evaluations/run"
payload := strings.NewReader("{\n \"session_ids\": [\n \"int_xyz789\",\n \"int_abc123\"\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/agents/{agent_id}/evaluations/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session_ids\": [\n \"int_xyz789\",\n \"int_abc123\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gumloop.com/api/v1/agents/{agent_id}/evaluations/run")
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 \"session_ids\": [\n \"int_xyz789\",\n \"int_abc123\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "queued",
"queued": 1,
"skipped": {
"ineligible": [
"int_abc123"
],
"in_flight": []
}
}Run evaluations
Queues an evaluation for each listed session using the agent’s current evaluation configuration. Sessions that are not finished, do not belong to the agent, or already have an evaluation queued or running are skipped and reported. Each queued evaluation consumes credits when it runs. A new result replaces the previous result for that session.
Requires edit access on the agent and a plan with evaluations enabled.
POST
/
agents
/
{agent_id}
/
evaluations
/
run
cURL
curl -X POST 'https://api.gumloop.com/api/v1/agents/AGENT_ID/evaluations/run' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"session_ids": ["SESSION_ID_1", "SESSION_ID_2"]}'import requests
response = requests.post(
"https://api.gumloop.com/api/v1/agents/AGENT_ID/evaluations/run",
headers={"Authorization": "Bearer YOUR_ACCESS_TOKEN"},
json={"session_ids": ["SESSION_ID_1", "SESSION_ID_2"]},
)
data = response.json()
print(data["queued"], data["skipped"])
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({session_ids: ['int_xyz789', 'int_abc123']})
};
fetch('https://api.gumloop.com/api/v1/agents/{agent_id}/evaluations/run', 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/agents/{agent_id}/evaluations/run",
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([
'session_ids' => [
'int_xyz789',
'int_abc123'
]
]),
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/agents/{agent_id}/evaluations/run"
payload := strings.NewReader("{\n \"session_ids\": [\n \"int_xyz789\",\n \"int_abc123\"\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/agents/{agent_id}/evaluations/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session_ids\": [\n \"int_xyz789\",\n \"int_abc123\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gumloop.com/api/v1/agents/{agent_id}/evaluations/run")
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 \"session_ids\": [\n \"int_xyz789\",\n \"int_abc123\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "queued",
"queued": 1,
"skipped": {
"ineligible": [
"int_abc123"
],
"in_flight": []
}
}Authorizations
Path Parameters
ID of the agent that owns the sessions.
Body
application/json
Sessions to evaluate. Duplicates are ignored.
Required array length:
1 - 200 elementsWas this page helpful?
