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
      • GETList Emails
      • POSTSend Emails
      • GETFetch an Email
      • GETList Email Operations
      • GETFetch an Email Operation
      • POSTSearch Emails
LogoLogo
SDKsHelp CenterLog inSign up
Comms API ReferenceEmails

Search Emails

POST
https://comms.twilio.com/preview/Emails/Search
POST
/preview/Emails/Search
$curl -X POST https://comms.twilio.com/preview/Emails/Search \
> -H "Content-Type: application/json" \
> -u "<accountId>:<authToken>" \
> -d '{
> "address": "dude@example.com"
>}'
1{
2 "emails": [
3 {
4 "id": "comms_email_01h9krwprkeee8fzqspvwy6nq8",
5 "from": {
6 "address": "support@example.com",
7 "name": "Cool Support",
8 "profileId": "mem_profile_01h9krwprkeee8fzqspvwy6nq8",
9 "memoryStoreId": "mem_store_00000000000000000000000000",
10 "senderId": "comms_sender_01h9krwprkeee8fzqspvwy6nq8"
11 },
12 "to": [
13 {
14 "address": "janedoe@example.com",
15 "name": "Jane Doe",
16 "profileId": "mem_profile_01h9krwprkeee8fzqspvwy6nq8",
17 "memoryStoreId": "mem_store_00000000000000000000000000"
18 }
19 ],
20 "status": "OPENED",
21 "related": [],
22 "tags": {},
23 "scheduledFor": null,
24 "createdAt": "2023-08-24T14:15:22Z",
25 "updatedAt": "2023-08-24T14:15:22Z",
26 "deletedAt": null,
27 "replyTo": [],
28 "cc": [
29 {
30 "address": "jane.doe@example.com",
31 "name": "Jane Doe",
32 "profileId": "mem_profile_01h9krwprkeee8fzqspvwy6nq8",
33 "memoryStoreId": "mem_store_00000000000000000000000000"
34 }
35 ],
36 "bcc": [],
37 "content": {
38 "subject": "An Introduction",
39 "text": "Hello, World!",
40 "html": "<html><body>Hello, World!</body></html>",
41 "attachments": []
42 }
43 },
44 {
45 "id": "comms_email_01h9krwprkeee8fzqspvwy6nq8",
46 "from": {
47 "address": "support@example.com",
48 "name": "Acme Support",
49 "profileId": "mem_profile_01h9krwprkeee8fzqspvwy6nq8",
50 "memoryStoreId": "mem_store_00000000000000000000000000",
51 "senderId": "comms_sender_01h9krwprkeee8fzqspvwy6nq8"
52 },
53 "to": [
54 {
55 "address": "janedoe@example.com",
56 "name": "Jane Doe",
57 "profileId": "mem_profile_01h9krwprkeee8fzqspvwy6nq8",
58 "memoryStoreId": "mem_store_00000000000000000000000000"
59 }
60 ],
61 "status": "OPENED",
62 "related": [],
63 "tags": {},
64 "scheduledFor": null,
65 "createdAt": "2023-08-24T14:15:22Z",
66 "updatedAt": "2023-08-24T14:15:22Z",
67 "deletedAt": null,
68 "replyTo": [],
69 "cc": [],
70 "bcc": [],
71 "content": {
72 "subject": "An Introduction",
73 "text": "Hello, World!",
74 "html": "<html><body>Hello, World!</body></html>",
75 "attachments": []
76 }
77 }
78 ],
79 "pagination": {
80 "next": null,
81 "self": "eyJTSyI6IkEjMDFqbmVoYm5xYWZmNDlrazUxZHA1bmN5bXciLCJTSzEiOiJBI2FjdGl2YXRlZCMyMDI1LTAzLTAzVDE3OjM3OjQ3WiMwMWpuZWhibnFhZmY0OWtrNTFkcDVuY3ltdyIsIlBLIjoiQyNBQzYwMzg4ODJiZDY5ZWIyNGM4YzU4ZGI5NjE4NjE3OTE4I0EifQ=="
82 }
83}

Search for Emails based on the specified criteria.

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

Messages

Next
Built with

Authentication

AuthorizationBasic

Basic authentication of the form Basic <base64(username:password)>.

OR
AuthorizationBasic

Basic authentication of the form Basic <base64(username:password)>.

Query parameters

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

Request

This endpoint expects an object.
operationIdstringOptionalformat: "^comms_operation_[0-7][a-hjkmnpqrstv-z0-9]{25,34}"
Filter Emails by Operation ID.
sessionIdstringOptionalformat: "^comms_session_[a-hjkmnpqrstv-z0-9]{26,34}"
Filter Emails by Session ID.
startDatestringOptionalformat: "date-time"
Filter to Emails created after the specified date and time.
endDatestringOptionalformat: "date-time"
Filter to Emails created before the specified date and time.
profilestringOptionalformat: "^mem_profile_[0-7][a-hjkmnpqrstv-z0-9]{25,34}"
Filter Emails sent or received by Profile ID.
addressstringOptional
Filter Emails sent or received from an address.
statusenumOptional
Filter Emails by Delivery Status.
tagsmap from strings to stringsOptional
Match Emails by one or many tags. If more than one tag is specified, the search will return Emails that have all the tags.

Response

OK
emailslist of objects
A list of Emails.
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