Episodes
Episodes API: 2 endpoints under /v1.
Search past episodes
POST /v1/episodes/search
Finds past episodes (consolidated runs) similar to a query. Only episodes the caller is allowed to see are returned. topK defaults to 5 and is clamped to 1 to 50. Requires the read permission.
See also: Consolidation, episodes and procedures.
Request body (EpisodeSearchRequest)
| Field | Type | Description |
|---|---|---|
query | string | Text describing the task to find similar episodes for. |
topK | integer | Number of episodes to return; defaults to 5, clamped to 1 to 50. |
workspaceId | string (uuid) | Workspace to search. |
Responses
| Status | Description |
|---|---|
200 | A list of matching episodes with goal, summary, outcome, success score and time range. |
Example
curl -X POST "$API/v1/episodes/search" \
-H "Authorization: Bearer $KEY" \
-H 'Content-Type: application/json' \
-d '{"topK":10,"workspaceId":"$WS"}'List recent episodes
GET /v1/episodes/{workspaceId}
Returns the workspace's most recent episodes that the caller is allowed to see. limit defaults to 10 and is clamped to 1 to 100. Requires the read permission.
See also: Consolidation, episodes and procedures.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
workspaceId (required) | path | string (uuid) | Workspace to act in. A workspace the credential cannot access returns 404. |
limit | query | integer | Maximum number of items to return. The default and allowed range depend on the endpoint. |
Responses
| Status | Description |
|---|---|
200 | A list of episodes with run ID, agent, goal, summary, outcome, success score and time range. |
Example
curl -X GET "$API/v1/episodes/$WS" \
-H "Authorization: Bearer $KEY"