Automation Webhooks

Trigger specific automations programmatically.

Each automation workflow with a "Webhook Received" trigger can be executed by making a request to its unique endpoint. This is useful for custom integrations where you want to run a specific sequence of actions for a user.

POST/api/automations/:id/trigger

Parameters

  • :id - The UUID of the automation you want to trigger. Found in the automation URL.

Request Body

You must provide existing contact identification (email or contact_id) so the automation knows who to act upon. Any additional data in the JSON body will be available in the automation execution context.

{
  "email": "target@example.com",   // Required: Matches an existing contact
  "event_data": "subscription_upgraded",
  "plan": "pro"
}

Example Request

curl -X POST "https://automailai.vercel.app/api/automations/123-abc/trigger?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "customer@example.com",
    "item": "digital-course-v1"
  }'