# List images

`opensend.images.list(input?)`

The images of the workspace, copied from an address or uploaded, newest first, by status and search.

Needs the scope: `images:read`

## Input

- `q` (string): Text to search for. Only items that contain it are returned. Up to 40 characters.
- `limit` (integer): How many items to return, from 1 to 100. Without it you get 25.
- `offset` (integer): How many items to skip. Use it with `limit` to read the next page. Default: `0`.
- `after` (string): The id of the last item you have. The answer starts with the item that follows it, which reads a long list without skipping or repeating when it changes meanwhile. Up to 64 characters.
- `before` (string): The id of the first item you have. The answer ends with the item just before it. Give this or `after`, not both. Up to 64 characters.
- `status` (string): Only images in this state: `pending`, `ready` or `failed`. One of: `pending`, `ready`, `failed`.

## Returns

The call resolves to the answer, already parsed. A call the API refuses throws `OpenSendError` with the code and the message of the answer. [SDK](https://opensend.sh/docs/sdk) lists the errors of the client itself.

- `object` ("list"): Always `list`.
- `data` (object[]): The items on this page.
- `data[].object` ("image"): Always `image`.
- `data[].id` (string): The id of the image.
- `data[].url` (string | null): The address the image is served at. Emails link it in place of `source` when the image was copied, and it is the address to write in an email when the image was uploaded. `null` until the image is `ready`.
- `data[].source` (string): Where the image came from: the address it was copied from, as it is written in your emails, or the name of the file that was uploaded.
- `data[].origin` (string): How the image got here: `address` when it was copied from an address, `upload` when it was sent as a file. One of: `address`, `upload`.
- `data[].status` (string): `pending` while it waits to be copied, `ready` once it is served, `failed` when it could not be copied. An uploaded image is `ready` at once. One of: `pending`, `ready`, `failed`.
- `data[].type` (string | null): The media type of the image: `image/png`, `image/jpeg`, `image/gif` or `image/webp`. `null` until it is `ready`. One of: `image/png`, `image/jpeg`, `image/gif`, `image/webp`.
- `data[].size` (integer | null): The size of the image in bytes, or `null` until it is `ready`.
- `data[].reason` (string | null): Why the last try to copy it did not work, in words, or `null`.
- `data[].createdAt` (string): When the image was first seen.
- `data[].updatedAt` (string): When it was last copied or tried.
- `total` (integer): How many items match in all, on every page together.
- `hasMore` (boolean): Whether more items follow this page.

## Example

TypeScript:

```ts
await opensend.images.list({
  status: 'ready',
})
```

CLI:

```bash
opensend images list --status ready
```

Answer:

```json
{
  "object": "list",
  "data": [
    {
      "object": "image",
      "id": "img_366370f5fd51b418111aa30a",
      "url": "https://api.opensend.sh/v1/files/img_366370f5fd51b418111aa30a.png",
      "source": "https://cdn.example.com/logo.png",
      "origin": "address",
      "status": "ready",
      "type": "image/png",
      "size": 70,
      "reason": null,
      "createdAt": "2026-11-27T09:30:00.000Z",
      "updatedAt": "2026-11-27T09:30:00.000Z"
    }
  ],
  "total": 1,
  "hasMore": false
}
```
