Email

Send an email

POSThttps://api.smsedge.com/v2/email/send

Sends one email of an API campaign now, with your own values in the template.

Use this for emails your app sends one at a time: order receipts, password resets, welcome emails, alerts.

  1. In Email → Campaigns, make a campaign with a From name, a server and a template. Do not launch it. Click Use for API sends.
  2. In the template, put {{{data.key}}} where a value from your call goes, for example Order {{{data.order_id}}}. The contact tags such as {{{name}}} work too (to_name fills {{{name}}}).
  3. Call this endpoint with the campaign ID, the address and the values in data.
  • The email has open and click tracking, an unsubscribe link and DKIM like a campaign email, and its opens and clicks show in the campaign's stats.
  • Each email is charged at the price of the server. If the server cannot send it, the charge is refunded.
  • The same person can get any number of API emails. Send an idempotency_key to make a retry safe: the same key never sends or charges twice.
  • Unsubscribed, blacklisted and bounced addresses are refused (422).
  • Limit: 600 API emails a minute for each account (429 above it).
  • The email goes into the server's queue. If the same server is sending a big campaign, the API email waits behind it. Use a separate server for API campaigns.

Body params (JSON)

  • campaign_idintegerrequired

    ID of the API campaign (a campaign with API sending turned on).

  • tostringrequired

    Email address of the recipient.

  • to_namestringoptional

    Name of the recipient (fills {{{name}}}). Maximum 100 characters.

  • template_idintegeroptional

    One of the campaign's templates. Default: the campaign's first template.

  • server_idintegeroptional

    One of the campaign's servers. Default: a random active server of the campaign.

  • datastringoptional

    JSON object of key: value. Each value fills {{{data.key}}} in the subject, preview text and body. Values are text, numbers or true/false (no nested objects). Maximum 50 keys and 10 KB. A key the call does not send shows as empty.

  • idempotency_keystringoptional

    Your ID for this email (letters, digits, _ . : -, maximum 128). A second call with the same key returns the first email and sends nothing.

Responses

  • 202The email is queued. key is the email's click ID (the {{{dynamic}}} value for conversion postbacks).
  • 200The idempotency_key was used before: the first email is returned and nothing is sent.
  • 404No API campaign with this ID in your account (or API sending is off).
  • 422A parameter is not valid, or the recipient unsubscribed, complained, is blacklisted or bounced.
  • 409The campaign is paused or cancelled.
  • 402Your balance is too low.
  • 429More than 600 API emails in a minute. Try again in a minute.
curl -X POST "https://api.smsedge.com/v2/email/send" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"campaign_id":1234,"to":"ann@example.com"}'
{
  "success": true,
  "data": {
    "message_id": 5512,
    "status": "queued",
    "campaign_id": 1234,
    "template_id": 88,
    "server_id": 9,
    "to": "ann@example.com",
    "idempotency_key": "order-A-17",
    "key": "e-1234-1130-17644120301",
    "cost": 0.0002,
    "error": null,
    "created_at": "2026-11-30 10:15:02",
    "updated_at": "2026-11-30 10:15:02"
  },
  "errors": [],
  "response": {
    "code": 202,
    "description": "Accepted",
    "date": "2026-11-30 10:15:02"
  }
}

All requests need your API key in the X-API-KEY header. See Authentication.