Send Test Email
Send a test email for a specific campaign variant to a single recipient.
Endpoint
POST https://api.campaignlark.com/v1/campaigns/:id/test
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | required | The campaign ID. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
variant_type | string | required | A or B. |
recipient | string | required | Email address to send the test to. |
Sample Request
POST https://api.campaignlark.com/v1/campaigns/64f1a2b3c4d5e6f7a8b9c0d1/test
Content-Type: application/json
{
"variant_type": "A",
"recipient": "test@example.com"
}
Response
Success — 200 OK
{
"error": null,
"data": "The test email has been scheduled successfully."
}
Errors
| Status | Message | Cause |
|---|---|---|
400 | Please provide a campaign ID. | id path param is missing. |
400 | Invalid request body. | Request body could not be parsed. |
400 | Invalid variant type. Must be 'A' or 'B'. | Variant type is not valid. |
400 | Please provide a valid recipient email address. | recipient is not a valid email. |
400 | We could not find the campaign you are looking for. | Campaign not found. |
400 | Please configure a sender identity before sending test emails. | No sender identity on the campaign. |
400 | We could not find the variant you are looking for. | Variant does not exist. |
400 | The variant must have a subject before sending test emails. | Variant has no subject. |
400 | The variant must have email content before sending test emails. | Variant has no body HTML. |
429 | You are sending test emails too quickly. Please wait a moment and try again. | Per-minute rate limit exceeded. |
400 | You have exceeded the hourly test email limit. Please try again later. | Per-hour rate limit exceeded. |
400 | You have exceeded the daily test email limit. Please try again tomorrow. | Per-day rate limit exceeded. |