## Search Files

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

Search for files by name.

### Query Parameters

- `organization_id: optional string`

- `project_id: optional string`

### Cookie Parameters

- `session: optional string`

### Body Parameters

- `index_id: string`

  ID of the index to search within.

- `file_name: optional string`

  Exact file name to match.

- `file_name_contains: optional string`

  Substring match on file name (case-insensitive).

- `limit: optional number`

  Maximum number of files to return.

### Returns

- `files: array of object { file_id, file_name }`

  Matching files with names.

  - `file_id: string`

    ID of the file.

  - `file_name: string`

    Display name of the file.

### Example

```http
curl https://api.cloud.llamaindex.ai/api/v1/retrieval/files/search \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
    -d '{
          "index_id": "idx-abc123"
        }'
```

#### Response

```json
{
  "files": [
    {
      "file_id": "file_id",
      "file_name": "file_name"
    }
  ]
}
```
