Skip to main content
The API covers the usual path: your tool writes the content, Lekalao sends it. The finer settings (segment, A/B test, scheduling, a sender of the campaign’s own) are made in the interface.

Create

The campaign is created as a draft, for the whole list, with the list’s sender.
The content must carry {{ unsubscribe_url }} and {{ organisation.address }}, directly or through its template. Without them, the campaign will not go out.

Test

Up to 5 addresses. The subject is prefixed with “[Test]”; subscribers and statistics are untouched:
A test goes through the same checks as any e-mail, and each address counts against the month’s allowance. Addresses on the suppression list are left out; recipients says who it went to. It is refused with 422 test_refused, the reason in message, when:
  • the sender’s domain is not verified, where the installation requires it;
  • every address given is on the suppression list;
  • the team has sent 100 test e-mails in the last hour, all campaigns together;
  • the month’s allowance is used up.
With a test key, every check is made and the campaign rendered, then nothing leaves and nothing is counted: "sandbox": true.

Send

If everything is ready, sending starts at once:
Otherwise, 422 campaign_not_ready with the list of what is missing, the same checks as in the interface (Send):
A test key cannot send a campaign: 403 sandbox_cannot_send.
Sending cannot be taken back. Use an Idempotency-Key: a call repeated after a network cut will not send the campaign twice.

Follow

The figures are worked out again every minute. delivered is filled only when the provider sends its feedback. The campaign.sent webhook tells you when sending is over. GET /v1/campaigns?status=sent&list={id} lists campaigns, the most recent first.

Delete

DELETE /v1/campaigns/{id} deletes a campaign and its statistics. 409 while it is sending: pause it in the interface first.

Templates

So that your CMS only sends the body of the e-mail, prepare a template with the header, the footer, the unsubscribe link and the postal address. Templates are also managed through the API: GET|POST /templates, GET|PUT|DELETE /templates/{id}.