x-batch-validation
Choose between strict
and permissive
mode.
Strict mode (default)
Strict mode sends the batch only if all emails in the batch request are valid.- Atomic behavior: if any email in the batch fails validation, the entire batch is rejected
- Error details: only the validation error causing the failure is returned
Permissive mode
Permissive mode processes all emails, allowing for partial success and returns the following two arrays:- data: array of objects for all created emails, each containing an email
id
. - errors: array of objects for emails which could not be created due to validation errors. Each object contains the following properties:
index
: index of the email in the batch requestmessage
: error message identifying the validation error
How to use batch validation modes
Example response
Response
Which errors are returned?
Onlypermissive
mode returns an errors array, since the entire batch is rejected if any email fails validation in strict
mode.
When an email in your payload causes an error, that email cannot be created, so an error object is returned.
Reasons your email may cause an error include:
- Required fields are missing.
- Fields contain invalid data.
- The batch contains more than 100 emails.
- The email will not appear in the dashboard, since it could not be created.
- The error object will be included in the
errors
array. - The only way to understand why the email failed is to inspect the returned error object.