# Email Resource

To send emails, retrieve individual email details, and list emails with filtering, use the **Email** resource. This resource represents an email message sent through the Twilio Email API.

Twilio Email retains data for seven days after creation. Requests for older records may yield incomplete results.

## API Base URL

All URLs in the reference documentation use the following base URL:

```xml
https://comms.twilio.com/v1
```

## Email Properties

<OperationTable type="properties" data={{"x-twilio-version":1,"title":"EmailMetadata","type":"object","description":"The EmailMetadata provides information about the Email. Does not include the Content.","required":["id","from","to","status","related","tags","scheduledFor","createdAt","updatedAt","deletedAt"],"refName":"EmailBase","modelName":"EmailBase","properties":{"id":{"x-twilio-version":1,"title":"EmailId","description":"A reference to an Email.","type":"string","pattern":"^comms_email_[0-7][a-hjkmnpqrstv-z0-9]{25,34}","example":"comms_email_01h9krwprkeee8fzqspvwy6nq8","refName":"EmailId","modelName":""},"from":{"title":"EmailFrom","description":"The sender of the email.","oneOf":[{"x-twilio-version":1,"title":"EmailAddress","description":"An email address and associated name.","type":"object","properties":{"address":{"type":"string","description":"The email address of the person or entity.","format":"email"},"name":{"type":"string","description":"The name of the person or entity."}},"required":["address"],"additionalProperties":false,"refName":"EmailAddress","modelName":"EmailAddress"}]},"to":{"title":"EmailRecipients","description":"The recipients of the email on the `to` line.","type":"array","items":{"oneOf":[{"x-twilio-version":1,"title":"EmailAddress","description":"An email address and associated name.","type":"object","properties":{"address":{"type":"string","description":"The email address of the person or entity.","format":"email"},"name":{"type":"string","description":"The name of the person or entity."}},"required":["address"],"additionalProperties":false,"refName":"EmailAddress","modelName":"EmailAddress"}]}},"status":{"x-twilio-version":1,"title":"EmailStatus","description":"The status of an `Email`. The status can be one of the following:\n- `SCHEDULED` The `Email` is scheduled to be sent by\n  Twilio in the future.\n\n- `QUEUED` The `Email` is queued in Twilio for sending.\n- `SENT` The `Email` has been sent by Twilio.\n- `DELIVERED` The `Email` has been successfully\n    delivered to the recipient.\n\n- `UNDELIVERED` The `Email` was successfully sent by Twilio\n    but has not been delivered to the recipient.\n\n- `OPENED` The `Email` has been opened by the recipient.\n- `FAILED` The `Email` processing failed inside Twilio.\n- `CANCELED` The `Email` was canceled via API request.\n- `INBOUND` The `Email` was received by Twilio from an external source.","type":"string","enum":["SCHEDULED","QUEUED","SENT","DELIVERED","UNDELIVERED","OPENED","FAILED","CANCELED","INBOUND"],"refName":"EmailStatus","modelName":"EmailStatus"},"related":{"description":"A list of resources that are associated with the Email.","type":"array","items":{"x-twilio-version":1,"title":"RelatedResource","type":"object","description":"A reference to a related resource.","refName":"RelatedResource","modelName":"RelatedResource","properties":{"name":{"type":"string","description":"The name of the related resource.","enum":["EMAIL","MESSAGE","PUSH_NOTIFICATION","SESSION","MEDIA","SENDER","SENDER_POOL","OPERATION","ENGAGEMENT","CREDENTIAL","PUSH_NOTIFICATION_APP","PUSH_NOTIFICATION_USER","DEVICE_REGISTRATION"]},"id":{"description":"The identifier of the related resource.","type":"string"},"uri":{"description":"The path to the related resource.","type":"string"}}}},"tags":{"x-twilio-version":1,"title":"Tags","type":"object","description":"Custom metadata in the form of key-value pairs.\nMaximum size of a tag key is 128 characters.\nMaximum size of a tag value is 256 characters.\nThere can be a maximum of 10 key-value pairs.\n\nThis field can be templated with [Liquid](https://shopify.github.io/liquid/).\nSpecify `variables` with each recipient for personalization.","maxProperties":10,"propertyNames":{"type":"string","maxLength":128,"pattern":"^[a-zA-Z0-9._~-]+$"},"refName":"Tags","modelName":"","additionalProperties":{"type":"string","maxLength":256,"pattern":"^[a-zA-Z0-9._~-]+$"}},"scheduledFor":{"description":"The scheduled send time of the `Email`.\nThis field is only present if the `Email` was created with a `schedule`.","type":["string","null"],"format":"date-time"},"createdAt":{"description":"The date and time when the Email was created.","type":"string","format":"date-time"},"updatedAt":{"description":"The date and time when the Email was last updated.","type":"string","format":"date-time"},"deletedAt":{"description":"The date and time when the Email was deleted.","type":["string","null"],"format":"date-time"}}}} />

## Send an Email

`POST https://comms.twilio.com/v1/Emails`

Creates and sends emails to the specified recipients. The API processes requests asynchronously and returns a `202 Accepted` response with an `operationId` you can use to track send status.

The full request size must not exceed 5 MB.

### Request body parameters

