---
title: "List files with lineage"
method: GET
path: "/resources/files"
tags: ["Files"]
---

# List files with lineage

`GET /resources/files`

## Request

- Base URL: `https://api.varg.ai/v2`
- URL: `https://api.varg.ai/v2/resources/files`
- Auth: HTTP bearer

Lists uploads and generated files in one list, newest first, each with
its lineage (tool, model, prompt, cost) and favorite flag. Compared to
`GET /files` it can filter by folder, creator and favorites. Uploads
have `lineage: null`.

Multi-value filters (`kind`, `tool`) accept repeated parameters or a
comma-separated value and are OR-combined. A malformed `created_by` or
`creator_api_key_id` is ignored rather than rejected.

## Query parameters

- `kind` string[]
- `tool` string[]
- `search` string
- `workspace` string
- `favorites` boolean
- `created_by` string, uuid
- `creator_api_key_id` string, uuid
- `from` string, date-time
- `to` string, date-time
- `limit` integer
- `cursor` integer

## Response `200`

Page of files

- ResourceFileList
  - `data` ResourceFile[], required
    - `id` string
    - `source` 'attachment' | 'gateway': `gateway` for generated files, `attachment` for uploads.
    - `url` string
    - `filename` string, nullable
    - `title` string, nullable
    - `subtitle` string, nullable
    - `media_type` string, nullable
    - `size` integer, nullable
    - `created_at` string, date-time
    - `hash` string, nullable
    - `thumbnail_url` string, nullable
    - `origin` 'upload' | 'generated'
    - `created_by` string, uuid, nullable
    - `created_by_profile` object, nullable
      - `display_name` string, nullable
      - `avatar_url` string, nullable
    - `creator_type` 'user' | 'api_key' | 'system' | 'null', nullable
    - `created_by_api_key` object, nullable: The API key the file was created through. Only set when `creator_type` is `api_key`.
      - `id` string, uuid
      - `key_preview` string
      - `name` string, nullable
    - `metadata` object, nullable
    - `lineage` ResourceLineage: The job that produced a file. Detail responses carry extra fields (`provider`, `breakdown`, `created_at`, `file`).
      - `job_id` string
      - `tool` string
      - `model` string, nullable
      - `prompt` string, nullable
      - `provider` string, nullable
      - `cost_cents` integer, nullable
      - `parent_job_id` string, nullable
      - `root_job_id` string, nullable
      - `children_count` integer
      - `total_cost_cents` integer, nullable: Cost of this job plus every sub-generation it spawned.
      - `children_by_tool` object[]
        - `tool` string
        - `count` integer
        - `cost_cents` integer
      - `breakdown` object[]: Per-job cost lines behind `total_cost_cents`. Only on the detail endpoint, and only when the job has children.
        - `job_id` string
        - `tool` string
        - `model` string, nullable
        - `status` string, nullable
        - `cost_cents` integer
        - `is_root` boolean
      - `output_count` integer: Total files the job produced.
      - `output_index` integer, nullable: 1-based position of this file among the job's outputs.
      - `primary_file_id` string, nullable
      - `created_at` string, date-time
      - `input` object
      - `file` object
    - `is_favorite` boolean
  - `nextCursor` integer, nullable, required

## Other responses

- `401`: Missing or invalid API key / JWT
- `404`: Unknown folder (or not owned by the caller)

## Changes

- **2026-10-20** `43bcf5ea398d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/varg/apis/varg-api/changes/resources/files/get.md)

---

[API](https://skmtc.dev/varg/apis/varg-api.md) · [All operations](https://skmtc.dev/varg/apis/varg-api/llms.txt) · [OpenAPI document](https://skmtc.dev/varg/apis/varg-api/revisions/09d49a6d852f?raw)
