---
title: "Get a file with lineage"
method: GET
path: "/resources/files/{id}"
tags: ["Files"]
---

# Get a file with lineage

`GET /resources/files/{id}`

## Request

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

Returns one file with its full lineage, including the cost breakdown of the job tree when the job spawned sub-generations.

## Path parameters

- `id` string, required

## Response `200`

The file

- ResourceFile
  - `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

## Other responses

- `401`: Missing or invalid API key / JWT
- `404`: Unknown file (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/:id/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)
