---
title: "Get a file"
method: GET
path: "/api/v1/files/{fileId}"
tags: ["Files"]
---

# Get a file

`GET /api/v1/files/{fileId}`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/files/{fileId}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Returns the file's record, including its folder id, resolved path, and stable authenticated contentUrl. Pending (prepared but not yet completed) files are visible here with status pending; deleted files respond 404.

## Path parameters

- `fileId` string, required

## Response `200`

The file record.

- object
  - `id` string, required
  - `name` string, required
  - `contentUrl` string, required: Stable authenticated API URL for opening the file content. It redirects to a short-lived inline storage URL when the file is ready.
  - `folderId` string, nullable, required: The containing folder's id, or null for the root.
  - `path` string, required: The file's full display path, including the file name. Paths change on rename/move; store ids.
  - `kind` 'archive' | 'audio' | 'document' | 'image' | 'other' | 'pdf' | 'spreadsheet' | 'video', required
  - `extension` string, nullable, required
  - `contentType` string, required
  - `sizeBytes` integer, required
  - `status` 'pending' | 'ready', required
  - `createdAt` string, required
  - `updatedAt` string, required

## Other responses

- `401`: Authentication is missing or invalid.
- `404`: The resource was not found.
- `429`: Too many requests; retry after the indicated delay.

---

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