TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ComposioHQ/composio/llms.txt
Use this file to discover all available pages before exploring further.
Triggers class enables real-time event-driven automation. When a trigger fires — a new email arrives, a GitHub PR is opened, a Slack message is posted — Composio delivers the event to your callback via Pusher WebSocket or HTTPS webhook. Triggers are attached to connected accounts, so each user’s events are isolated.
triggers.subscribe()
Subscribe to all incoming trigger events with optional filters. Maintains a persistent WebSocket connection using Pusher.Callback invoked for each matching trigger event. Receives an
IncomingTriggerPayload.Filter which trigger events are forwarded to your callback. All filters are ANDed together.
IncomingTriggerPayload
Trigger instance ID.
Trigger UUID.
The trigger type slug (e.g.
'GMAIL_NEW_EMAIL').The toolkit that fired the event (e.g.
'GMAIL').The user ID associated with the connected account that fired this event.
The trigger’s event-specific data (e.g. email subject, body, sender for a new email event).
The raw unmodified payload from the upstream service.
Event metadata including
triggerSlug, toolkitSlug, triggerConfig, and connectedAccount details.triggers.unsubscribe()
Disconnect from the real-time event stream. Call this during cleanup to release the WebSocket connection.triggers.create()
Create (or upsert) a trigger instance for a user. If no connected account ID is provided, the first active connected account for the user and toolkit is used.External user ID.
Trigger type slug (e.g.
'GMAIL_NEW_EMAIL').Specific connected account to attach this trigger to.
Trigger-specific configuration (e.g. label filter for Gmail, event type for GitHub).
TriggerInstanceUpsertResponse
ID of the created or updated trigger instance.
triggers.listActive()
List all active trigger instances with optional filtering.Filter by connected account IDs.
Filter by auth config IDs.
Filter by trigger instance IDs.
Filter by trigger type slugs.
Include disabled trigger instances. Defaults to
false.Pagination cursor.
Maximum items per page.
triggers.listTypes()
List available trigger types, optionally filtered by toolkit.Filter to specific toolkit slugs.
Pagination cursor.
Maximum items per page.
triggers.getType()
Retrieve a specific trigger type by its slug.triggers.update()
Update an existing trigger instance’s configuration.ID of the trigger instance to update.
Fields to update on the trigger instance (e.g.
triggerConfig, status).triggers.delete()
Delete a trigger instance.triggers.enable() / disable()
Enable or disable a trigger instance without deleting it.triggers.verifyWebhook()
Verify and parse an incoming webhook payload. Validates the HMAC-SHA256 signature and checks the timestamp is within tolerance.Raw request body as a string. Do not JSON-parse before passing.
Value of the
webhook-signature HTTP header.Webhook secret from the Composio dashboard.
Value of the
webhook-id HTTP header.Value of the
webhook-timestamp HTTP header (Unix seconds).Maximum allowed webhook age in seconds. Defaults to
300 (5 minutes). Pass 0 to disable timestamp validation.VerifyWebhookResult
Detected webhook payload format version.
Normalized trigger payload.
Raw parsed payload before normalization.
Examples
- Subscribe to Gmail new email
- Subscribe to GitHub events
- Verify a webhook
- List active triggers