Send Triggered Email

Legacy endpoint. New integrations should use the Triggered Emails resource instead. Quick guide

To send a triggered email, use the following URL pattern:

https://api.bluefox.email/v1/send-triggered

Replace the placeholders with your specific information:

  • ##EMAIL_ID##
  • ##YOUR_API_KEY##

You can find the required IDs by clicking the Code Guide button on a triggered email card:

Screenshot of the highlighted code guide button on a triggered email card.

In the Code Guide dialog, these values are automatically filled in. If you copy the code snippets, make sure to replace ##YOUR_API_KEY##.

Screenshot of a code guide dialog for a triggered email

Request Body

json
{
  "emails": ["jon@doe.com"],
  "triggeredId": "##EMAIL_ID##",
  "data": {
    "example": "example merge tag value"
    // TODO: Add your merge tag values
  },
  "attachments": [] // optional  
}

You can include personalization data (merge tags) in the data object. These tags are processed by Handlebars when the email is sent.

cURL Example

bash
curl -X POST \
"https://api.bluefox.email/v1/send-triggered" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ##YOUR_API_KEY##" \
-d '{
  "emails": ["jon@doe.com"], // TODO: Change email addresses
  "triggeredId": "##EMAIL_ID##",
  "data": {
    // TODO: Add merge tag values
  }
}'

JavaScript Example

javascript
const url = 'https://api.bluefox.email/v1/send-triggered';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer ##YOUR_API_KEY##' // TODO: Replace ##YOUR_API_KEY##
  },
  body: JSON.stringify({
    emails: ['jon@doe.com'], // TODO: Change email address
    triggeredId: "##EMAIL_ID##",
    data: {
      // TODO: Add merge tag values
    }
  })
});

PHP Example

php
$apiKey = "##YOUR_API_KEY##";

$url = "https://api.bluefox.email/v1/send-triggered";

$emails = ["jon@doe.com"]; // TODO: Change email addresses
$triggeredId = "##EMAIL_ID##";
$data = [
  // TODO: Add merge tag values
];

$payload = json_encode([
  "emails" => $emails,
  "triggeredId" => $triggeredId,
  "data" => $data
]);

$options = [
  "http" => [
    "header"  => [
      "Content-Type: application/json",
      "Authorization: Bearer $apiKey"
    ],
    "method"  => "POST",
    "content" => $payload,
  ],
];

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

API Responses

CodeNameMessageDescriptionJSON Response Example
200--The request was successfully processed.json { "status": 200 , "result": {"success": true} }
400VALIDATION_ERRORProject Email AWS configurations not found.Missing AWS configurations in project.json { "status": 400, "error": {"name": "VALIDATION_ERROR", "message": "Project Email AWS configurations not found."} }
400VALIDATION_ERRORMissing required parameters: triggeredId.The request is missing mandatory fields for processing.json { "status": 400, "error": {"name": "VALIDATION_ERROR", "message": "Missing required parameters: triggeredId."} }
400VALIDATION_ERRORInvalid emails formatThe request contains improperly formatted emails. Ensure emails is an array of valid addresses.json { "status": 400, "error": {"name": "VALIDATION_ERROR", "message": "Invalid emails format"} }
405METHOD_NOT_ALLOWEDInsufficient credits available.Occurs when the account lacks the necessary credits to send an email.json { "status": 405, "error": {"name":"METHOD_NOT_ALLOWED", "message": "Insufficient credits available."} }

Frequently Asked Questions

What are the required fields to send a triggered email via the API?

The request body must include triggeredId (the ID of the triggered email template). The emails field is optional: if omitted, the email is sent to the entire subscriber list linked to the triggered email. If provided, it must be an array of recipient addresses, and only addresses that are active subscribers on the linked list will receive the email. You can also optionally pass a data object for merge tag values and an attachments array for file attachments.

Why did my triggered email not get delivered to some addresses?

When you pass an emails array, each address must be an active subscriber on the subscriber list linked to the triggered email. Addresses that are unsubscribed, paused, or not on the list are silently skipped. No error is returned for skipped addresses.

Can I send a triggered email to multiple recipients in one API call?

Yes. The emails field accepts an array of addresses. The email will be delivered to each address in the array that is an active subscriber on the linked list. Addresses that do not qualify are skipped automatically.

Where do I find the triggeredId for my email?

Click the Code Guide button on the triggered email card in your project. The dialog automatically fills in the correct triggeredId and endpoint URL. You only need to replace YOUR_API_KEY before using the snippet.