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

# List Files API

> View all files uploaded to your account with pagination support.

### Request Body

**Content-Type**: `application/json`

```json theme={null}
{
  "pagination": {
    "limit": 10,    // Optional: Number of files to fetch (default: 10)
    "offset": 0     // Optional: Offset for pagination (default: 0)
  },
  "order_dir": "desc"  // Optional: Sort direction - "desc" or "asc"
}
```

### Authentication

Before making requests to the API, you need to obtain your API key from your dashboard.

### Example Request

```json theme={null}

const res = await fetch("https:/https://rag-api-llm.up.railway.app/user_files", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "authorization": apiKey,
  },
  body: JSON.stringify({
    pagination: {
      limit: 10,
      offset: 0
    },
    order_dir: "desc"
  }),
});

```

### Response

```json theme={null}
{
  "success": true,
  "results": [
    {
      "type": "text",
      "file_id": "939b2cd7-56d5-4c44-b491-14bfc202e9a0",
      "created_at": "2025-01-04T03:22:10.713451+00:00",
      "file_name": "test content 4.txt",
      "team_id": "2ce522b2-2045-43ad-ab0a-2f48a9a041e9"
    },
    {
      "type": "pdf",
      "file_id": "4db6b5d7-b199-4bfd-9914-6991cb4ba3b6",
      "created_at": "2025-01-04T02:56:10.252537+00:00",
      "file_name": "1227-2024_WhisperIt-Invoice-Taishi - Invoice.pdf",
      "team_id": "2ce522b2-2045-43ad-ab0a-2f48a9a041e9"
    }
  ],
  "pagination": {
    "offset": 0,
    "limit": 10
  },
  "count": 143
}


```

### Parameters

| Name       | Required | Type   | Description                              |
| ---------- | -------- | ------ | ---------------------------------------- |
| pagination | No       | object | Pagination parameters (limit and offset) |
| order\_dir | No       | string | Sort direction ("desc" or "asc")         |

| Name   | Required | Type    | Description                               |
| ------ | -------- | ------- | ----------------------------------------- |
| limit  | No       | integer | Number of files to fetch (default: 10)    |
| offset | No       | integer | Starting position of results (default: 0) |

### Error Responses

```json theme={null}


{
  "success": false,
  "error": {
    "message": "Invalid API key provided",
    "code": "unauthorized"
  }
}

```

```json theme={null}


{
  "success": false,
  "error": {
    "message": "Invalid pagination parameters",
    "code": "invalid_request"
  }
}
```
