> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://developers.truemed.com/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.truemed.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.truemed.com/_mcp/server.

# List Files

GET https://dev-api.truemed.com/api/v1/files

Returns metadata (including size) for files owned by the authenticated sales channel, optionally filtered by a set of ids and/or a purpose.

Reference: https://developers.truemed.com/api-reference/files/list-file

## Authentication

- `x-truemed-api-key` header (required) — Sales channel API key for merchant server-to-server authentication

## Servers

- `https://dev-api.truemed.com` (Development server, default)
- `https://api.truemed.com` (Production server)

## Request

### Query parameters

- `page` (integer, optional) — Optional field indicating which page to access. Defaults to 1.
- `page_size` (integer, optional) — Optional field indicating the number of records per page. Defaults to 30.
- `ids` (list of string, optional) — Comma-separated file ids to fetch, e.g. id1,id2.
- `purpose` (string, optional) — Restrict to files of this purpose, e.g. dispute_evidence.

## Response

### 200

Successful response

- `files` (list of FileSummary, required) — Files owned by the authenticated sales channel matching the filters.
- `pagination` (PaginationBody, optional, nullable) — A pagination object with information about the current page, page size, total count, and last page.

## Errors

### 400 Bad Request Error

Bad Request

- `error` (enum, required)
  - Allowed values: `TotalAmountInvalid`, `ValidationError`
- `message` (string, required)

### 404 Not Found Error

Not Found

- `error` (enum, required)
  - Allowed values: `NotFound`
- `message` (string, required)

### 405 Method Not Allowed Error

Method Not Allowed

- `error` (enum, required)
  - Allowed values: `MethodNotAllowed`
- `message` (string, required)

### 500 Internal Server Error

Internal Server Error

- `error` (enum, required)
  - Allowed values: `ServerError`
- `message` (string, required)

### 501 Not Implemented Error

Not Implemented

- `error` (enum, required)
  - Allowed values: `NotImplemented`
- `message` (string, required)

## Types

### FileSummary

- `content_type` (string, required) — The file's MIME type, e.g. application/pdf.
- `file_id` (string, required) — The public file identifier.
- `filename` (string, required) — The stored filename.
- `scan_status` (enum, required) — Malware-scan status. Downloads are only available once the file is clean.
  - Allowed values: `pending_scan`, `clean`, `quarantined`
- `size_bytes` (integer, required) — The file size in bytes.

### PaginationBody

- `count` (integer, required) — The total number of items associated with the provided API key.
- `current_page` (integer, required) — The page requested. If none was provided, this will default to 1.
- `last_page` (integer, required) — The last page. You can iterate through pages by providing integers up to last_page in the page parameter.
- `page_size` (integer, required) — The number of items per page applied to this response.

## Examples

**Response**

```json
{
  "files": [
    {
      "content_type": "application/pdf",
      "file_id": "01920a7e-9c3f-7b21-8e4a-2f6b1d0c5a9e",
      "filename": "receipt.pdf",
      "scan_status": "clean",
      "size_bytes": 248193
    }
  ],
  "pagination": {
    "count": 1,
    "current_page": 1,
    "last_page": 1,
    "page_size": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://dev-api.truemed.com/api/v1/files"

querystring = {"ids":"01920a7e-9c3f-7b21-8e4a-2f6b1d0c5a9e,01920a80-1d5e-7f34-9c02-7a3b4e6d8f10"}

headers = {"x-truemed-api-key": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://dev-api.truemed.com/api/v1/files?ids=01920a7e-9c3f-7b21-8e4a-2f6b1d0c5a9e%2C01920a80-1d5e-7f34-9c02-7a3b4e6d8f10';
const options = {method: 'GET', headers: {'x-truemed-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```