---
title: "Get reference files linked to a chat"
method: GET
path: "/api/v1/upload/chat-files/{chat_id}"
tags: ["Upload"]
---

# Get reference files linked to a chat

`GET /api/v1/upload/chat-files/{chat_id}`

## Request

- Base URL: `https://backend.caspr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://backend.caspr.ai/api/v1/upload/chat-files/{chat_id}`
- Auth: OAuth 2
  - Password
  - Token URL: `token`

Returns the reference file metadata for a given chat.  Checks Redis first (for files uploaded before the first message is sent), then falls back to the ``chat_files`` table (for files linked after the first ``POST /chat`` message).

## Path parameters

- `chat_id` string, required

## Response `200`

Successful Response

- ChatReferenceFilesResponse: Response for GET /upload/chat-files/{chat_id}
  - `success` boolean, required
  - `source` string, required
  - `files` ChatReferenceFileItem[], required
    - `reference_id` string, required
    - `original_filename` string, nullable
    - `file_size` integer, nullable
    - `file_type` string, nullable
    - `status` string, nullable
    - `created_at` string, nullable

## Other responses

- `422`: Validation Error
- `500`: Internal Server Error

---

[API](https://skmtc.dev/caspr/apis/casper-api.md) - [All operations](https://skmtc.dev/caspr/apis/casper-api/llms.txt) - [OpenAPI document](https://skmtc.dev/caspr/apis/casper-api/revisions/f9765e3aa00c?raw)
