Create transactional campaign
Use this API method to create a new transactional campaign.
Only plain and html editors are supported via API. For builder campaigns, use the interface.
Endpoint
Section titled “Endpoint”HTTP method: POST
https://api.sender.net/v2/transactional
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
title | string | Name of the campaign (optional, shown in reports) |
subject | string required | Subject line of the campaign |
from | string required | Sender name displayed to recipients |
reply_to | string required | Sender email. Must belong to a verified domain |
editor | string required | The value must be one of “plain”, “html”, or “builder”. |
preheader | string | Preview text of the email |
content | string | Provide the content of your campaign. Only plain text and html options are available for providing campaign content using the API. For drag&drop builder you need to use the interface. |
Request Examples
Section titled “Request Examples”const url = new URL("https://api.sender.net/v2/transactional");
let headers = { "Authorization": "Bearer [your-token]", "Content-Type": "application/json", "Accept": "application/json",};
let bodyContent = { "title": "Transactional campaign test title", "subject": "Transactional campaign test subject", "from": "Sender support", "editor": "plain", "preheader": "Preview text of my transactional campaign", "content": "Adding the first content of my campaign"};
fetch(url, { method: "POST", headers, body: JSON.stringify(bodyContent)}).then(response => response.json()).then(data => console.log(data)).catch(error => console.error('Error:', error));$client = new \GuzzleHttp\Client();
$json = [ "title" => "Transactional campaign test title", "subject" => "Transactional campaign test subject", "from" => "Sender support", "editor" => "plain", "preheader" => "Preview text of my transactional campaign", "content" => "Adding the first content of my campaign"];
$response = $client->post( 'https://api.sender.net/v2/transactional', [ 'headers' => [ 'Authorization' => 'Bearer [your-token]', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => $json ]);
$body = $response->getBody()->getContents();$data = json_decode($body, true);print_r($data);import requestsimport json
url = "https://api.sender.net/v2/transactional"
headers = { "Authorization": "Bearer [your-token]", "Content-Type": "application/json", "Accept": "application/json",}
payload = { "title": "Transactional campaign test title", "subject": "Transactional campaign test subject", "from": "Sender support", "editor": "plain", "preheader": "Preview text of my transactional campaign", "content": "Adding the first content of my campaign"}
response = requests.request('POST', url, headers=headers, json=payload)
print(response.json())curl -X POST \"https://api.sender.net/v2/transactional" \-H "Authorization: Bearer [your-token]" \-H "Content-Type: application/json" \-H "Accept: application/json" \-d '{"title":"Transactional campaign test title","subject":"Transactional campaign test subject","from":"Sender support","reply_to":"[email protected]","editor":"plain","preheader":"Preview text of my transactional campaign","content":"Adding the first content of my campaign"}'Response
Section titled “Response”{ "data": { "id": "ep2W4y", "user_id": "b2zzjb", "account_id": "boEyke", "title": "Transactional campaign test title", "subject": "Transactional campaign test subject", "from": "Sender support", "domain_id": "bkRz2N", "created": "2025-07-24 21:09:28", "modified": "2025-07-24 21:09:28", "type": "API", "last_action": "step1", "editor": "plain", "html": { "id": "dBKJRx", "thumbnail_url": "https://cdn.sender.net/thumbnails/boEyke/html/dBKJRx.webp?v=1753369768", "has_preview": false, "has_snapshots": false, "styles": null }, "purchaseCount": 0 }}