```json
{"schema":{"title":"SendEmailsRequest","type":"object","description":"A request to send one or more Emails.","required":["from","to","content"],"properties":{"from":{"title":"SendEmailsRequestFrom","description":"The sending identity to associate with the `Email`.","oneOf":[{"x-twilio-version":1,"title":"EmailAddressSender","description":"An email address and associated name for a sender. The name is required for senders.","type":"object","properties":{"address":{"type":"string","description":"The email address of the person or entity.","format":"email"},"name":{"type":"string","description":"The name of the person or entity."}},"required":["address","name"],"refName":"EmailAddressSender","modelName":"EmailAddressSender"}]},"to":{"title":"SendEmailsRequestTo","type":"array","description":"A list of recipients to send the email(s) to.","minItems":1,"maxItems":10000,"items":{"title":"SendEmailsRecipient","oneOf":[{"title":"SendEmailsAddressRecipient","description":"Specify a recipient using their email address and associated name.","type":"object","properties":{"address":{"type":"string","description":"The email address of the person or entity.","format":"email"},"name":{"type":"string","description":"The name of the person or entity."},"variables":{"x-twilio-version":1,"title":"ContentPersonalization","type":"object","description":"To personalize content for each recipient, supply variables here with values to substitute into any [Liquid](https://shopify.github.io/liquid/) templated content string or pre-stored Content template.","refName":"ContentPersonalization","modelName":"","additionalProperties":{"type":"string"}}},"required":["address"]},{"title":"SendEmailsProfileRecipient","type":"object","description":"Specify a recipient by their Twilio `Profile` identified by ID & Memory Store ID.","properties":{"profileId":{"x-twilio-version":1,"title":"ProfileId","description":"A reference to a Profile","type":"string","pattern":"^mem_profile_[0-7][a-hjkmnpqrstv-z0-9]{25,34}","example":"mem_profile_01h9krwprkeee8fzqspvwy6nq8","refName":"ProfileId","modelName":""},"memoryStoreId":{"x-twilio-version":1,"title":"MemoryStoreId","description":"A reference to a Memory Store","type":"string","pattern":"^mem_store_[0-7][a-hjkmnpqrstv-z0-9]{25,34}","example":"mem_store_00000000000000000000000000","refName":"MemoryStoreId","modelName":""},"variables":{"x-twilio-version":1,"title":"ContentPersonalization","type":"object","description":"To personalize content for each recipient, supply variables here with values to substitute into any [Liquid](https://shopify.github.io/liquid/) templated content string or pre-stored Content template.","refName":"ContentPersonalization","modelName":"","additionalProperties":{"type":"string"}}},"required":["profileId","memoryStoreId"]}]}},"content":{"title":"SendEmailsRequestContent","description":"The content of the Email.\n***\n* Use the [Liquid](https://shopify.github.io/liquid/) templating language for personalization in any text-based field.\n* When using a templated content, use the `variables` field on each recipient to specify the values to substitute.\n* For each variable you specify in your template, you should have a matching key in each recipient's `variables` object.\n* When targeting `Profile` recipients, you may specify `variables` with values that reference stored traits, on the `Profile` -- for example: `${Twilio.Profile.dateLastPurchase}` `${Twilio.Profile.firstName}` or `${Twilio.Profile.myCustomField}`.","oneOf":[{"x-twilio-version":1,"title":"EmailHtmlContent","type":"object","description":"Specify the `text/html` email body.","properties":{"html":{"type":"string","description":"The HTML email body (`text/html` MIME).\n\nThis field can be templated with [Liquid](https://shopify.github.io/liquid/).\nSpecify `variables` with each recipient for personalization."},"text":{"type":"string","description":"The plain-text email body (`text/plain` MIME) for clients that do not support HTML.\nIf none is specified, Twilio will auto-create one from your HTML email body.\n\nThis field can be templated with [Liquid](https://shopify.github.io/liquid/).\nSpecify `variables` with each recipient for personalization."},"subject":{"type":"string","description":"The subject of the email.\n\nThis field can be templated with [Liquid](https://shopify.github.io/liquid/).\nSpecify `variables` with each recipient for personalization."},"attachments":{"x-twilio-version":1,"title":"EmailAttachments","description":"A list of email attachments.","type":"array","refName":"EmailAttachments","modelName":"EmailAttachments","items":{"oneOf":[{"title":"EmailAttachmentsData","type":"object","description":"An email attachment specified by raw data.","properties":{"filename":{"type":"string","minLength":1,"description":"The name of the attachment file."},"contentType":{"type":"string","minLength":1,"description":"The MIME type of the attachment file."},"content":{"type":"string","format":"byte","description":"The base64-encoded content of the attachment file.\n\nNote: Your full request must not exceed 5 MB in size."},"cid":{"title":"EmailAttachmentCid","type":"string","minLength":1,"description":"The Content-ID of the attachment file.\n\nThis is used to reference the attachment inline within the HTML body of the email.\n\nFor example, to reference an image attachment in the HTML body, use:\n`<img src=\"cid:yourContentIdHere\" />`","refName":"EmailAttachmentCid","modelName":""}},"required":["filename","contentType","content"]}]}},"headers":{"title":"EmailHeadersContent","type":"object","description":"Custom email headers as key-value pairs.\nYou may not override the following headers: `x-sg-id`, `x-sg-eid`,\n`received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`,\n`To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`.\n\nThis field can be templated with [Liquid](https://shopify.github.io/liquid/).\nSpecify `variables` with each recipient for personalization.","additionalProperties":{"type":"string"}}},"required":["html","subject"],"refName":"EmailHtmlContent","modelName":"EmailHtmlContent"}]},"tags":{"x-twilio-version":1,"title":"Tags","type":"object","description":"Custom metadata in the form of key-value pairs.\nMaximum size of a tag key is 128 characters.\nMaximum size of a tag value is 256 characters.\nThere can be a maximum of 10 key-value pairs.\n\nThis field can be templated with [Liquid](https://shopify.github.io/liquid/).\nSpecify `variables` with each recipient for personalization.","maxProperties":10,"propertyNames":{"type":"string","maxLength":128,"pattern":"^[a-zA-Z0-9._~-]+$"},"refName":"Tags","modelName":"","additionalProperties":{"type":"string","maxLength":256,"pattern":"^[a-zA-Z0-9._~-]+$"}},"schedule":{"title":"Schedule","description":"A schedule defines *when* a communication will be sent to a recipient.","x-twilio-version":1,"type":"object","minProperties":1,"refName":"Schedule","modelName":"Schedule","additionalProperties":false,"properties":{"sendAt":{"description":"List of expressions for when the communication may be sent.\n\nThe supported expression formats are:\n  - RFC 3339 date-time string. e.g `\"2025-11-11T11:11:00Z\"`\n\nThe maximum time you can schedule a communication is 7 days in the future.\n\nCurrently, you may specify only a single expression.\nIf you specify multiple expressions, only the first will be used.\nSupport for additional scheduling expression formats may be added in the future.","type":"array","items":{"type":"string"}}}},"ipPoolName":{"type":"string","description":"The name of the IP Pool to use for sending Emails.\n\nIf not specified, all dedicated IPs associated with your\naccount will be considered for sending.\n\nIP pools are only available to accounts with dedicated IPs.\n\nThis field can be templated with [Liquid](https://shopify.github.io/liquid/).\nSpecify `variables` with each recipient for personalization.","minLength":2,"maxLength":64}}},"examples":{"SendSimpleEmail":{"x-twilio-version":1,"summary":"Send simple Email","value":{"lang":"json","value":"{\n  \"from\": {\n    \"address\": \"support@example.company.io\",\n    \"name\": \"Cool Co Support\"\n  },\n  \"to\": [\n    {\n      \"address\": \"bob@example.com\",\n      \"name\": \"Bob Smith\"\n    }\n  ],\n  \"content\": {\n    \"subject\": \"Re: Wedding Cake\",\n    \"text\": \"Hey, the cake is ready.\",\n    \"html\": \"<html><body>Hey, <br/><br/><b>Cake</b></body></html>\",\n    \"attachments\": []\n  }\n}","meta":"","code":"{\n  \"from\": {\n    \"address\": \"support@example.company.io\",\n    \"name\": \"Cool Co Support\"\n  },\n  \"to\": [\n    {\n      \"address\": \"bob@example.com\",\n      \"name\": \"Bob Smith\"\n    }\n  ],\n  \"content\": {\n    \"subject\": \"Re: Wedding Cake\",\n    \"text\": \"Hey, the cake is ready.\",\n    \"html\": \"<html><body>Hey, <br/><br/><b>Cake</b></body></html>\",\n    \"attachments\": []\n  }\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"from\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"support@example.company.io\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"Cool Co Support\"","#A5D6FF"],"\n  ",["},","#C9D1D9"],"\n  ",["\"to\"","#7EE787"],[": [","#C9D1D9"],"\n    ",["{","#C9D1D9"],"\n      ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"bob@example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"Bob Smith\"","#A5D6FF"],"\n    ",["}","#C9D1D9"],"\n  ",["],","#C9D1D9"],"\n  ",["\"content\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"subject\"","#7EE787"],[":","#C9D1D9"]," ",["\"Re: Wedding Cake\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"text\"","#7EE787"],[":","#C9D1D9"]," ",["\"Hey, the cake is ready.\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"html\"","#7EE787"],[":","#C9D1D9"]," ",["\"<html><body>Hey, <br/><br/><b>Cake</b></body></html>\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"attachments\"","#7EE787"],[": []","#C9D1D9"],"\n  ",["}","#C9D1D9"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"SendFromToDirectEntitiesWithPersonalization":{"x-twilio-version":1,"summary":"Send from, to direct entities with personalization","value":{"lang":"json","value":"{\n  \"from\": {\n    \"address\": \"support@example.company.io\",\n    \"name\": \"Cool Co Support\"\n  },\n  \"to\": [\n    {\n      \"address\": \"jane.doe@example.com\",\n      \"variables\": {\n        \"firstName\": \"Jane\",\n        \"lastName\": \"Doe\"\n      }\n    },\n    {\n      \"address\": \"john.doe@example.com\",\n      \"variables\": {\n        \"firstName\": \"John\",\n        \"lastName\": \"Doe\"\n      }\n    }\n  ],\n  \"content\": {\n    \"subject\": \"Wedding Cake\",\n    \"text\": \"Hey {{ firstName | default: 'there' }} {{ lastName | default: '' }}, your cake is ready.\",\n    \"html\": \"<html><body>Hey {{ firstName | default: 'there' }} {{ lastName | default: '' }}, your cake is ready.<br/><br/></body></html>\",\n    \"attachments\": []\n  }\n}","meta":"","code":"{\n  \"from\": {\n    \"address\": \"support@example.company.io\",\n    \"name\": \"Cool Co Support\"\n  },\n  \"to\": [\n    {\n      \"address\": \"jane.doe@example.com\",\n      \"variables\": {\n        \"firstName\": \"Jane\",\n        \"lastName\": \"Doe\"\n      }\n    },\n    {\n      \"address\": \"john.doe@example.com\",\n      \"variables\": {\n        \"firstName\": \"John\",\n        \"lastName\": \"Doe\"\n      }\n    }\n  ],\n  \"content\": {\n    \"subject\": \"Wedding Cake\",\n    \"text\": \"Hey {{ firstName | default: 'there' }} {{ lastName | default: '' }}, your cake is ready.\",\n    \"html\": \"<html><body>Hey {{ firstName | default: 'there' }} {{ lastName | default: '' }}, your cake is ready.<br/><br/></body></html>\",\n    \"attachments\": []\n  }\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"from\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"support@example.company.io\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"Cool Co Support\"","#A5D6FF"],"\n  ",["},","#C9D1D9"],"\n  ",["\"to\"","#7EE787"],[": [","#C9D1D9"],"\n    ",["{","#C9D1D9"],"\n      ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"jane.doe@example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"variables\"","#7EE787"],[": {","#C9D1D9"],"\n        ",["\"firstName\"","#7EE787"],[":","#C9D1D9"]," ",["\"Jane\"","#A5D6FF"],[",","#C9D1D9"],"\n        ",["\"lastName\"","#7EE787"],[":","#C9D1D9"]," ",["\"Doe\"","#A5D6FF"],"\n      ",["}","#C9D1D9"],"\n    ",["},","#C9D1D9"],"\n    ",["{","#C9D1D9"],"\n      ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"john.doe@example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"variables\"","#7EE787"],[": {","#C9D1D9"],"\n        ",["\"firstName\"","#7EE787"],[":","#C9D1D9"]," ",["\"John\"","#A5D6FF"],[",","#C9D1D9"],"\n        ",["\"lastName\"","#7EE787"],[":","#C9D1D9"]," ",["\"Doe\"","#A5D6FF"],"\n      ",["}","#C9D1D9"],"\n    ",["}","#C9D1D9"],"\n  ",["],","#C9D1D9"],"\n  ",["\"content\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"subject\"","#7EE787"],[":","#C9D1D9"]," ",["\"Wedding Cake\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"text\"","#7EE787"],[":","#C9D1D9"]," ",["\"Hey {{ firstName | default: 'there' }} {{ lastName | default: '' }}, your cake is ready.\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"html\"","#7EE787"],[":","#C9D1D9"]," ",["\"<html><body>Hey {{ firstName | default: 'there' }} {{ lastName | default: '' }}, your cake is ready.<br/><br/></body></html>\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"attachments\"","#7EE787"],[": []","#C9D1D9"],"\n  ",["}","#C9D1D9"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"SendAScheduledEmail":{"x-twilio-version":1,"summary":"Send a scheduled Email","value":{"lang":"json","value":"{\n  \"from\": {\n    \"address\": \"support@example.company.io\",\n    \"name\": \"Cool Co Support\"\n  },\n  \"to\": [\n    {\n      \"name\": \"John Dough\",\n      \"address\": \"john.dough@examplemail.com\"\n    }\n  ],\n  \"content\": {\n    \"subject\": \"Wedding Cake\",\n    \"text\": \"Hi Mr. Dough, your cake will be ready for pickup tomorrow morning. Thanks for your continued business, we've included a special treat for you!\",\n    \"html\": \"<html><body>Hi Mr. Dough, your cake is ready.<br/><br/> <p>Thanks for your continued business, we've included a special treat for you!</p> </body></html>\",\n    \"attachments\": []\n  },\n  \"schedule\": {\n    \"sendAt\": [\n      \"2023-12-15T14:15:22Z\"\n    ]\n  }\n}","meta":"","code":"{\n  \"from\": {\n    \"address\": \"support@example.company.io\",\n    \"name\": \"Cool Co Support\"\n  },\n  \"to\": [\n    {\n      \"name\": \"John Dough\",\n      \"address\": \"john.dough@examplemail.com\"\n    }\n  ],\n  \"content\": {\n    \"subject\": \"Wedding Cake\",\n    \"text\": \"Hi Mr. Dough, your cake will be ready for pickup tomorrow morning. Thanks for your continued business, we've included a special treat for you!\",\n    \"html\": \"<html><body>Hi Mr. Dough, your cake is ready.<br/><br/> <p>Thanks for your continued business, we've included a special treat for you!</p> </body></html>\",\n    \"attachments\": []\n  },\n  \"schedule\": {\n    \"sendAt\": [\n      \"2023-12-15T14:15:22Z\"\n    ]\n  }\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"from\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"support@example.company.io\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"Cool Co Support\"","#A5D6FF"],"\n  ",["},","#C9D1D9"],"\n  ",["\"to\"","#7EE787"],[": [","#C9D1D9"],"\n    ",["{","#C9D1D9"],"\n      ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"John Dough\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"john.dough@examplemail.com\"","#A5D6FF"],"\n    ",["}","#C9D1D9"],"\n  ",["],","#C9D1D9"],"\n  ",["\"content\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"subject\"","#7EE787"],[":","#C9D1D9"]," ",["\"Wedding Cake\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"text\"","#7EE787"],[":","#C9D1D9"]," ",["\"Hi Mr. Dough, your cake will be ready for pickup tomorrow morning. Thanks for your continued business, we've included a special treat for you!\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"html\"","#7EE787"],[":","#C9D1D9"]," ",["\"<html><body>Hi Mr. Dough, your cake is ready.<br/><br/> <p>Thanks for your continued business, we've included a special treat for you!</p> </body></html>\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"attachments\"","#7EE787"],[": []","#C9D1D9"],"\n  ",["},","#C9D1D9"],"\n  ",["\"schedule\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"sendAt\"","#7EE787"],[": [","#C9D1D9"],"\n      ",["\"2023-12-15T14:15:22Z\"","#A5D6FF"],"\n    ",["]","#C9D1D9"],"\n  ",["}","#C9D1D9"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"SendWithCustomHeaders":{"x-twilio-version":1,"summary":"Send email with custom headers","value":{"lang":"json","value":"{\n  \"from\": {\n    \"address\": \"marketing@example.com\",\n    \"name\": \"Marketing Team\"\n  },\n  \"to\": [\n    {\n      \"address\": \"customer@example.com\",\n      \"name\": \"Valued Customer\"\n    }\n  ],\n  \"content\": {\n    \"subject\": \"Special Offer for You\",\n    \"html\": \"<html><body><h1>Exclusive Deal!</h1><p>Check out our latest offers.</p></body></html>\",\n    \"text\": \"Exclusive Deal! Check out our latest offers.\",\n    \"headers\": {\n      \"X-Campaign-ID\": \"CAMPAIGN-2025-Q1\",\n      \"X-Customer-Segment\": \"VIP\",\n      \"X-Priority\": \"1\"\n    }\n  }\n}","meta":"","code":"{\n  \"from\": {\n    \"address\": \"marketing@example.com\",\n    \"name\": \"Marketing Team\"\n  },\n  \"to\": [\n    {\n      \"address\": \"customer@example.com\",\n      \"name\": \"Valued Customer\"\n    }\n  ],\n  \"content\": {\n    \"subject\": \"Special Offer for You\",\n    \"html\": \"<html><body><h1>Exclusive Deal!</h1><p>Check out our latest offers.</p></body></html>\",\n    \"text\": \"Exclusive Deal! Check out our latest offers.\",\n    \"headers\": {\n      \"X-Campaign-ID\": \"CAMPAIGN-2025-Q1\",\n      \"X-Customer-Segment\": \"VIP\",\n      \"X-Priority\": \"1\"\n    }\n  }\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"from\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"marketing@example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"Marketing Team\"","#A5D6FF"],"\n  ",["},","#C9D1D9"],"\n  ",["\"to\"","#7EE787"],[": [","#C9D1D9"],"\n    ",["{","#C9D1D9"],"\n      ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"customer@example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"Valued Customer\"","#A5D6FF"],"\n    ",["}","#C9D1D9"],"\n  ",["],","#C9D1D9"],"\n  ",["\"content\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"subject\"","#7EE787"],[":","#C9D1D9"]," ",["\"Special Offer for You\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"html\"","#7EE787"],[":","#C9D1D9"]," ",["\"<html><body><h1>Exclusive Deal!</h1><p>Check out our latest offers.</p></body></html>\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"text\"","#7EE787"],[":","#C9D1D9"]," ",["\"Exclusive Deal! Check out our latest offers.\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"headers\"","#7EE787"],[": {","#C9D1D9"],"\n      ",["\"X-Campaign-ID\"","#7EE787"],[":","#C9D1D9"]," ",["\"CAMPAIGN-2025-Q1\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"X-Customer-Segment\"","#7EE787"],[":","#C9D1D9"]," ",["\"VIP\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"X-Priority\"","#7EE787"],[":","#C9D1D9"]," ",["\"1\"","#A5D6FF"],"\n    ",["}","#C9D1D9"],"\n  ",["}","#C9D1D9"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"SendWithIPPool":{"x-twilio-version":1,"summary":"Send email using dedicated IP pool","value":{"lang":"json","value":"{\n  \"from\": {\n    \"address\": \"alerts@example.com\",\n    \"name\": \"Alert System\"\n  },\n  \"to\": [\n    {\n      \"address\": \"admin@example.com\",\n      \"name\": \"System Administrator\"\n    }\n  ],\n  \"content\": {\n    \"subject\": \"System Alert - High Priority\",\n    \"html\": \"<html><body><h1>Alert</h1><p>Immediate attention required.</p></body></html>\"\n  },\n  \"ipPoolName\": \"transactionalPool\"\n}","meta":"","code":"{\n  \"from\": {\n    \"address\": \"alerts@example.com\",\n    \"name\": \"Alert System\"\n  },\n  \"to\": [\n    {\n      \"address\": \"admin@example.com\",\n      \"name\": \"System Administrator\"\n    }\n  ],\n  \"content\": {\n    \"subject\": \"System Alert - High Priority\",\n    \"html\": \"<html><body><h1>Alert</h1><p>Immediate attention required.</p></body></html>\"\n  },\n  \"ipPoolName\": \"transactionalPool\"\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"from\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"alerts@example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"Alert System\"","#A5D6FF"],"\n  ",["},","#C9D1D9"],"\n  ",["\"to\"","#7EE787"],[": [","#C9D1D9"],"\n    ",["{","#C9D1D9"],"\n      ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"admin@example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"System Administrator\"","#A5D6FF"],"\n    ",["}","#C9D1D9"],"\n  ",["],","#C9D1D9"],"\n  ",["\"content\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"subject\"","#7EE787"],[":","#C9D1D9"]," ",["\"System Alert - High Priority\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"html\"","#7EE787"],[":","#C9D1D9"]," ",["\"<html><body><h1>Alert</h1><p>Immediate attention required.</p></body></html>\"","#A5D6FF"],"\n  ",["},","#C9D1D9"],"\n  ",["\"ipPoolName\"","#7EE787"],[":","#C9D1D9"]," ",["\"transactionalPool\"","#A5D6FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}},"SendTemplateWithHeadersAndIPPool":{"x-twilio-version":1,"summary":"Send template-based email with headers and IP pool","value":{"lang":"json","value":"{\n  \"from\": {\n    \"address\": \"newsletter@example.com\",\n    \"name\": \"Newsletter Team\"\n  },\n  \"to\": [\n    {\n      \"address\": \"subscriber@example.com\",\n      \"name\": \"John Subscriber\",\n      \"variables\": {\n        \"firstName\": \"John\"\n      }\n    }\n  ],\n  \"content\": {\n    \"subject\": \"January Newsletter\",\n    \"html\": \"<html><body><h1>Newsletter</h1><p>Greetings {{ firstName | default: 'Subscribers' }}, it's January!</p></body></html>\",\n    \"headers\": {\n      \"X-Newsletter-Edition\": \"2025-01\",\n      \"X-Subscriber-Tier\": \"Premium\"\n    }\n  },\n  \"ipPoolName\": \"marketingPool\",\n  \"tags\": {\n    \"campaign\": \"monthlyNewsletter\",\n    \"edition\": \"january_2025\"\n  }\n}","meta":"","code":"{\n  \"from\": {\n    \"address\": \"newsletter@example.com\",\n    \"name\": \"Newsletter Team\"\n  },\n  \"to\": [\n    {\n      \"address\": \"subscriber@example.com\",\n      \"name\": \"John Subscriber\",\n      \"variables\": {\n        \"firstName\": \"John\"\n      }\n    }\n  ],\n  \"content\": {\n    \"subject\": \"January Newsletter\",\n    \"html\": \"<html><body><h1>Newsletter</h1><p>Greetings {{ firstName | default: 'Subscribers' }}, it's January!</p></body></html>\",\n    \"headers\": {\n      \"X-Newsletter-Edition\": \"2025-01\",\n      \"X-Subscriber-Tier\": \"Premium\"\n    }\n  },\n  \"ipPoolName\": \"marketingPool\",\n  \"tags\": {\n    \"campaign\": \"monthlyNewsletter\",\n    \"edition\": \"january_2025\"\n  }\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"from\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"newsletter@example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"Newsletter Team\"","#A5D6FF"],"\n  ",["},","#C9D1D9"],"\n  ",["\"to\"","#7EE787"],[": [","#C9D1D9"],"\n    ",["{","#C9D1D9"],"\n      ",["\"address\"","#7EE787"],[":","#C9D1D9"]," ",["\"subscriber@example.com\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"name\"","#7EE787"],[":","#C9D1D9"]," ",["\"John Subscriber\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"variables\"","#7EE787"],[": {","#C9D1D9"],"\n        ",["\"firstName\"","#7EE787"],[":","#C9D1D9"]," ",["\"John\"","#A5D6FF"],"\n      ",["}","#C9D1D9"],"\n    ",["}","#C9D1D9"],"\n  ",["],","#C9D1D9"],"\n  ",["\"content\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"subject\"","#7EE787"],[":","#C9D1D9"]," ",["\"January Newsletter\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"html\"","#7EE787"],[":","#C9D1D9"]," ",["\"<html><body><h1>Newsletter</h1><p>Greetings {{ firstName | default: 'Subscribers' }}, it's January!</p></body></html>\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"headers\"","#7EE787"],[": {","#C9D1D9"],"\n      ",["\"X-Newsletter-Edition\"","#7EE787"],[":","#C9D1D9"]," ",["\"2025-01\"","#A5D6FF"],[",","#C9D1D9"],"\n      ",["\"X-Subscriber-Tier\"","#7EE787"],[":","#C9D1D9"]," ",["\"Premium\"","#A5D6FF"],"\n    ",["}","#C9D1D9"],"\n  ",["},","#C9D1D9"],"\n  ",["\"ipPoolName\"","#7EE787"],[":","#C9D1D9"]," ",["\"marketingPool\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"tags\"","#7EE787"],[": {","#C9D1D9"],"\n    ",["\"campaign\"","#7EE787"],[":","#C9D1D9"]," ",["\"monthlyNewsletter\"","#A5D6FF"],[",","#C9D1D9"],"\n    ",["\"edition\"","#7EE787"],[":","#C9D1D9"]," ",["\"january_2025\"","#A5D6FF"],"\n  ",["}","#C9D1D9"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/json","conditionalParameterMap":{}}
```

Send an Email

```ts
import { TwilioClient } from "twilio-comms";

async function main() {
    const client = new TwilioClient({
        accountId: "TWILIO_ACCOUNT_SID",
        authToken: "TWILIO_AUTH_TOKEN",
    });
    await client.emails.send({
        from: {
            address: "support@example.company.io",
            name: "Cool Co Support",
        },
        to: [
            {
                address: "bob@example.com",
                name: "Bob Smith",
            },
        ],
        content: {
            html: "<html><body>Hey, <br/><br/><b>Cake</b></body></html>",
            text: "Hey, the cake is ready.",
            subject: "Re: Wedding Cake",
            attachments: [
                {
                    filename: "filename",
                    contentType: "contentType",
                    content: "content",
                },
            ],
        },
    });
}
main();
```

```py
from twilio_comms import TwilioComms

client = TwilioComms(
    account_id="TWILIO_ACCOUNT_SID",
    auth_token="TWILIO_AUTH_TOKEN",
)

client.emails.send(
    from_={
        "address": "support@example.company.io",
        "name": "Cool Co Support"
    },
    to=[
        {
            "address": "bob@example.com",
            "name": "Bob Smith"
        }
    ],
    content={
        "html": "<html><body>Hey, <br/><br/><b>Cake</b></body></html>",
        "text": "Hey, the cake is ready.",
        "subject": "Re: Wedding Cake",
        "attachments": [
            {
                "filename": "filename",
                "content_type": "contentType",
                "content": "content"
            }
        ]
    },
)
```

```cs
using Twilio.Comms;
using System.Threading.Tasks;
using System.Collections.Generic;
using OneOf;

public partial class Examples
{
    public async Task Example() {
        var client = new TwilioComms(
            accountId: "TWILIO_ACCOUNT_SID",
            authToken: "TWILIO_AUTH_TOKEN"
        );

        await client.Emails.SendAsync(
            new EmailsSendRequest {
                From = new EmailAddressSender {
                    Address = "support@example.company.io",
                    Name = "Cool Co Support"
                },
                To = new List<OneOf<EmailsSendRequestToItemAddress, EmailsSendRequestToItemMemoryStoreId>>(){
                    new EmailsSendRequestToItemAddress {
                        Address = "bob@example.com",
                        Name = "Bob Smith"
                    },
                }
                ,
                Content = new EmailHtmlContent {
                    Html = "<html><body>Hey, <br/><br/><b>Cake</b></body></html>",
                    Text = "Hey, the cake is ready.",
                    Subject = "Re: Wedding Cake",
                    Attachments = new List<EmailAttachmentsItem>(){
                        new EmailAttachmentsItem {
                            Filename = "filename",
                            ContentType = "contentType",
                            Content = "content"
                        },
                    }

                }
            }
        );
    }

}
```

```java
package com.example.usage;

import com.twilio.sdk.TwilioComms;
import com.twilio.sdk.resources.emails.requests.EmailsSendRequest;
import com.twilio.sdk.resources.emails.types.EmailsSendRequestToItem;
import com.twilio.sdk.resources.emails.types.EmailsSendRequestToItemAddress;
import com.twilio.sdk.types.EmailAddressSender;
import com.twilio.sdk.types.EmailAttachmentsItem;
import com.twilio.sdk.types.EmailHtmlContent;
import java.util.Arrays;
import java.util.Optional;

public class Example {
    public static void main(String[] args) {
        TwilioComms client = TwilioComms
            .builder()
            .credentials("TWILIO_ACCOUNT_SID", "TWILIO_AUTH_TOKEN")
            .build();

        client.emails().send(
            EmailsSendRequest
                .builder()
                .from(
                    EmailAddressSender
                        .builder()
                        .address("support@example.company.io")
                        .name("Cool Co Support")
                        .build()
                )
                .content(
                    EmailHtmlContent
                        .builder()
                        .html("<html><body>Hey, <br/><br/><b>Cake</b></body></html>")
                        .subject("Re: Wedding Cake")
                        .text("Hey, the cake is ready.")
                        .attachments(
                            Arrays.asList(
                                EmailAttachmentsItem
                                    .builder()
                                    .filename("filename")
                                    .contentType("contentType")
                                    .content("content")
                                    .build()
                            )
                        )
                        .build()
                )
                .to(
                    Arrays.asList(
                        EmailsSendRequestToItem.of(
                            EmailsSendRequestToItemAddress
                                .builder()
                                .address("bob@example.com")
                                .name(Optional.of("Bob Smith"))
                                .build()
                        )
                    )
                )
                .build()
        );
    }
}
```

```go
package example

import (
    context "context"

    twiliocomms "github.com/twilio/twilio-comms-go/twilio"
    client "github.com/twilio/twilio-comms-go/twilio/client"
    option "github.com/twilio/twilio-comms-go/twilio/option"
)

func do() {
    client := client.NewWithOptions(
        option.WithBasicAuth(
            "TWILIO_ACCOUNT_SID",
            "TWILIO_AUTH_TOKEN",
        ),
    )
    request := &twiliocomms.EmailsSendRequest{
        From: &twiliocomms.EmailAddressSender{
            Address: "support@example.company.io",
            Name: "Cool Co Support",
        },
        To: []*twiliocomms.EmailsSendRequestToItem{
            &twiliocomms.EmailsSendRequestToItem{
                EmailsSendRequestToItemAddress: &twiliocomms.EmailsSendRequestToItemAddress{
                    Address: "bob@example.com",
                    Name: twiliocomms.String(
                        "Bob Smith",
                    ),
                },
            },
        },
        Content: &twiliocomms.EmailHtmlContent{
            Html: "<html><body>Hey, <br/><br/><b>Cake</b></body></html>",
            Text: twiliocomms.String(
                "Hey, the cake is ready.",
            ),
            Subject: "Re: Wedding Cake",
            Attachments: &twiliocomms.EmailAttachments{
                &twiliocomms.EmailAttachmentsItem{
                    Filename: "filename",
                    ContentType: "contentType",
                    Content: "content",
                },
            },
        },
    }
    client.Emails.Send(
        context.TODO(),
        request,
    )
}
```

```php
<?php

namespace Example;

use Twilio\Comms\TwilioComms;
use Twilio\Comms\Emails\Requests\EmailsSendRequest;
use Twilio\Comms\Types\EmailAddressSender;
use Twilio\Comms\Emails\Types\EmailsSendRequestToItemAddress;
use Twilio\Comms\Types\EmailHtmlContent;
use Twilio\Comms\Types\EmailAttachmentsItem;

$client = new TwilioComms(
    accountId: 'TWILIO_ACCOUNT_SID',
    authToken: 'TWILIO_AUTH_TOKEN',
);
$client->emails->send(
    new EmailsSendRequest([
        'from' => new EmailAddressSender([
            'address' => 'support@example.company.io',
            'name' => 'Cool Co Support',
        ]),
        'to' => [
            new EmailsSendRequestToItemAddress([
                'address' => 'bob@example.com',
                'name' => 'Bob Smith',
            ]),
        ],
        'content' => new EmailHtmlContent([
            'html' => '<html><body>Hey, <br/><br/><b>Cake</b></body></html>',
            'text' => 'Hey, the cake is ready.',
            'subject' => 'Re: Wedding Cake',
            'attachments' => [
                new EmailAttachmentsItem([
                    'filename' => 'filename',
                    'contentType' => 'contentType',
                    'content' => 'content',
                ]),
            ],
        ]),
    ]),
);
```

```rb
require "twiliocomms"

client = TwilioComms::Client.new(
  account_id: "TWILIO_ACCOUNT_SID",
  auth_token: "TWILIO_AUTH_TOKEN"
)

client.emails.send_(
  from: {
    address: "support@example.company.io",
    name: "Cool Co Support"
  },
  to: [{
    address: "bob@example.com",
    name: "Bob Smith"
  }],
  content: {
    html: "<html><body>Hey, <br/><br/><b>Cake</b></body></html>",
    text: "Hey, the cake is ready.",
    subject: "Re: Wedding Cake",
    attachments: [{
      filename: "filename",
      content_type: "contentType",
      content: "content"
    }]
  }
)
```

```bash
curl -X POST "https://comms.twilio.com/v1/Emails" \
--header "Content-Type: application/json" \
--data "{
    "from": {
        "address": "support@example.company.io",
        "name": "Cool Co Support"
    },
    "to": [
        {
            "address": "bob@example.com",
            "name": "Bob Smith"
        }
    ],
    "content": {
        "html": "<html><body>Hey, <br/><br/><b>Cake</b></body></html>",
        "text": "Hey, the cake is ready.",
        "subject": "Re: Wedding Cake",
        "attachments": [
            {
                "filename": "filename",
                "contentType": "contentType",
                "content": "content"
            }
        ]
    }
}" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

## Fetch an Email

`GET https://comms.twilio.com/v1/Emails/{emailId}`

Retrieves a single Email based on its ID. Retains records for seven days after creation.

### Path parameters

```json
[{"schema":{"x-twilio-version":1,"title":"EmailId","description":"A reference to an Email.","type":"string","pattern":"^comms_email_[0-7][a-hjkmnpqrstv-z0-9]{25,34}","example":"comms_email_01h9krwprkeee8fzqspvwy6nq8","refName":"EmailId","modelName":""},"x-twilio-version":1,"name":"emailId","in":"path","required":true}]
```

Fetch an Email

```ts
import { TwilioClient } from "twilio-comms";

async function main() {
    const client = new TwilioClient({
        accountId: "TWILIO_ACCOUNT_SID",
        authToken: "TWILIO_AUTH_TOKEN",
    });
    await client.emails.fetch("comms_email_01h9krwprkeee8fzqspvwy6nq8");
}
main();
```

```py
from twilio_comms import TwilioComms

client = TwilioComms(
    account_id="TWILIO_ACCOUNT_SID",
    auth_token="TWILIO_AUTH_TOKEN",
)

client.emails.fetch(
    email_id="comms_email_01h9krwprkeee8fzqspvwy6nq8",
)
```

```cs
using Twilio.Comms;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new TwilioComms(
            accountId: "TWILIO_ACCOUNT_SID",
            authToken: "TWILIO_AUTH_TOKEN"
        );

        await client.Emails.FetchAsync(
            "comms_email_01h9krwprkeee8fzqspvwy6nq8"
        );
    }

}
```

```java
package com.example.usage;

import com.twilio.sdk.TwilioComms;

public class Example {
    public static void main(String[] args) {
        TwilioComms client = TwilioComms
            .builder()
            .credentials("TWILIO_ACCOUNT_SID", "TWILIO_AUTH_TOKEN")
            .build();

        client.emails().fetch("comms_email_01h9krwprkeee8fzqspvwy6nq8");
    }
}
```

```go
package example

import (
    context "context"

    client "github.com/twilio/twilio-comms-go/twilio/client"
    option "github.com/twilio/twilio-comms-go/twilio/option"
)

func do() {
    client := client.NewWithOptions(
        option.WithBasicAuth(
            "TWILIO_ACCOUNT_SID",
            "TWILIO_AUTH_TOKEN",
        ),
    )
    client.Emails.Fetch(
        context.TODO(),
        "comms_email_01h9krwprkeee8fzqspvwy6nq8",
    )
}
```

```php
<?php

namespace Example;

use Twilio\Comms\TwilioComms;

$client = new TwilioComms(
    accountId: 'TWILIO_ACCOUNT_SID',
    authToken: 'TWILIO_AUTH_TOKEN',
);
$client->emails->fetch(
    'comms_email_01h9krwprkeee8fzqspvwy6nq8',
);
```

```rb
require "twiliocomms"

client = TwilioComms::Client.new(
  account_id: "TWILIO_ACCOUNT_SID",
  auth_token: "TWILIO_AUTH_TOKEN"
)

client.emails.fetch(email_id: "comms_email_01h9krwprkeee8fzqspvwy6nq8")
```

```bash
curl -X GET "https://comms.twilio.com/v1/Emails/comms_email_01h9krwprkeee8fzqspvwy6nq8" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

## List Emails

`GET https://comms.twilio.com/v1/Emails`

Returns a paginated list of Emails. Retains data for seven days after creation.

### Query parameters

````json
[{"in":"query","name":"operationId","description":"Filter to Emails created in a specific Operation.","schema":{"x-twilio-version":1,"description":"The Operation ID is an identifier that can be used to correlate all of the\nresources created in a request.\n\nIssue a GET request to the resource list location, using the Operation ID as a query parameter\nto retrieve the resources that correlate with the Operation.","title":"OperationId","type":"string","pattern":"^comms_operation_[0-7][a-hjkmnpqrstv-z0-9]{25,34}","example":"comms_operation_01h9krwprkeee8fzqspvwy6nq8","refName":"OperationId","modelName":""}},{"in":"query","name":"startDate","schema":{"type":"string","format":"date-time"},"description":"Filter Emails created after the specified date and time."},{"in":"query","name":"endDate","schema":{"type":"string","format":"date-time"},"description":"Filter Emails created before the specified date and time."},{"in":"query","name":"status","description":"Filter Emails by Delivery Status.","schema":{"x-twilio-version":1,"title":"EmailStatus","description":"The status of an `Email`. The status can be one of the following:\n- `SCHEDULED` The `Email` is scheduled to be sent by\n  Twilio in the future.\n\n- `QUEUED` The `Email` is queued in Twilio for sending.\n- `SENT` The `Email` has been sent by Twilio.\n- `DELIVERED` The `Email` has been successfully\n    delivered to the recipient.\n\n- `UNDELIVERED` The `Email` was successfully sent by Twilio\n    but has not been delivered to the recipient.\n\n- `OPENED` The `Email` has been opened by the recipient.\n- `FAILED` The `Email` processing failed inside Twilio.\n- `CANCELED` The `Email` was canceled via API request.\n- `INBOUND` The `Email` was received by Twilio from an external source.","type":"string","enum":["SCHEDULED","QUEUED","SENT","DELIVERED","UNDELIVERED","OPENED","FAILED","CANCELED","INBOUND"],"refName":"EmailStatus","modelName":"EmailStatus"}},{"in":"query","name":"tags","description":"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.\nFor Example: ``` GET /Emails?tags=ageGroup:20s;industry:engineering; ```","schema":{"x-twilio-version":1,"title":"TagsString","type":"string","description":"Custom metadata in the form of key-value pairs.\nMust be in the key value format: key1:value;key2:value;\n\nExample:\n```json\n{\n  \"key1\":\"value1\",\n  \"key2\":\"value2\"\n}\n```\n\nShould be inputted as:\n```\n?tags=key1:value;key2:value;\n```","pattern":"^(?:[a-zA-Z0-9._~-]+:[a-zA-Z0-9._~-]+;){1,10}$","example":"key_1:value;key_2:value;","refName":"TagsString","modelName":""}},{"in":"query","name":"pageToken","description":"The token to retrieve the next page of results.","schema":{"x-twilio-version":1,"description":"The token that identifies the page of resources to fetch.","title":"PageToken","type":"string","refName":"PageToken","modelName":""}},{"in":"query","name":"pageSize","description":"The number of resources to return in a page.","schema":{"x-twilio-version":1,"description":"Total number of items returned in a single page, the minimum is 1 and maximum is 1000. Default is 50.","title":"PageSize","type":"integer","minimum":1,"maximum":1000,"default":50,"example":50,"refName":"PageSize","modelName":""}}]
````

List Emails

```ts
import { TwilioClient } from "twilio-comms";

async function main() {
    const client = new TwilioClient({
        accountId: "TWILIO_ACCOUNT_SID",
        authToken: "TWILIO_AUTH_TOKEN",
    });
    await client.emails.list({
        operationId: "comms_operation_01h9krwprkeee8fzqspvwy6nq8",
        startDate: new Date("2024-01-15T09:30:00Z"),
        endDate: new Date("2024-01-15T09:30:00Z"),
        status: "SCHEDULED",
        tags: "key_1:value;key_2:value;",
        pageToken: "pageToken",
        pageSize: 50,
    });
}
main();
```

```py
from twilio_comms import TwilioComms
import datetime

client = TwilioComms(
    account_id="TWILIO_ACCOUNT_SID",
    auth_token="TWILIO_AUTH_TOKEN",
)

client.emails.list(
    operation_id="comms_operation_01h9krwprkeee8fzqspvwy6nq8",
    start_date=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"),
    end_date=datetime.datetime.fromisoformat("2024-01-15T09:30:00+00:00"),
    status="SCHEDULED",
    tags="key_1:value;key_2:value;",
    page_token="pageToken",
    page_size=50,
)
```

```cs
using Twilio.Comms;
using System.Threading.Tasks;
using System;
using System.Globalization;

public partial class Examples
{
    public async Task Example() {
        var client = new TwilioComms(
            accountId: "TWILIO_ACCOUNT_SID",
            authToken: "TWILIO_AUTH_TOKEN"
        );

        await client.Emails.ListAsync(
            new EmailsListRequest {
                OperationId = "comms_operation_01h9krwprkeee8fzqspvwy6nq8",
                StartDate = DateTime.Parse("2024-01-15T09:30:00Z", null, DateTimeStyles.AdjustToUniversal),
                EndDate = DateTime.Parse("2024-01-15T09:30:00Z", null, DateTimeStyles.AdjustToUniversal),
                Status = EmailStatus.Scheduled,
                Tags = "key_1:value;key_2:value;",
                PageToken = "pageToken",
                PageSize = 50
            }
        );
    }

}
```

```java
package com.example.usage;

import com.twilio.sdk.TwilioComms;
import com.twilio.sdk.resources.emails.requests.EmailsListRequest;
import com.twilio.sdk.types.EmailStatus;
import java.time.OffsetDateTime;

public class Example {
    public static void main(String[] args) {
        TwilioComms client = TwilioComms
            .builder()
            .credentials("TWILIO_ACCOUNT_SID", "TWILIO_AUTH_TOKEN")
            .build();

        client.emails().list(
            EmailsListRequest
                .builder()
                .operationId("comms_operation_01h9krwprkeee8fzqspvwy6nq8")
                .startDate(OffsetDateTime.parse("2024-01-15T09:30:00Z"))
                .endDate(OffsetDateTime.parse("2024-01-15T09:30:00Z"))
                .status(EmailStatus.SCHEDULED)
                .tags("key_1:value;key_2:value;")
                .pageToken("pageToken")
                .pageSize(50)
                .build()
        );
    }
}
```

```go
package example

import (
    context "context"

    twiliocomms "github.com/twilio/twilio-comms-go/twilio"
    client "github.com/twilio/twilio-comms-go/twilio/client"
    option "github.com/twilio/twilio-comms-go/twilio/option"
)

func do() {
    client := client.NewWithOptions(
        option.WithBasicAuth(
            "TWILIO_ACCOUNT_SID",
            "TWILIO_AUTH_TOKEN",
        ),
    )
    request := &twiliocomms.EmailsListRequest{
        OperationId: twiliocomms.String(
            "comms_operation_01h9krwprkeee8fzqspvwy6nq8",
        ),
        StartDate: twiliocomms.Time(
            twiliocomms.MustParseDateTime(
                "2024-01-15T09:30:00Z",
            ),
        ),
        EndDate: twiliocomms.Time(
            twiliocomms.MustParseDateTime(
                "2024-01-15T09:30:00Z",
            ),
        ),
        Status: twiliocomms.EmailStatusScheduled.Ptr(),
        Tags: twiliocomms.String(
            "key_1:value;key_2:value;",
        ),
        PageToken: twiliocomms.String(
            "pageToken",
        ),
        PageSize: twiliocomms.Int(
            50,
        ),
    }
    client.Emails.List(
        context.TODO(),
        request,
    )
}
```

```php
<?php

namespace Example;

use Twilio\Comms\TwilioComms;
use Twilio\Comms\Emails\Requests\EmailsListRequest;
use DateTime;
use Twilio\Comms\Types\EmailStatus;

$client = new TwilioComms(
    accountId: 'TWILIO_ACCOUNT_SID',
    authToken: 'TWILIO_AUTH_TOKEN',
);
$client->emails->list(
    new EmailsListRequest([
        'operationId' => 'comms_operation_01h9krwprkeee8fzqspvwy6nq8',
        'startDate' => new DateTime('2024-01-15T09:30:00Z'),
        'endDate' => new DateTime('2024-01-15T09:30:00Z'),
        'status' => EmailStatus::Scheduled->value,
        'tags' => 'key_1:value;key_2:value;',
        'pageToken' => 'pageToken',
        'pageSize' => 50,
    ]),
);
```

```rb
require "twiliocomms"

client = TwilioComms::Client.new(
  account_id: "TWILIO_ACCOUNT_SID",
  auth_token: "TWILIO_AUTH_TOKEN"
)

client.emails.list(
  operation_id: "comms_operation_01h9krwprkeee8fzqspvwy6nq8",
  start_date: "2024-01-15T09:30:00Z",
  end_date: "2024-01-15T09:30:00Z",
  status: "SCHEDULED",
  tags: "key_1:value;key_2:value;",
  page_token: "pageToken",
  page_size: 50
)
```

```bash
curl -X GET "https://comms.twilio.com/v1/Emails?operationId=comms_operation_01h9krwprkeee8fzqspvwy6nq8&startDate=2024-01-15&endDate=2024-01-15&status=SCHEDULED&tags=key_1:value;key_2:value;&pageToken=pageToken&pageSize=50" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```
