CampaignsSend a test email

Send a test email

Personalizes an email and sends it from the mailbox through the workspace's sending servers, the same way campaign emails and the dashboard's "Send test" are sent. Supports two modes:

  • Send to lead: Provide leadId - email is personalized with lead data and sent to the lead's email.
  • Send to custom email: Provide customEmail and optionally customVariables - useful for testing with your own inbox.

The request waits up to about 15 seconds for the send to finish:

  • 200 - sent; messageId is returned.
  • 422 with code SEND_FAILED - the mailbox could not send it (e.g. login rejected); message has the reason.
  • 202 - still sending; the email will still go out. Poll GET /v1/campaigns/{campaignId}/send-test-email/{jobId} for the result instead of retrying, or the recipient gets a second copy.

The step's saved attachments are included. Counts toward email usage quota. Requires an active subscription.

curl -X POST "https://api.sendkit.ai/v1/campaigns/example_string/send-test-email" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d '{
  "sequenceStep": 1,
  "mailboxId": "665b1c2d3e4f5a6b7c8d9e0f",
  "customEmail": "test@example.com",
  "customVariables": {
    "firstName": "John",
    "company": "Acme Corp"
  }
}'
{
  "success": true,
  "data": {
    "message": "Test email sent successfully",
    "messageId": "<abc123@smtp.gmail.com>",
    "jobId": "preview_email_665a1b2c3d4e5f6a7b8c9d0e_test_example_com_1730000000000_k3x9q2",
    "recipient": "test@example.com",
    "mailbox": "sarah@sendkit.ai",
    "preview": {
      "subject": "Quick question, John",
      "body": "<p>Hi John,</p><p>I noticed Acme Corp is growing fast...</p>",
      "text": "Hi John,

I noticed Acme Corp is growing fast..."
    }
  }
}
POST
/v1/campaigns/{campaignId}/send-test-email
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-Api-Key)
X-Api-Keystring
Required

Platform API key (sk_user_...) or Workspace API key (sk_...)

Platform API key (sk_user_...) or Workspace API key (sk_...)
Content-Typestring
Required

The media type of the request body

Options: application/json
sequenceStepinteger
Required

1-based index of the email step to send (only counts email steps, skips wait steps)

Min: 1
mailboxIdstring
Required

Mailbox to send from

leadIdstring

Lead ID - send to this lead's email with their data

customEmailstring

Custom recipient email (alternative to leadId)

Format: email
customVariablesobject

Variable values when using customEmail

variantstring

A/B variant label

contentOverrideobject

Override step content for unsaved drafts

Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-Api-Keystring
Required

API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)

Path Parameters

Body

application/json
sequenceStepinteger
Required

1-based index of the email step to send (only counts email steps, skips wait steps)

Example:
1
mailboxIdstring
Required

Mailbox to send from

leadIdstring

Lead ID - send to this lead's email with their data

customEmailstring

Custom recipient email (alternative to leadId)

customVariablesobject

Variable values when using customEmail

variantstring

A/B variant label

contentOverrideobject

Override step content for unsaved drafts

Responses

successboolean
dataobject