List session events
Requires workspaces:read and agents:read. Events default to newest-first (sort_by=-id) with a limit of 20, so a naive read returns the tail of the conversation in reverse. For polling, pass from_id as an exclusive cursor (id > from_id) so each poll returns only what happened since the last one — event ids are UUIDv7 and therefore time-ordered. The agent’s reply arrives as a runtime_done event whose content.text carries the message; events persist when a turn completes, not while the model is streaming, so a poll during generation returns nothing new until the turn finishes.
A key missing agents:read currently gets a 500, not a filtered 200 or a 403 — serializing an agent task reads details the key isn’t allowed to see, and that read fails loudly instead of being omitted. Grant agents:read alongside workspaces:read for any session that ran an agent.
curl --request GET \
--url https://api.guild.ai/v1/sessions/{session_id}/events \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.guild.ai/v1/sessions/{session_id}/events"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.guild.ai/v1/sessions/{session_id}/events', 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.guild.ai/v1/sessions/{session_id}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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.guild.ai/v1/sessions/{session_id}/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.guild.ai/v1/sessions/{session_id}/events")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.guild.ai/v1/sessions/{session_id}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"level": "INFO",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"type": "<unknown>"
}
],
"pagination": {
"total_count": 123,
"limit": 123,
"offset": 123,
"has_more": true
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
API key: key id as the username, secret as the password. An account API key carries the same scopes as an OAuth token and is checked against the scopes listed under oauth2 on each operation. A trigger API key is limited to its trigger's workspace and reaches only the session operations that list this scheme alongside the oauth2 scopes.
Path Parameters
Query Parameters
Column name to sort by; prefix with '-' for descending order.
Maximum number of items to return.
0 <= x <= 500Number of items to skip before returning results.
0 <= x <= 9223372036854776000Only events after this event ID, e.g. the message you sent
curl --request GET \
--url https://api.guild.ai/v1/sessions/{session_id}/events \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.guild.ai/v1/sessions/{session_id}/events"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.guild.ai/v1/sessions/{session_id}/events', 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.guild.ai/v1/sessions/{session_id}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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.guild.ai/v1/sessions/{session_id}/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.guild.ai/v1/sessions/{session_id}/events")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.guild.ai/v1/sessions/{session_id}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"level": "INFO",
"message": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"type": "<unknown>"
}
],
"pagination": {
"total_count": 123,
"limit": 123,
"offset": 123,
"has_more": true
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}