## Find Files

`client.retrieval.find(RetrievalFindParamsparams, RequestOptionsoptions?): PaginatedCursorPost<RetrievalFindResponse>`

**post** `/api/v1/retrieval/files/find`

Search for files by name.

### Parameters

- `params: RetrievalFindParams`

  - `index_id: string`

    Body param: ID of the index to search within.

  - `organization_id?: string | null`

    Query param

  - `project_id?: string | null`

    Query param

  - `file_name?: string | null`

    Body param: Exact file name to match.

  - `file_name_contains?: string | null`

    Body param: Substring match on file name (case-insensitive).

  - `page_size?: number | null`

    Body param: The maximum number of items to return. The service may return fewer than this value. If unspecified, a default page size will be used. The maximum value is typically 1000; values above this will be coerced to the maximum.

  - `page_token?: string | null`

    Body param: A page token, received from a previous list call. Provide this to retrieve the subsequent page.

### Returns

- `RetrievalFindResponse`

  A file returned by find.

  - `file_id: string`

    ID of the file.

  - `file_name: string`

    Display name of the file.

### Example

```typescript
import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const retrievalFindResponse of client.retrieval.find({ index_id: 'idx-abc123' })) {
  console.log(retrievalFindResponse.file_id);
}
```

#### Response

```json
{
  "items": [
    {
      "file_id": "file_id",
      "file_name": "file_name"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
```
