Skip to content

The agent sessions that used each credential (owner only), read from the change feed: harness, model, tool calls, row changes, operations and tables, the most recent first.

POST
/datanotes/sessions/
curl --request POST \
--url https://example.com/datanotes/sessions/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "token": "example", "since": "example", "limit": 100 }'

Each session groups the change feed’s events of one credential (owner or a token’s name) and one agent session (compared on its first 16 characters); a credential’s work without a session is one entry with session: null. Hand edits and background work have no credential and are left out. A named token is refused (403), even with maintain.

Media typeapplication/json
object
token

Only this credential: owner or a token’s name.

string
since

ISO date-time: the earliest event to look at. Default: 7 days ago.

string
limit

The most sessions to return.

integer
default: 100 >= 1 <= 1000

Done.

Media typeapplication/json
object
since
required

The earliest time looked at (ISO date-time).

string
sessions
required
Array<object>
object
token
required

The credential: owner or a token’s name.

string
session
required

The session id (its longest form seen); null for work without a session.

string | null
harness
string
model
string
first_at
required
string
last_at
required
string
first_seq
required
integer
last_seq
required
integer
tool_call_count
required
integer
failed_tool_call_count
required
integer
row_change_count
required

Inserts, updates, deletes, moves and unreadable rows.

integer
migration_count
required

Distinct journal operations.

integer
tables
required

The tables of its row changes (sorted).

Array<string>
tools
required

Its tools by calls, most first (at most 20).

Array<object>
object
tool
required
string
call_count
required
integer

Example generated

{
"since": "example",
"sessions": [
{
"token": "example",
"session": "example",
"harness": "example",
"model": "example",
"first_at": "example",
"last_at": "example",
"first_seq": 1,
"last_seq": 1,
"tool_call_count": 1,
"failed_tool_call_count": 1,
"row_change_count": 1,
"migration_count": 1,
"tables": [
"example"
],
"tools": [
{
"tool": "example",
"call_count": 1
}
]
}
]
}

Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Missing or wrong bearer token.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

A named token beyond its permissions (the engine’s administration, tables outside its write patterns, schema changes without ddl).

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Unexpected error.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

The change feed is not running.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}