Skip to main content
GET
/
emails
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.emails.list();
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
      "to": ["delivered@resend.dev"],
      "from": "Acme <onboarding@resend.dev>",
      "created_at": "2023-04-03T22:13:42.674981+00:00",
      "subject": "Hello World",
      "bcc": null,
      "cc": null,
      "reply_to": null,
      "last_event": "delivered",
      "scheduled_at": null
    },
    {
      "id": "3a9f8c2b-1e5d-4f8a-9c7b-2d6e5f8a9c7b",
      "to": ["user@example.com"],
      "from": "Acme <onboarding@resend.dev>",
      "created_at": "2023-04-03T21:45:12.345678+00:00",
      "subject": "Welcome to Acme",
      "bcc": null,
      "cc": null,
      "reply_to": null,
      "last_event": "opened",
      "scheduled_at": null
    }
  ]
}
You can list all emails received by your domain. The list returns references to individual emails. If needed, you can use the id of an email to retrieve the email HTML to plain text using the Retrieve Email endpoint.

Query Parameters

limit
number
Number of emails to retrieve.
  • Default value: 20
  • Maximum value: 100
  • Minimum value: 1
after
string
The ID after which we'll retrieve more emails (for pagination). This ID will not be included in the returned list. Cannot be used with thebefore parameter.
before
string
The ID before which we'll retrieve more emails (for pagination). This ID will not be included in the returned list. Cannot be used with the after parameter.
You can only use either after or before parameter, not both. See our pagination guide for more information.
import { Resend } from 'resend';

const resend = new Resend('re_xxxxxxxxx');

const { data, error } = await resend.emails.list();
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
      "to": ["delivered@resend.dev"],
      "from": "Acme <onboarding@resend.dev>",
      "created_at": "2023-04-03T22:13:42.674981+00:00",
      "subject": "Hello World",
      "bcc": null,
      "cc": null,
      "reply_to": null,
      "last_event": "delivered",
      "scheduled_at": null
    },
    {
      "id": "3a9f8c2b-1e5d-4f8a-9c7b-2d6e5f8a9c7b",
      "to": ["user@example.com"],
      "from": "Acme <onboarding@resend.dev>",
      "created_at": "2023-04-03T21:45:12.345678+00:00",
      "subject": "Welcome to Acme",
      "bcc": null,
      "cc": null,
      "reply_to": null,
      "last_event": "opened",
      "scheduled_at": null
    }
  ]
}
I