---
title: "List files in a session"
method: GET
path: "/v1/files"
tags: ["Files"]
---

# List files in a session

`GET /v1/files`

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.

## Query parameters

- `scope_id` string, required — Session / container identifier.
- `limit` integer — Maximum number of files to return per page.
- `after_id` string, nullable — Return files created after this file ID (exclusive). Used for forward pagination.
- `before_id` string, nullable — Return files created before this file ID (exclusive). Used for backward pagination.

## Response `200`

Successful Response

- FileListResponse — Paginated list of files in a session.
  - `data` FileMetadata[] — List of file metadata objects for the current page.
    - `id` string, required — Relative path of the file within the session, e.g. 'uploads/data.csv' or 'outputs/result.png'. Use this value as `file_id` in subsequent requests.
    - `created_at` string, date-time, required — ISO-8601 timestamp when the file was created or last modified.
    - `filename` string, required — Filename derived from the path.
    - `mime_type` string, required — MIME type detected from the file content.
    - `size_bytes` integer, required — File size in bytes.
    - `type` 'file' — Object type discriminator, always 'file'.
    - `downloadable` boolean, required — True for sandbox output files; False for uploaded input files.
    - `scope` FileScope, required — Scope that a file belongs to (always a session).
      - `id` string, required — Session / container identifier that owns this file.
      - `type` 'session' — Object type discriminator, always 'session'.
  - `first_id` string, nullable — ID of the first file in the current page, used for cursor-based pagination.
  - `last_id` string, nullable — ID of the last file in the current page, used for cursor-based pagination.
  - `has_more` boolean — True when there are additional pages of results beyond this one.

## Other responses

- `401` — Unauthorized
- `422` — Validation Error

---

[API](https://skmtc.net/zylon-ai/apis/private-gpt-api.md) · [All operations](https://skmtc.net/zylon-ai/apis/private-gpt-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zylon-ai/private-gpt-api/versions/594fa71dfb90/schema)
