# List Sent Emails

> GET /emails — list the emails your account has sent, newest first.

`GET /emails`

List the emails your account has sent. The list returns a reference to each email; use an email's `id` to fetch its full body and event log with [GET /emails/:id](https://www.sendping.co/docs/api/emails-get), or its [attachments](https://www.sendping.co/docs/api/emails-list-attachments).

This endpoint returns only emails **sent** by your account. To list emails received by your domains, use [GET /emails/receiving](https://www.sendping.co/docs/api/emails-received-list).

> **Note:** This endpoint is always paginated. See [Pagination](https://www.sendping.co/docs/api/pagination) for navigating with `limit`, `after`, and `before`.

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | number | No | Number of emails to retrieve per page. Default `20`, maximum `100`, minimum `1`. |
| `after` | string | No | The email `id` **after** which more emails are retrieved (the next page). The passed id is not included. Cannot be combined with `before`. |
| `before` | string | No | The email `id` **before** which more emails are retrieved (the previous page). The passed id is not included. Cannot be combined with `after`. |
| `status` | string | No | Return only emails whose current state matches, compared against the same value as `last_event` — e.g. `delivered`, `opened`, `bounced`, `scheduled`, `failed`. |
| `search` | string | No | Case-insensitive substring match on the recipients, subject, or sender. Applied across the whole list, not just the current page. `q` is accepted as an alias. |
| `campaign_id` | string | No | Return only emails sent by that campaign. Takes precedence over `automation_id` and `source` if more than one is supplied. |
| `automation_id` | string | No | Return only emails sent by that automation. Ignored when `campaign_id` is also supplied. |
| `source` | string | No | Pass `source=individual` to return only one-off sends — emails that belong to no campaign and no automation. `source=api` narrows that to sends made with an API key (plus mail sent before the door was recorded), `source=dashboard` to mail composed in the dashboard. Honoured only when neither `campaign_id` nor `automation_id` is supplied. |
| `domain_id` | string | No | Return only emails sent from that sending domain. Composes with the filters above. |
| `folder` | string | No | Mailbox folder: `outbox` (currently sending), `sent`, `scheduled`, or `failed`. Any other value is a 422 — received mail is served by GET /emails/receiving, drafts by GET /email-drafts. Independent of `status` / `last_event`. Official 5.1.1 SDKs and the CLI (`--folder`) forward this query. |

## Request

**Node.js**

```js
import { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

const { data, error } = await mb.emails.list();
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Emails.list
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

$sendping->emails->list();
```

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Emails.list()
```

**Go**

```go
import "github.com/shekhu10/sendping-sdks/sendping-go"

client := sendping.NewClient("mb_xxxxxxxxx")

emails, err := client.Emails.List(nil)
```

**Rust**

```rust
use sendping::SendPing;

let mb = SendPing::new("mb_xxxxxxxxx");

let _emails = mb.emails.list(None).await?;
```

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.emails().list();
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

var resp = await sendping.EmailListAsync();
```

**cURL**

```bash
curl -X GET 'https://www.sendping.co/api/emails' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
sendping emails list
```

## Filter by mailbox folder

Pass `folder` to list by mailbox instead of by delivery `status`. `outbox` is still sending, `sent` has been accepted for delivery, `scheduled` is held for a future send, and `failed` never left SendPing.

**Node.js**

```js
import { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

const { data, error } = await mb.emails.list({ folder: 'outbox' });
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Emails.list({
  "folder": "outbox"
})
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

$sendping->emails->list([
  'folder' => "outbox"
]);
```

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Emails.list({
  "folder": "outbox"
})
```

**Go**

```go
import "github.com/shekhu10/sendping-sdks/sendping-go"

client := sendping.NewClient("mb_xxxxxxxxx")

emails, err := client.Emails.ListFiltered(&sendping.ListEmailsRequest{
    Folder: "outbox",
})
```

**Rust**

```rust
use sendping::{ListEmailsParams, SendPing};

let mb = SendPing::new("mb_xxxxxxxxx");

let params = Some(ListEmailsParams::new().with_folder("outbox"));
let _emails = mb.emails.list_filtered(params).await?;
```

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;
import co.sendping.requests.ListEmailsParams;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.emails().list(ListEmailsParams.builder().folder("outbox").build());
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

var resp = await sendping.EmailListAsync(new EmailListOptions { Folder = "outbox" });
```

**cURL**

```bash
curl -X GET 'https://www.sendping.co/api/emails?folder=outbox' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
sendping emails list \
  --folder outbox
```

## Response

A paginated `list` object. Each item in `data` is an email reference with its `id`, addressing, `subject`, `last_event`, and timestamps.

```json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
      "object": "email",
      "message_id": "<111-222-333@email.example.com>",
      "to": ["delivered@example.com"],
      "from": "Acme <hello@yourdomain.com>",
      "created_at": "2026-06-23T22:13:42.674Z",
      "subject": "Hello World",
      "bcc": null,
      "cc": null,
      "reply_to": null,
      "last_event": "delivered",
      "scheduled_at": null
    }
  ]
}
```

## Errors

Returns `validation_error` if `limit` is outside 1–100 or if both `before` and `after` are supplied. A malformed or unknown cursor is **not** an error — it returns an empty page (`data: []`, `has_more: false`). See the [error reference](https://www.sendping.co/docs/api/errors).
