Files

List files in a session

List all files associated with a session, combining uploaded input files and sandbox-generated output files. Results are sorted by creation time and support cursor-based pagination.

get/v1/files

Query parameters

scope_idstring required

Session / container identifier.

Example:session-abc123

Session / container identifier.

limitinteger

Maximum number of files to return per page.

Example:20

Maximum number of files to return per page.

after_idstring nullable

Return files created after this file ID (exclusive). Used for forward pagination.

Example:uploads/data.csv

Return files created after this file ID (exclusive). Used for forward pagination.

before_idstring nullable

Return files created before this file ID (exclusive). Used for backward pagination.

Example:outputs/result.png

Return files created before this file ID (exclusive). Used for backward pagination.

namespacestring

Namespace to list files from. Defaults to 'session'.

Example:session

Namespace to list files from. Defaults to 'session'.

prefixstring nullable

Object-storage-style key prefix filter. When set, only files whose key starts with this prefix are returned (e.g. data/2024/ lists everything uploaded under that virtual folder). Works like S3 list-objects-v2 --prefix. The prefix is matched against the relative upload key, not the full canonical path.

Example:data/2024/

Object-storage-style key prefix filter. When set, only files whose key starts with this prefix are returned (e.g. data/2024/ lists everything uploaded under that virtual folder). Works like S3 list-objects-v2 --prefix. The prefix is matched against the relative upload key, not the full canonical path.

Response

Successful Response

first_idstring nullable

ID of the first file in the current page, used for cursor-based pagination.

last_idstring nullable

ID of the last file in the current page, used for cursor-based pagination.

has_moreboolean

True when there are additional pages of results beyond this one.

Example response

{
  "data": [
    {
      "created_at": "2024-01-15T10:30:00Z",
      "downloadable": false,
      "filename": "data.csv",
      "id": "uploads/data.csv",
      "mime_type": "text/csv",
      "scope": {
        "id": "session-abc123",
        "type": "session"
      },
      "size_bytes": 4096,
      "type": "file"
    }
  ],
  "first_id": "uploads/data.csv",
  "has_more": false,
  "last_id": "outputs/result.png"
}

Changes

Changed in 2 of the 11 revisions of this API.15

  • 4e828cf153c414See the full diff
    • the type response property const value session was removed for the status 200

      response-property-const-removed

    • added the new optional query request parameter namespace

      new-optional-request-parameter

    • added the new optional query request parameter prefix

      new-optional-request-parameter

    • added the optional property data/items/etag to the response with the 200 status

      response-optional-property-added

    • added the optional property data/items/namespace to the response with the 200 status

      response-optional-property-added

    • endpoint added

      endpoint-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog