Senlo

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

FieldTypeRequiredDescription
idnumber or stringyesThe trigger id, from the trigger's API Integration card.
tostringyesThe recipient. One address per request.
dataobjectnoValues for the template's merge tags.
localestringnoSends the trigger's template for this locale, if it has one. Exact, case-sensitive match.
subjectstringnoReplaces 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

StatusWhen
400to is missing or not an email, id is missing; the trigger is not an API trigger; the workspace has no email provider.
401No key, or a wrong one.
402Cloud only: the organization has used its monthly emails.
404The trigger is not in this workspace, or its template or provider is gone.
429Rate 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.

Reference

POST /api/triggered in the API reference.

Edit this page on GitHub