Send a triggered email
POST /api/triggered sends one email from a trigger's template.
curl -X POST https://senlo.io/api/triggered \
-H "Authorization: Bearer $SENLO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": 12,
"to": "customer@example.com",
"locale": "en",
"data": { "order": { "number": "A-1049", "total": "42.00" } }
}'Body
| Field | Type | Required | Description |
|---|---|---|---|
id | number or string | yes | The trigger id, from the trigger's API Integration card. |
to | string | yes | The recipient. One address per request. |
data | object | no | Values for the template's merge tags. |
locale | string | no | Sends the trigger's template for this locale, if it has one. Exact, case-sensitive match. |
subject | string | no | Replaces the template's subject for this send. Merge tags work in it. |
campaignId is accepted as an older name of id; id wins if both are sent.
Response
{ "success": true, "message": "Email queued successfully" }200 means the email is queued. The worker renders it, checks the suppression list, and hands it to your provider. The outcome is in the trigger's delivery log.
Errors
| Status | When |
|---|---|
400 | to is missing or not an email, id is missing; the trigger is not an API trigger; the workspace has no email provider. |
401 | No key, or a wrong one. |
402 | Cloud only: the organization has used its monthly emails. |
404 | The trigger is not in this workspace, or its template or provider is gone. |
429 | Rate limited. |
The body of every error is { "error": "..." }, sometimes with details. See Errors.
Idempotency
There is no idempotency key: two identical requests send two emails. If you retry on network errors, make sure the first attempt did not succeed.