---
title: "Get Rag File"
method: GET
path: "/api/internal/rag/files/{data_source}/{id}"
tags: ["RAG Files"]
---

# Get Rag File

`GET /api/internal/rag/files/{data_source}/{id}`

Download the source file backing a RAG document.

``(data_source, id)`` together identify the file — each source's
document table has an independent autoincrement ID space, so ``id``
alone is ambiguous.

Responses:
    200 — file body + detected mime type.
    404 — no matching document or no file_path on the row.
    502 — S3 download failed.

## Path parameters

- `data_source` 'meeting_minutes' | 'annual_budgets' | 'procurement_guidelines', required — Supported sources for RAG file downloads. Each value matches the key the ML team's ``nationgraph_rag.database_search`` uses in its DATA_MAP. Not every chunk-search endpoint has a backing file — YouTube videos, for example, don't live in S3, so they're not exposed here.
- `id` integer, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/nationgraph/apis/nationgraph-api.md) · [All operations](https://skmtc.net/nationgraph/apis/nationgraph-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nationgraph/nationgraph-api/revisions/85804e68d86d/schema)
