Send a test email
Sends a test email to a real inbox through your sending domain using the content saved to Design Studio. The test includes the tracking pixel and link parameters a real send would add, so you can see your email as it would appear in an actual email client. To get the rendered HTML back in the API response instead, use Preview an email.
-
If you already linked the email to a workflow, then keep in mind that what's saved to Design Studio may differ from what's published to the linked workflow. Make sure you publish your changes when you're ready to push them to your linked workflow.
-
If your email has translations, you have to send this request separately for each language variant. Pass the ID of the specific translation you want to test, which you can retrieve from List email translations.
-
If the email contains liquid variables, you can provide sample data in the request body to check how the liquid renders. Without sample data, the send still succeeds, but each variable renders as an empty string and the response includes a warning. A variable with a fallback filter like
defaultrenders its fallback instead. A liquid syntax error, like a missing close tag, always fails the request.
Your account has a set number of test emails you can send per day. This endpoint counts towards that quota. Learn more in Plan features.
- Type: string Format: uuididrequired
The UUID of the email. If your email has translations, this is the ID of a specific language variant.
- Type: array string[]torequired
The email addresses you want to send the test to. You can send to up to 25 addresses per request; up to three addresses on a trial account; or a single address (the account owner's address or your workspace's delivery address) if your account isn't verified yet.
- Type: object | nullcustomer
Sample profile attributes for
customer.*liquid variables, as a flat object of values. Encode a nested value as a JSON string. You can pass this alongsidecustomer_id: Customer.io uses the profile's attributes, and a value here overrides the profile's value for the same key. - Type: string | nullcustomer
_id The person whose profile attributes fill in
customer.*liquid variables. Pass the person'scio_idor theidthat identifies them in your workspace. If nobody matches, the request fails. When you omit this field and don't passcustomervalues, the email renders with emptycustomer.*values and the response includes a warning. - Type: object | nullevent
Sample event data for
event.*liquid variables. Theeventkey references trigger data for event-triggered automations. - Type: booleanlax
Set to
trueto render a liquid variable your sample data doesn't cover as an empty string rather than failing the request. Only applies when you passcustomer_idorcustomer; without sample data, the email renders this way anyway and the response includes a warning. - Type: booleanprepend
_test Set to
trueto add[TEST]to the start of the subject line. - Type: booleantracked
Set to
trueto add a tracking pixel orfalseto leave it out. If you don't pass this field, Customer.io uses the tracking setting of the workflow message the email is linked to, and adds the pixel when the email isn't linked to a workflow message. Customer.io never adds the pixel for unverified accounts. - Type: object | nulltrigger
Sample trigger data for
trigger.*liquid variables. Thetriggerkey references trigger data for these specific workflows: API-triggered broadcasts or transactional messages.
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
{
"to": [
"pigeon@customer.io",
"penguin@customer.io"
],
"customer": {
"first_name": "Ada",
"vip": "gold",
"cio_subscription_preferences": "{\"topics\":{\"topic_2\":true}}"
},
"customer_id": "5",
"prepend_test": true
}
{
"accepted": true,
"from": "\"No reply\" <noreply@customer.io>",
"node_id": "1a0cbb4e-09d3-402e-949e-f6732f021650",
"node_type": "EMAIL",
"subject": "[TEST] Welcome Ada",
"to": [
"pigeon@customer.io",
"penguin@customer.io"
]
}Test accepted for delivery