Keplars

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

  1. Build the automation in the dashboard - set a trigger, add email steps, delays, and conditions.
  2. Activate the automation - only active automations accept API enrollments.
  3. 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 doRequired scope
Read automation detailsautomations:read
Enroll / unenroll contactsautomations:write
Fire events to trigger automationsautomations: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 EventDirect Enroll
TriggersAll automations matching the event nameOne specific automation
Best forBehavioral events (purchase, signup, upgrade)Explicit workflow entry points
Scopeautomations:triggerautomations:write
Contact requiredYes (silently dropped if not found)Yes (returns 404 if not found)
Already enrolledSilently 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

On this page