Automations
Trigger workflows, enroll contacts, and fire events from your own application using the Automations Public API.
Automations let you run multi-step email workflows automatically - welcome series, post-purchase follow-ups, re-engagement sequences, and more. You build the workflow in the Keplars dashboard, then drive it from your application via the public API.
How It Works
- Build the automation in the dashboard - set a trigger, add email steps, delays, and conditions.
- Activate the automation - only active automations accept API enrollments.
- Connect your app - call the API from your backend to enroll contacts or fire events.
Getting Started
Create an Admin API Key
Go to Settings → API Keys → Admin Keys and create a key with the scopes you need:
| What you want to do | Required scope |
|---|---|
| Read automation details | automations:read |
| Enroll / unenroll contacts | automations:write |
| Fire events to trigger automations | automations:trigger |
Build and activate an automation
In the dashboard, create an automation and set its trigger:
- Event trigger - fires when your app calls Track Event
- Audience trigger - fires when a contact is added to a specific audience
- Date/time trigger - fires at a scheduled date
Set the automation to Active before making API calls - draft automations will not enroll contacts.
Ensure your contacts exist
The automations API does not create contacts. Before enrolling or firing events, ensure the contact exists in your workspace using the Contacts API.
Connect your app
Option A - Fire an event (recommended for event-based automations):
curl -X POST https://api.keplars.com/api/v1/public/automations/events/track \
-H "Authorization: Bearer $KEPLARS_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"event_name": "purchase_completed",
"properties": { "plan": "pro", "amount": 99 }
}'Option B - Enroll directly into a specific automation:
curl -X POST https://api.keplars.com/api/v1/public/automations/add-automation/$AUTOMATION_ID/enroll \
-H "Authorization: Bearer $KEPLARS_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{ "email": "[email protected]" }'Event Tracking vs. Direct Enroll
| Track Event | Direct Enroll | |
|---|---|---|
| Triggers | All automations matching the event name | One specific automation |
| Best for | Behavioral events (purchase, signup, upgrade) | Explicit workflow entry points |
| Scope | automations:trigger | automations:write |
| Contact required | Yes (silently dropped if not found) | Yes (returns 404 if not found) |
| Already enrolled | Silently skipped (deduped) | Returns 409 |
Use Track Event when the same event should drive multiple automations. Use Direct Enroll when you want precise control over which automation a contact enters.
Unenrolling Contacts
To stop a contact mid-automation - for example, when they cancel their subscription or manually opt out:
curl -X DELETE https://api.keplars.com/api/v1/public/automations/delete-automation/$AUTOMATION_ID/subscribers \
-H "Authorization: Bearer $KEPLARS_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{ "email": "[email protected]" }'This immediately sets the subscriber status to unsubscribed and stops any pending steps.
Next Steps
- Building Automations - end-to-end dashboard walkthrough
- Node Reference - all node types, fields, and options
- Automations API Reference - full endpoint docs with request/response examples
- Contacts API - create and manage contacts before enrolling them
- Setup Admin API Keys - create scoped keys for your application