For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
SDKsHelp CenterLog inSign up
    • Overview
  • Getting Started
    • API Mechanics
    • Quickstart
  • Guides
    • Communications API
    • Troubleshooting
    • Events
    • Changelog
  • Comms API Reference
      • Summary
      • POSTSend Emails
      • GETList Emails
      • GETFetch an Email
      • DELDelete
      • GETFetch an Email Operation
      • GETList Email Operations
LogoLogo
SDKsHelp CenterLog inSign up
Comms API ReferenceEmails

List Emails

GET
https://comms.twilio.com/v1/Emails
GET
/v1/Emails
1import { TwilioClient } from "twilio-comms";
2
3async function main() {
4 const client = new TwilioClient({
5 accountId: "YOUR_ACCOUNTID_HERE",
6 authToken: "YOUR_AUTHTOKEN_HERE",
7 });
8 await client.emails.list({});
9}
10main();
1{
2 "emails": [
3 {
4 "createdAt": "2023-08-24T14:15:22Z",
5 "deletedAt": null,
6 "from": {
7 "address": "support@example.com",
8 "name": "Cool Support"
9 },
10 "id": "comms_email_01h9krwprkeee8fzqspvwy6nq8",
11 "related": [],
12 "scheduledFor": null,
13 "status": "DELIVERED",
14 "tags": {},
15 "to": [
16 {
17 "address": "janedoe@example.com",
18 "name": "Jane Doe"
19 }
20 ],
21 "updatedAt": "2023-08-24T14:15:22Z",
22 "content": {
23 "subject": "An Introduction",
24 "text": "Hello, World!",
25 "html": "<html><body>Hello, World!</body></html>",
26 "attachments": []
27 }
28 },
29 {
30 "createdAt": "2023-08-24T14:15:22Z",
31 "deletedAt": null,
32 "from": {
33 "address": "support@example.com",
34 "name": "Acme Support"
35 },
36 "id": "comms_email_01h9krwprkeee8fzqspvwy6nq8",
37 "related": [],
38 "scheduledFor": null,
39 "status": "DELIVERED",
40 "tags": {},
41 "to": [
42 {
43 "address": "janedoe@example.com",
44 "name": "Jane Doe"
45 }
46 ],
47 "updatedAt": "2023-08-24T14:15:22Z",
48 "content": {
49 "subject": "An Introduction",
50 "text": "Hello, World!",
51 "html": "<html><body>Hello, World!</body></html>",
52 "attachments": []
53 }
54 }
55 ],
56 "pagination": {
57 "next": null,
58 "self": "eyJTSyI6IkEjMDFqbmVoYm5xYWZmNDlrazUxZHA1bmN5bXciLCJTSzEiOiJBI2FjdGl2YXRlZCMyMDI1LTAzLTAzVDE3OjM3OjQ3WiMwMWpuZWhibnFhZmY0OWtrNTFkcDVuY3ltdyIsIlBLIjoiQyNBQzYwMzg4ODJiZDY5ZWIyNGM4YzU4ZGI5NjE4NjE3OTE4I0EifQ=="
59 }
60}

This operation fetches a paginated list of Emails.

Data retention: Records are available for 7 days after creation. Requests for data older than 7 days may return incomplete results.

Was this page helpful?
Previous

Fetch an Email

Next
Built with

Authentication

AuthorizationBasic

Basic authentication of the form Basic <account_id:auth_token>.

OR
AuthorizationBasic

Basic authentication of the form Basic <api_key:api_key_secret>.

Query parameters

operationIdstringOptionalformat: "^comms_operation_[0-7][a-hjkmnpqrstv-z0-9]{25,34}"
Filter to Emails created in a specific Operation.
startDatestringOptionalformat: "date-time"
Filter Emails created after the specified date and time.
endDatestringOptionalformat: "date-time"
Filter Emails created before the specified date and time.
statusenumOptional
Filter Emails by Delivery Status.
tagsstringOptionalformat: "^(?:[a-zA-Z0-9._~-]+:[a-zA-Z0-9._~-]+;){1,10}$"

Match emails by one or many tags. If more than one tag is specified in the query, the search will return emails that have all the tags. For Example: GET /Emails?tags=ageGroup:20s;industry:engineering;

pageTokenstringOptional
The token to retrieve the next page of results.
pageSizeintegerOptional1-1000Defaults to 50
The number of resources to return in a page.

Response

OK
emailslist of objects
paginationobject

Metadata for paginated results. This object contains two tokens to navigate through paginated results.

  • Use next to retrieve the ‘next’ page in the result list.
  • Use self to retrieve the same page of the result list again.
  • Supply the token in the pageToken query param.

Errors

400
Bad Request Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error