> For the complete documentation index, see [llms.txt](https://docs.mailtrap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailtrap.io/developers/email-sending/bulk/batch-send-emails.md).

# Batch send emails

Send up to 500 marketing emails in a single API call. Each email can have unique recipients and content while sharing base properties.

**Limits:**

* Maximum 500 messages per call
* Maximum 50 MB total payload size (including attachments)

**Note:** The endpoint returns HTTP 200 even if individual messages fail. Check the `responses` array for individual message status.

```json
{"openapi":"3.1.0","info":{"title":"Bulk","version":"2.0.0"},"tags":[{"name":"send-email","description":"Send marketing emails and newsletters through the bulk stream optimized for high-volume sending.\n\n{% hint style=\"info\" %}\nLearn more about [Bulk Stream](https://docs.mailtrap.io/email-api-smtp/setup/bulk-stream) and when to use it.\n{% endhint %}\n"}],"servers":[{"description":"Bulk Stream. Use a normal HTTP client `User-Agent` (as typical browsers and `curl` do); bare\nrequests without one may be blocked by edge protection.\n","url":"https://bulk.api.mailtrap.io"}],"security":[{"HeaderAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"HeaderAuth":{"type":"apiKey","description":"API token in Api-Token header","in":"header","name":"Api-Token"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication"}},"schemas":{"BatchEmail":{"title":"Batch Email Request","description":"Send multiple emails in a single API call (up to 500)","type":"object","required":["requests"],"properties":{"base":{"description":"Base properties shared by all emails","allOf":[{"$ref":"#/components/schemas/EmailSender"},{"$ref":"#/components/schemas/EmailReplyTo"},{"$ref":"#/components/schemas/EmailSubject"},{"$ref":"#/components/schemas/EmailText"},{"$ref":"#/components/schemas/EmailHtml"},{"$ref":"#/components/schemas/EmailAttachments"},{"$ref":"#/components/schemas/EmailSendingHeaders"},{"$ref":"#/components/schemas/EmailCategory"},{"$ref":"#/components/schemas/EmailCustomVariables"},{"$ref":"#/components/schemas/TemplateUuid"},{"$ref":"#/components/schemas/TemplateVariables"}]},"requests":{"type":"array","description":"Individual email configurations (max 500)","maxItems":500,"items":{"allOf":[{"$ref":"#/components/schemas/EmailSender"},{"$ref":"#/components/schemas/EmailRecipients"},{"$ref":"#/components/schemas/EmailReplyTo"},{"$ref":"#/components/schemas/EmailSubject"},{"$ref":"#/components/schemas/EmailText"},{"$ref":"#/components/schemas/EmailHtml"},{"$ref":"#/components/schemas/EmailAttachments"},{"$ref":"#/components/schemas/EmailSendingHeaders"},{"$ref":"#/components/schemas/EmailCategory"},{"$ref":"#/components/schemas/EmailCustomVariables"},{"$ref":"#/components/schemas/TemplateUuid"},{"$ref":"#/components/schemas/TemplateVariables"}]}}}},"EmailSender":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/Address"}}},"Address":{"type":"object","properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"}}},"EmailReplyTo":{"type":"object","properties":{"reply_to":{"$ref":"#/components/schemas/Address"}}},"EmailSubject":{"type":"object","properties":{"subject":{"type":"string","minLength":1}}},"EmailText":{"type":"object","properties":{"text":{"type":"string","minLength":1}}},"EmailHtml":{"type":"object","properties":{"html":{"type":"string","minLength":1}}},"EmailAttachments":{"type":"object","properties":{"attachments":{"type":"array","items":{"type":"object","required":["content","filename"],"properties":{"content":{"type":"string","description":"Base64 encoded content"},"filename":{"type":"string"},"type":{"type":"string","description":"MIME type"},"disposition":{"type":"string","enum":["attachment","inline"],"default":"attachment"},"content_id":{"type":"string","description":"For inline attachments"}}}}}},"EmailSendingHeaders":{"type":"object","properties":{"headers":{"type":"object","additionalProperties":{"type":"string"}}}},"EmailCategory":{"type":"object","properties":{"category":{"type":"string","maxLength":255}}},"EmailCustomVariables":{"type":"object","properties":{"custom_variables":{"type":"object","additionalProperties":{"type":"string"}}}},"TemplateUuid":{"type":"object","properties":{"template_uuid":{"type":"string","format":"uuid","description":"Email template UUID"}}},"TemplateVariables":{"type":"object","properties":{"template_variables":{"type":"object","description":"Template variable values"}}},"EmailRecipients":{"type":"object","properties":{"to":{"type":"array","maxItems":1000,"items":{"$ref":"#/components/schemas/Address"}},"cc":{"type":"array","maxItems":1000,"items":{"$ref":"#/components/schemas/Address"}},"bcc":{"type":"array","maxItems":1000,"items":{"$ref":"#/components/schemas/Address"}}}},"BatchSentResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Overall request success"},"responses":{"type":"array","description":"Individual message results","items":{"type":"object","properties":{"success":{"type":"boolean"},"message_ids":{"type":"array","items":{"type":"string"}},"errors":{"type":"array","items":{"type":"string"}}}}},"errors":{"type":"array","description":"General errors","items":{"type":"string"}}}},"SendEmailErrorResponse":{"type":"object","description":"Error responses from the sending API use `success: false` and an `errors` array of strings\n(unlike account APIs on `mailtrap.io`, which use `error` or a single `errors` string).\n","properties":{"success":{"type":"boolean"},"errors":{"type":"array","items":{"type":"string"}}}}},"responses":{"BadRequest":{"description":"Bad request. Fix errors listed in response before retrying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailErrorResponse"}}}},"Unauthorized":{"description":"Unauthorized. Check your API credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailErrorResponse"}}}},"InternalError":{"description":"Internal server error. Retry later or contact support.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailErrorResponse"}}}}}},"paths":{"/api/batch":{"post":{"summary":"Batch send emails","description":"Send up to 500 marketing emails in a single API call. Each email can have unique recipients and content while sharing base properties.\n\n**Limits:**\n- Maximum 500 messages per call\n- Maximum 50 MB total payload size (including attachments)\n\n**Note:** The endpoint returns HTTP 200 even if individual messages fail. Check the `responses` array for individual message status.\n","operationId":"batchSendEmail","tags":["send-email"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchEmail"}}}},"responses":{"200":{"description":"Batch processed. Check individual responses for delivery status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchSentResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mailtrap.io/developers/email-sending/bulk/batch-send-emails.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
