---
title: "list_files"
description: "List the files in your mixetape storage, newest first — each with url (r2://…), kind, size, width, height, orientation (vertical/horizontal/square) and duration. Narrow by kind or words in the file name. Returns { files, nextCursor }; pass nextCursor back as cursor for the next page (null on the last). Needs the **storage** permission. Also available as the MCP tool `list_files`."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.mixetape.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: mixetape API › storage

`POST /api/v1/tools/list_files`

List the files in your mixetape storage, newest first — each with url (r2://…), kind, size, width, height, orientation (vertical/horizontal/square) and duration. Narrow by kind or words in the file name. Returns { files, nextCursor }; pass nextCursor back as cursor for the next page (null on the last). Needs the **storage** permission. Also available as the MCP tool `list_files`.

## Authentication

- `apiKey`, http, header `Authorization`

## Request body

_Required._

- `list_files.kind` (array<string>, optional) — Only these kinds
  - one of `"video"`, `"image"`, `"other"`
- `list_files.search` (string, optional) — Words in the file name (case-insensitive)
- `list_files.limit` (number, optional) — Files per page: default 50, max 1000
- `list_files.cursor` (string, optional) — nextCursor from the previous page

## Example request

```json
{
  "kind": [
    "video"
  ],
  "search": "string",
  "limit": 0,
  "cursor": "string"
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://mixetape.com/api/v1/tools/list_files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "kind": [
    "video"
  ],
  "search": "string",
  "limit": 0,
  "cursor": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://mixetape.com/api/v1/tools/list_files';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({kind: ['video'], search: 'string', limit: 0, cursor: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://mixetape.com/api/v1/tools/list_files"

payload = {
    "kind": ["video"],
    "search": "string",
    "limit": 0,
    "cursor": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The tool's result.

#### Example

```json
{
  "result": null
}
```

- `list_files.response.200.result` (unknown, required) — What the tool returns

### 400

The request is invalid; `error` says why.

#### Example

```json
{
  "error": "string"
}
```

- `list_files.response.400.error` (string, required) — What went wrong, in plain words

### 401

No valid API key.

#### Example

```json
{
  "error": "string"
}
```

- `list_files.response.401.error` (string, required) — What went wrong, in plain words

### 403

The key lacks the permission this needs.

#### Example

```json
{
  "error": "string"
}
```

- `list_files.response.403.error` (string, required) — What went wrong, in plain words

### 404

Not found, or not yours.

#### Example

```json
{
  "error": "string"
}
```

- `list_files.response.404.error` (string, required) — What went wrong, in plain words


Source: https://docs.mixetape.com/api/storage/list_files/index.md
