---
title: "Query Files"
method: POST
path: "/api/v1/beta/files/query"
tags: ["Beta", "Files"]
deprecated: true
---

# Query Files

`POST /api/v1/beta/files/query`

> **Deprecated.**

Query files with filtering and pagination. Deprecated: use `GET /files`.

## Query parameters

- `project_id` string, uuid, nullable
- `organization_id` string, uuid, nullable

## Cookies

- `session` string, nullable

## Request body

- FileQueryRequest — Request schema for querying files with pagination and filtering.
  - `page_size` integer, nullable — The maximum number of items to return. The service may return fewer than this value. If unspecified, a default page size will be used. The maximum value is typically 1000; values above this will be coerced to the maximum.
  - `page_token` string, nullable — A page token, received from a previous list call. Provide this to retrieve the subsequent page.
  - `filter` FileFilter — Filter parameters for file queries.
    - `project_id` string, uuid, nullable — Filter by project ID
    - `file_ids` string[], nullable — Filter by specific file IDs
    - `file_name` string, nullable — Filter by file name
    - `data_source_id` string, uuid, nullable — Filter by data source ID
    - `external_file_id` string, nullable — Filter by external file ID
    - `only_manually_uploaded` boolean, nullable — Filter only manually uploaded files (data_source_id is null)
  - `order_by` string, nullable — A comma-separated list of fields to order by, sorted in ascending order. Use 'field_name desc' to specify descending order.

## Response `200`

Successful Response

- FileQueryResponseV2 — Paginated list of files.
  - `items` FileV2[], required — The list of items.
    - `id` string, required — Unique file identifier
    - `name` string, required — File name including extension
    - `external_file_id` string, nullable — Optional ID for correlating with an external system
    - `file_type` string, nullable — File extension (pdf, docx, png, etc.)
    - `project_id` string, uuid, required — Project this file belongs to
    - `last_modified_at` string, date-time, nullable — When the file was last modified (ISO 8601)
    - `expires_at` string, date-time, nullable — When the file expires and may be automatically removed. Null means no expiration.
    - `purpose` string, nullable — How the file will be used: user_data, parse, extract, classify, split, sheet, or agent_app
    - `download_url` PresignedUrl — Schema for a presigned URL.
      - `url` string, uri, required — A presigned URL for IO operations against a private file
      - `expires_at` string, date-time, required — The time at which the presigned URL expires
      - `form_fields` object, nullable — Form fields for a presigned POST request
  - `next_page_token` string, nullable — A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.
  - `total_size` integer, nullable — The total number of items available. This is only populated when specifically requested. The value may be an estimate and can be used for display purposes only.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/run-llama/apis/llama-platform.md) · [All operations](https://skmtc.net/run-llama/apis/llama-platform/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/run-llama/llama-platform/versions/b17341164de9/schema)
