---
title: "List files"
description: "Every attachment the mailbox holds, sent and received."
url: "https://openemail.uk/docs/api/files/list"
area: "API"
category: "Mailbox"
---

# List files

Every attachment the mailbox holds, sent and received.

`GET /files`

## GET /files

Every attachment the mailbox holds, sent and received.

## Example

Needs `threads:read`, because a file is part of the mail it came on. `q` searches the name and the type, `kind` keeps `image`, `pdf`, `audio`, `video` or `text`, and `sort` is `newest`, `oldest`, `largest` or `name`.

**curl**

```
curl "$OE/files?kind=pdf&sort=largest" -H "$AUTH"
```

**Response**

```
{
  "object": "list",
  "data": [{
      "object": "file",
      "id": "file_6bb640f5b99e47deb758f1f5",
      "filename": "invoice-0912.pdf",
      "mimeType": "application/pdf",
      "sizeBytes": 184233,
      "direction": "inbound",
      "threadId": "thread_2f9b…",
      "messageId": "<CAF7x…@mail.gmail.com>",
      "deliveredTo": "billing@acme.com",
      "createdAt": "2026-09-12T08:41:03.000Z"
    }],
  "hasMore": false,
  "nextCursor": null
}
```

> A key limited to particular addresses or domains sees only the files that arrived at them, the same boundary the thread list uses. A deleted file is not listed.

> The index starts from the day it shipped. Older attachments are still on their messages, where `GET /threads/{id}/messages/{messageId}/attachments` reads them.

> A cursor carries on in the order it was handed out in, and one handed out under another `sort` is a 400 `invalid_cursor`.
