Skip to main content
GET
JavaScript
Everything an objective did is an event. This endpoint is the durable record of them, in order, with nothing withheld. Streaming is how you watch an objective work. This is how you read what it did.
Events come back oldest first, which is what you want when rendering a transcript. Pass sortOrder: 'desc' for newest first.

This is where tool result bodies live

The stream strips toolResult and toolError down to a bare toolCallId, because a tool returning a megabyte of JSON would otherwise be pushed through every open connection. Here, the full body is attached.
So the pattern for a live UI is: stream to render the timeline as it happens, then read events (or Get a tool call) when a user expands a result.

Every event names its context window

contextWindowId sits on each event, not inside data. On an objective that has compacted, events before and after the compaction carry different window IDs, so you can group a transcript by window and show where the summary took over.
An objective that never filled its window reports a single ID, as above. One that compacted twice reports three, and the contextWindowCompacted events mark the boundaries.

No event-type filter

The endpoint takes limit, cursor, sortOrder, and includeInfo. There is no way to ask the server for only the toolCalled events, so filter on the client:
limit is a page size, not a cap. The SDK iterator pages transparently, so limit: 10 fetches ten per request and still yields every event. Read page.items for exactly one page. includeInfo: true adds info.createdBy, the profile that caused the event. It costs more of your rate limit and tells you nothing about the agent’s work, so skip it on a transcript render.

The seventeen event types

data is a discriminated union: type names the variant, and the payload sits under a key with the same name. { "type": "toolCalled", "toolCalled": {...} }. finalized.output carries the objective’s structured result, when its agent has an outputDefinition. Reading it from the event saves you a fetch.

Events or diagnostics

Both describe an objective after the fact, and they answer different questions.

Stream objective events

The same events, live, with result bodies stripped.

Webhooks

The same events, delivered to you, with retries.

List context windows

What contextWindowId refers to, and what each window cost.

Create an objective

Where the first userMessage comes from.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspaceId
string
required
Example:

"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"

objectiveId
string
required

Objective ID for filtering

Example:

"obj_01HXKD2E5NQM3T9AYWCFQAZGFV"

Query Parameters

limit
integer<int32>

Maximum number of results to return

cursor
string

Pagination cursor from previous response

sortOrder
string

Sort order for results (asc or desc by creation time)

includeInfo
boolean

When set to true you may use more of your alloted API rate-limit

windowId
string

Optional context window ID to filter events by

sinceEventId
string

Optional string to fetch events since an ID

labels
string

Filters by metadata labels. Comma-separated key=value pairs, e.g. "env=prod,team=ai". A resource matches only if every pair matches exactly (AND semantics).

Response

OK

items
object[]
pagination
object

Page carries cursor-based pagination state. There is no total: the cursor walks the result set without ever counting it, and a count would cost a second query on every list.