# List files in a folder or search the drive

Returns files in a folder or search the drive, one page at a time.

```http
GET https://api.pozy.ai/v1/files
```

- Area: Email, calendar & files / Files
- Auth: Authorization: Bearer pz_live_...

## Query parameters

- `accountId` (string, required)
- `folderId` (string)
- `q` (string)
- `cursor` (string)
- `limit` (integer)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/files?accountId=696e0b682d0a31188e7a2ba9&limit=50" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/files?accountId=696e0b682d0a31188e7a2ba9&limit=50", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/files",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "limit": 50,
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `data`, array of object
  - `id`, string, required
  - `accountId`, string, required
  - `provider`, string, required: One of `google`, `microsoft`
  - `name`, string, required
  - `kind`, string, required: One of `file`, `folder`
  - `mimeType`, string, required: Can be null
  - `size`, integer, required: Can be null
  - `parentId`, string, required: Can be null
  - `webUrl`, string, required: Can be null
  - `downloadable`, boolean, required
  - `exportMimeType`, string: Can be null
  - `createdAt`, string (date-time), required: Can be null
  - `modifiedAt`, string (date-time), required: Can be null
  - `trashed`, boolean, required
- `pagination`, object
  - `hasMore`, boolean
  - `nextCursor`, string: Can be null

```json
{
  "data": [
    {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "accountId": "696e0b682d0a31188e7a2ba9",
      "provider": "google",
      "name": "Acme",
      "kind": "file",
      "mimeType": "image/jpeg",
      "size": 482133,
      "parentId": "6009d4193e17fdf7d162c048",
      "webUrl": "https://pozy.ai/media/example-1.jpg",
      "downloadable": true,
      "exportMimeType": "image/jpeg",
      "createdAt": "2026-10-02T09:00:00.000Z",
      "modifiedAt": "2026-10-02T09:00:00.000Z",
      "trashed": true
    }
  ],
  "pagination": {
    "hasMore": true,
    "nextCursor": "string"
  }
}
```
