Agent sessions
A session is one conversation with agents. The deployment creates it on the first run of a conversation and records every message in it: your prompts, the agents' answers and the tool calls in between. Each execution in the conversation carries the session's id as its session_id. A session also records the client application that started it and, when the conversation started inside a workspace, that workspace's id.
These endpoints only ever return and change your own sessions. Deleting a session hides it rather than erasing it.
The session object
One conversation. Retrieving a single session adds its messages.
Attributes
-
idstringUnique identifier for the session (a UUID).
-
user_idnullable integerId of the user the session belongs to.
-
client_idstringIdentifier of the client application that started the session, for example
web. -
titlenullable stringTitle of the session. Starts as the first 80 characters of the first prompt and can be changed with Rename a session.
-
workspace_idnullable stringId of the workspace the conversation started in, or
nullfor the default workspace. -
deleted_atnullable stringWhen the session was deleted (UTC, ISO 8601), or
null. -
created_atstringWhen the session started (UTC, ISO 8601).
-
updated_atstringWhen the session last changed (UTC, ISO 8601).
-
messagesarray of objectsOnly in Retrieve a session: every message in the session, oldest first.
Show child attributes Hide child attributes
-
idstringUnique identifier for the message.
-
session_idstringId of the session.
-
execution_idnullable stringId of the execution that produced the message.
-
user_idnullable integerId of the user the message belongs to.
-
rolestringWho the message is from.
Possible values-
user -
assistant -
tool -
system
-
-
contentnullable stringText of the message. May be
nullfor an assistant message that only calls tools. -
tool_callsnullable array of objectsTool calls the assistant requested in this message, if any.
-
tool_call_idnullable stringFor
toolmessages, the id of the tool call this message answers. -
created_atstringWhen the message was recorded (UTC, ISO 8601).
-
{
"id": "5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
"user_id": 42,
"client_id": "web",
"title": "Draft the release notes for version 4.2 from this week's merged changes.",
"workspace_id": null,
"deleted_at": null,
"created_at": "2026-09-01T09:29:48.296410",
"updated_at": "2026-09-01T09:30:03.887215"
} List agent sessions
GET /agent-hub-api/api/monitoring/sessions
Returns the caller's sessions, newest first.
Deleted sessions are left out unless include_deleted is true. Filters combine.
- Authentication
- Bearer token How it works
Query parameters
-
limitintegerMaximum number of sessions to return.
-
offsetintegerNumber of sessions to skip.
-
workspace_idstringOnly sessions started in this workspace, which must be one you can see. For the default workspace, sessions started outside any workspace are included too.
-
client_idstringOnly sessions started by this client application.
-
date_fromstringOnly sessions started at or after this time: an ISO 8601 date-time such as
2026-09-01T00:00:00Z, or a date such as2026-09-01. A value that cannot be parsed is ignored. -
date_tostringOnly sessions started at or before this time, in the same formats as
date_from. -
include_deletedbooleanSet to
trueto include sessions you have deleted.
Returns
Returns data, a page of session objects without messages, and pagination with total, limit, offset and has_more.
Errors
- 400
workspace_idis not a UUID. - 404
workspace_idis not a workspace you can see.
curl "$VDF_BASE_URL/agent-hub-api/api/monitoring/sessions?limit=20" \
-H "Authorization: Bearer $VDF_ACCESS_TOKEN" const response = await fetch(`${process.env.VDF_BASE_URL}/agent-hub-api/api/monitoring/sessions?limit=20`, {
headers: {
Authorization: `Bearer ${process.env.VDF_ACCESS_TOKEN}`,
},
});
if (!response.ok) throw new Error(`Request failed with status ${response.status}`);
const data = await response.json(); import os
import requests
response = requests.get(
f"{os.environ['VDF_BASE_URL']}/agent-hub-api/api/monitoring/sessions",
headers={"Authorization": f"Bearer {os.environ['VDF_ACCESS_TOKEN']}"},
params={
"limit": 20,
},
timeout=30,
)
response.raise_for_status()
data = response.json() {
"success": true,
"data": [
{
"id": "5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
"user_id": 42,
"client_id": "web",
"title": "Draft the release notes for version 4.2 from this week's merged changes.",
"workspace_id": null,
"deleted_at": null,
"created_at": "2026-09-01T09:29:48.296410",
"updated_at": "2026-09-01T09:30:03.887215"
}
],
"pagination": {
"total": 1,
"limit": 20,
"offset": 0,
"has_more": false
}
} Retrieve an agent session
GET /agent-hub-api/api/monitoring/sessions/{session_id}
Returns one of the caller's sessions with all of its messages.
Messages are ordered oldest first. A deleted session returns 404.
- Authentication
- Bearer token How it works
Path parameters
-
session_idstring RequiredId of the session.
Returns
Returns data, the session object with its messages.
Errors
- 404 You have no session with this id, or it has been deleted.
curl "$VDF_BASE_URL/agent-hub-api/api/monitoring/sessions/5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58" \
-H "Authorization: Bearer $VDF_ACCESS_TOKEN" const response = await fetch(`${process.env.VDF_BASE_URL}/agent-hub-api/api/monitoring/sessions/5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58`, {
headers: {
Authorization: `Bearer ${process.env.VDF_ACCESS_TOKEN}`,
},
});
if (!response.ok) throw new Error(`Request failed with status ${response.status}`);
const data = await response.json(); import os
import requests
response = requests.get(
f"{os.environ['VDF_BASE_URL']}/agent-hub-api/api/monitoring/sessions/5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
headers={"Authorization": f"Bearer {os.environ['VDF_ACCESS_TOKEN']}"},
timeout=30,
)
response.raise_for_status()
data = response.json() {
"success": true,
"data": {
"id": "5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
"user_id": 42,
"client_id": "web",
"title": "Draft the release notes for version 4.2 from this week's merged changes.",
"workspace_id": null,
"deleted_at": null,
"created_at": "2026-09-01T09:29:48.296410",
"updated_at": "2026-09-01T09:30:03.887215",
"messages": [
{
"id": "7a1e3c5b-9d2f-4e86-b0a4-3c6e8f1d2b95",
"session_id": "5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
"execution_id": "e4a7c2d9-1b3f-4c8e-9a5d-6f2b8e1c3a70",
"user_id": 42,
"role": "user",
"content": "Draft the release notes for version 4.2 from this week's merged changes.",
"tool_calls": null,
"tool_call_id": null,
"created_at": "2026-09-01T09:29:48.310552"
},
{
"id": "d3b5f7a9-1c2e-4d68-8f0b-6a4c2e9d1f37",
"session_id": "5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
"execution_id": "e4a7c2d9-1b3f-4c8e-9a5d-6f2b8e1c3a70",
"user_id": 42,
"role": "assistant",
"content": "## Release 4.2\n\n### Features\n- Added bulk export for invoices.\n\n### Fixes\n- Fixed rounding in quarterly totals.",
"tool_calls": null,
"tool_call_id": null,
"created_at": "2026-09-01T09:30:03.879046"
}
]
}
} Rename an agent session
PATCH /agent-hub-api/api/monitoring/sessions/{session_id}
Changes the title of one of the caller's sessions.
- Authentication
- Bearer token How it works
Path parameters
-
session_idstring RequiredId of the session.
Body parameters application/json
-
titlestringNew title. Runs of whitespace are collapsed to single spaces and the title is cut to 255 characters. An empty or
nulltitle, or leaving it out, clears the title.
Returns
Returns data, the updated session object.
Errors
- 400 The new title could not be saved.
- 404 You have no session with this id, or it has been deleted.
curl -X PATCH "$VDF_BASE_URL/agent-hub-api/api/monitoring/sessions/5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58" \
-H "Authorization: Bearer $VDF_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Release 4.2 notes"
}' const response = await fetch(`${process.env.VDF_BASE_URL}/agent-hub-api/api/monitoring/sessions/5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.VDF_ACCESS_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
title: 'Release 4.2 notes',
}),
});
if (!response.ok) throw new Error(`Request failed with status ${response.status}`);
const data = await response.json(); import os
import requests
response = requests.patch(
f"{os.environ['VDF_BASE_URL']}/agent-hub-api/api/monitoring/sessions/5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
headers={"Authorization": f"Bearer {os.environ['VDF_ACCESS_TOKEN']}"},
json={
"title": "Release 4.2 notes",
},
timeout=30,
)
response.raise_for_status()
data = response.json() {
"success": true,
"data": {
"id": "5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
"user_id": 42,
"client_id": "web",
"title": "Release 4.2 notes",
"workspace_id": null,
"deleted_at": null,
"created_at": "2026-09-01T09:29:48.296410",
"updated_at": "2026-09-02T16:41:25.119874"
}
} Delete an agent session
DEL /agent-hub-api/api/monitoring/sessions/{session_id}
Deletes one of the caller's sessions.
Marks the session deleted: it drops out of List sessions unless include_deleted is true, and can no longer be retrieved or renamed. Deleting a session that is already deleted succeeds.
- Authentication
- Bearer token How it works
Path parameters
-
session_idstring RequiredId of the session.
Returns
Returns success: true once the agent session is deleted.
Errors
- 400 The session could not be deleted.
- 404 You have no session with this id.
curl -X DELETE "$VDF_BASE_URL/agent-hub-api/api/monitoring/sessions/5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58" \
-H "Authorization: Bearer $VDF_ACCESS_TOKEN" const response = await fetch(`${process.env.VDF_BASE_URL}/agent-hub-api/api/monitoring/sessions/5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58`, {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.VDF_ACCESS_TOKEN}`,
},
});
if (!response.ok) throw new Error(`Request failed with status ${response.status}`);
const data = await response.json(); import os
import requests
response = requests.delete(
f"{os.environ['VDF_BASE_URL']}/agent-hub-api/api/monitoring/sessions/5b8e1f3a-2c9d-4a67-b1e4-7f0c3d9a2e58",
headers={"Authorization": f"Bearer {os.environ['VDF_ACCESS_TOKEN']}"},
timeout=30,
)
response.raise_for_status()
data = response.json() {
"success": true
}