Skip to main content

Send a Test Email

Send a one-off test email of a campaign to a single address.

A test email lets you preview a campaign in a real inbox while you are still building it. The campaign's current subject, body, and sender are rendered and sent to the address you provide, with placeholder contact data — personalization merge tags show sample values (such as a name like John Doe) rather than a real contact's details.

A test is a preview only. It does not start the real send, does not reach the campaign's audience, does not record recipients, and does not change the campaign's status. You can send a test from a campaign in any status. A test is still a real outbound email, so if the send is rejected the call returns 409 TEST_SEND_FAILED.

Testability

A campaign can be tested once it has the three things needed to render the email: a subject, a body (content), and a sender identity (from_identity). If any are missing, the request returns 422 CAMPAIGN_NOT_TESTABLE, and details.missing lists which are absent — a subset of subject, content, and sender_identity.

This is a smaller set than the readiness a real send requires: a test does not need an audience or a from_name, and the sender identity does not need to be enabled.

Missing keyHow to satisfy
subjectSet subject on the campaign.
contentSet the email body with the content field. See Campaign body.
sender_identitySet from_identity to a sender identity.

Request

POST /campaigns/{uuid}/test

Path Parameters

ParameterTypeDescription
uuidstringCampaign's UUID

Request Body

ParameterTypeRequiredDescription
emailstringYesThe single address that receives the test email. A missing or invalid address returns 422 VALIDATION_ERROR.
languagestringNoAn ISO 639-1 language code (two letters) to preview a specific translation. Omit to use the campaign's own language. A value that is not a valid code returns 422 VALIDATION_ERROR.

To send a test to several inboxes, call this endpoint once per address.

Example Requests

curl -X POST "https://email.easy.tools/api/v1/campaigns/550e8400-e29b-41d4-a716-446655440000/test" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"email": "you@example.com"
}'

To preview a specific translation, include language:

curl -X POST "https://email.easy.tools/api/v1/campaigns/550e8400-e29b-41d4-a716-446655440000/test" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"email": "you@example.com",
"language": "en"
}'

Response

Success Response (204 No Content)

On success the API returns 204 No Content with an empty body. The test email is sent to the address you provided.

Error Responses

Not Found Error (404)

The campaign UUID is unknown or malformed.

{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Campaign with UUID '550e8400-e29b-41d4-a716-446655440000' not found"
}
}

Validation Error (422 Unprocessable Entity)

email is missing or invalid, or language is not a valid ISO 639-1 code.

{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid",
"details": {
"email": ["The email field is required."]
}
}
}

Validation Error (422 — Not Testable)

The campaign is missing one or more of the fields a test needs to render. details.missing lists which of subject, content, and sender_identity are absent. See Testability.

{
"error": {
"code": "CAMPAIGN_NOT_TESTABLE",
"message": "Campaign is not complete enough to send a test",
"details": {
"missing": ["subject", "content"]
}
}
}

Conflict Error (409 — Test Send Failed)

The test email could not be sent — for example because a sending quota was exhausted or the send was rate-limited. Retry later.

{
"error": {
"code": "TEST_SEND_FAILED",
"message": "The test email could not be sent. Please try again later."
}
}