List immutable artifact versions published by a session with cursor pagination.
Endpoint
GET /agents/sessions/{session_id}/artifacts
Lists artifacts published by the specified session with cursor pagination. A successful call returns 200 and a list envelope.
Artifacts require the artifact capability to be enabled for the target workspace and are produced only after a turn completes successfully. After a hosted environment completes a turn, the list returns an empty array if artifact capability is not enabled for the workspace. When the current turn produces no new artifacts, the list can still contain artifacts from earlier turns; use the returned
turn_id to filter the current turn.A session with
environment.type=none has no associated environment, and the artifact list can return 404. Query artifacts after a hosted environment completes a turn.Request parameters
| Field | Required | Type | Description |
|---|---|---|---|
environment_id | No | string | Environment ID, optional, filter by environment |
limit | No | integer | Number of items per page, default 20, range 1–100 |
order | No | string | Sort direction, asc or desc, default desc |
after | No | string | The last_id from the previous page |
before | No | string | Reverse pagination cursor, optional; cannot be used with after |
turn_id or path. Filter the paginated results on the client side.
Request example
Response example
Response fields
| Field | Type | Description |
|---|---|---|
object | string | List object type, fixed as list |
data | array | Artifacts on the current page; can be empty |
first_id | string / null | ID of the first item on the page; null for an empty page |
last_id | string / null | ID of the last item on the page; null for an empty page |
has_more | boolean | Whether the current direction has another page |
id | string | Artifact version ID, not a file_id |
object | string | Artifact object type, fixed as agent.session.artifact |
session_id | string | Owning session |
environment_id | string | Source environment |
turn_id | string | Source turn |
path | string | Full sandbox path when the artifact was generated |
size_bytes | integer | File size in bytes |
created_at | integer | Creation time, Unix seconds |
data item fields:
The list response does not return underlying storage identifiers, signed download URLs, or credentials.
Error codes
| HTTP status | Error type / code | Solution |
|---|---|---|
400 | invalid_request_error / invalid_request_error | Fix limit and order as described in the query parameters, and avoid conflicting pagination parameters |
404 | not_found_error / not_found_error | Use a session ID that exists and is visible in the current workspace |
404 | not_found_error / not_found_error | Use the last_id returned by the previous page in the current collection as the cursor |
{"error":{"type","code","message","param"}}. Gateway errors can use a different structure. Keep the session ID, turn ID, environment ID, and x-request-id for troubleshooting.