> ## Documentation Index
> Fetch the complete documentation index at: https://stashfyle.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List Files

> List all files in your account.

List all files in your account with optional filtering and pagination.

## Query Parameters

<ParamField query="folder" type="string">
  Filter by folder path. Example: `images/avatars`
</ParamField>

<ParamField query="limit" type="integer" default="50">
  Max files to return (1-100).
</ParamField>

<ParamField query="cursor" type="string">
  Pagination cursor from previous response.
</ParamField>

## Response

<ResponseField name="files" type="array" required>
  Array of file objects.
</ResponseField>

<ResponseField name="has_more" type="boolean" required>
  Whether more files exist.
</ResponseField>

<ResponseField name="cursor" type="string">
  Cursor for next page, or `null` if no more.
</ResponseField>

## Example

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.stashfyle.com/v1/files \
    -H "Authorization: Bearer sk_live_xxx"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.stashfyle.com/v1/files', {
    headers: { 'Authorization': 'Bearer sk_live_xxx' }
  });

  const { files, has_more, cursor } = await response.json();
  ```

  ```python Python theme={null}
  response = requests.get(
      'https://api.stashfyle.com/v1/files',
      headers={'Authorization': 'Bearer sk_live_xxx'}
  )

  data = response.json()
  files = data['files']
  ```
</CodeGroup>

```json Response theme={null}
{
  "files": [
    {
      "id": "f_abc123xyz",
      "url": "https://cdn.stashfyle.com/live/user_123/f_abc123xyz/photo.jpg",
      "name": "photo.jpg",
      "folder": null,
      "size": 248000,
      "type": "image/jpeg",
      "private": false,
      "expires_at": null,
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "has_more": true,
  "cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0wMS0xNVQxMDozMDowMFoifQ"
}
```

## Filtering by Folder

```bash theme={null}
curl "https://api.stashfyle.com/v1/files?folder=images/avatars" \
  -H "Authorization: Bearer sk_live_xxx"
```

## Pagination

```bash theme={null}
# First page
curl "https://api.stashfyle.com/v1/files?limit=20" \
  -H "Authorization: Bearer sk_live_xxx"

# Next page using cursor from previous response
curl "https://api.stashfyle.com/v1/files?limit=20&cursor=eyJ..." \
  -H "Authorization: Bearer sk_live_xxx"
```
