Webhooks
GAIA supports webhooks for real-time event notifications from payment providers and third-party integrations.Supported Webhook Types
Payment Webhooks (Dodo Payments)
Receive notifications about payment and subscription events:Payment Events
payment.succeeded
payment.succeeded
Triggered when a payment is successfully processed.
payment.failed
payment.failed
Triggered when a payment fails.Includes
error_code and error_message fields in the data object.payment.processing
payment.processing
Triggered when a payment is being processed (async payment methods).
payment.cancelled
payment.cancelled
Triggered when a payment is cancelled by the user or system.
Subscription Events
subscription.active
subscription.active
Triggered when a subscription becomes active.
subscription.renewed
subscription.renewed
Triggered when a subscription is successfully renewed.
subscription.cancelled
subscription.cancelled
Triggered when a subscription is cancelled.Includes
cancelled_at timestamp and cancel_at_next_billing_date boolean.subscription.expired
subscription.expired
Triggered when a subscription expires.
subscription.failed
subscription.failed
Triggered when subscription renewal payment fails.
subscription.on_hold
subscription.on_hold
Triggered when a subscription is put on hold (e.g., failed payment retry).
subscription.plan_changed
subscription.plan_changed
Triggered when a user changes their subscription plan.
Integration Webhooks (Composio)
Receive notifications for third-party integration triggers:Event Structure
Trigger type (e.g., GMAIL_NEW_EMAIL_RECEIVED, SLACK_RECEIVE_MESSAGE)
Entity ID from Composio (mapped to GAIA user_id)
Unique connection identifier
Event-specific payload data
Webhook Security
Dodo Payments Verification
Dodo Payments webhooks should be verified using the signature header:IP Allowlisting
For enhanced security, allowlist webhook source IPs:- Dodo Payments: Contact Dodo support for IP ranges
- Composio: Webhook IPs documented at docs.composio.dev
Configuring Webhooks
Dodo Payments
- Log in to Dodo Payments dashboard
- Navigate to Developers → Webhooks
- Add webhook endpoint:
https://api.heygaia.io/api/v1/webhook/dodo - Select events to receive
- Save webhook configuration
Composio Triggers
Composio webhooks are automatically configured when you:- Connect an integration via GAIA
- Enable triggers in integration settings
- Composio sends webhook events to GAIA’s endpoint
Webhook Payload Examples
Payment Succeeded
Subscription Active
Webhook Retry Logic
Dodo Payments
- Retries failed webhooks with exponential backoff
- Maximum 5 retry attempts
- Webhooks expire after 72 hours
Composio
- Automatic retries for 5xx errors
- No retries for 4xx errors
- 24-hour retry window
Response Requirements
Webhook endpoints must:- Respond quickly - Return
200 OKwithin 30 seconds - Process asynchronously - Queue heavy processing for background jobs
- Handle idempotency - Same webhook may be delivered multiple times
Testing Webhooks
Local Development
Use ngrok or similar tools to expose localhost:Webhook Testing Tools
- Dodo Dashboard: Send test webhook events
- Composio Dashboard: Trigger test events
- Postman: Manually craft webhook payloads
Monitoring Webhooks
GAIA logs all webhook events for debugging:- Application logs (CloudWatch, Datadog, etc.)
- Dodo Payments dashboard
- Composio dashboard
Next Steps
Chat API
Stream AI-powered conversations
Todos API
Manage tasks and projects