v1.0.0
OpenAPI 3.1.0

Send a test email

US region

Client Libraries

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 default renders 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.

Path Parameters
  • id
    Type: string Format: uuid
    required

    The UUID of the email. If your email has translations, this is the ID of a specific language variant.

Body
required
application/json
  • to
    Type: array string[]
    required

    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.

  • customer
    Type: object | null

    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 alongside customer_id: Customer.io uses the profile's attributes, and a value here overrides the profile's value for the same key.

  • customer_id
    Type: string | null

    The person whose profile attributes fill in customer.* liquid variables. Pass the person's cio_id or the id that identifies them in your workspace. If nobody matches, the request fails. When you omit this field and don't pass customer values, the email renders with empty customer.* values and the response includes a warning.

  • event
    Type: object | null

    Sample event data for event.* liquid variables. The event key references trigger data for event-triggered automations.

  • lax
    Type: boolean

    Set to true to render a liquid variable your sample data doesn't cover as an empty string rather than failing the request. Only applies when you pass customer_id or customer; without sample data, the email renders this way anyway and the response includes a warning.

  • prepend_test
    Type: boolean

    Set to true to add [TEST] to the start of the subject line.

  • tracked
    Type: boolean

    Set to true to add a tracking pixel or false to 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.

  • trigger
    Type: object | null

    Sample trigger data for trigger.* liquid variables. The trigger key references trigger data for these specific workflows: API-triggered broadcasts or transactional messages.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/v1/design_studio/emails/{id}/test_send
{
  "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"
  ]
}