Webhooks & Inbound APIs
Connect external triggers, ingest contacts, and capture real-time email delivery events.
1. Automation Trigger Webhook
Trigger custom automated sequences programmatically for a specific contact. If the contact does not yet exist, AutoMail AI will automatically register them.
Parameters & Authentication
:id— UUID of the target automation.?key=YOUR_API_KEYor headerAuthorization: Bearer YOUR_API_KEY.
Payload Example
curl -X POST "https://automailai.vercel.app/api/automations/YOUR_AUTOMATION_ID/trigger" \
-H "Authorization: Bearer sk_automail_..." \
-H "Content-Type: application/json" \
-d '{
"email": "sarah.connor@example.com",
"first_name": "Sarah",
"plan": "enterprise_tier"
}'2. Universal Contact & Event Ingest
Stream leads and application events directly from your SaaS or landing pages. Protected by sliding-window rate limiting (120 requests/minute per key).
Rate Limit Headers
Every response includes standard RFC-compliant rate limit telemetry:
- X-RateLimit-Limit: 120
- X-RateLimit-Remaining: 118
- X-RateLimit-Reset: 1725619200
- Retry-After: 35 (on HTTP 429)
cURL Ingest Example
curl -X POST "https://automailai.vercel.app/api/ingest" \
-H "Authorization: Bearer YOUR_WEBHOOK_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "alex@company.com",
"first_name": "Alex",
"company": "Acme Corp",
"event": "user.signup",
"tags": ["saas-trial", "onboarding"]
}'3. Resend Delivery & Engagement Webhook
Receive delivery confirmations, opens, clicks, bounces, and spam complaints from Resend. AutoMail AI updates campaign counters and cleans bad email addresses in real time.
Setup in Resend Dashboard
- Navigate to Resend Dashboard > Webhooks.
- Click Add Webhook and set Endpoint URL to
https://automailai.vercel.app/api/webhooks/resend. - Select events:
email.delivered,email.opened,email.clicked,email.bounced, andemail.complained. - Copy the Signing Secret (starts with
whsec_...) and save it in your environment asRESEND_WEBHOOK_SECRET.
Automatic State Synchronization
email.delivered
Increments automation total_sent and sets contact last_contacted_at.
email.opened & email.clicked
Increments automation total_opened and total_clicked counters.
email.bounced
Increments total_bounced and marks contact status = 'bounced'.
email.complained
Automatically transitions contact to status = 'unsubscribed'.