Methods
set_webhook_subscription()
Create or update the project webhook subscription used for webhook delivery. If a subscription already exists, the first subscription is updated. Otherwise a new subscription is created. By default this subscribes to V3 trigger message events.
Returns
WebhookSubscription
Example
get_type()
Get a trigger type by its slug Uses the global toolkit version provided when initializing composio instance to fetch trigger for specific toolkit version
Returns
TriggersTypeRetrieveResponse — The trigger type
list_active()
List all active triggerslist()
List all the trigger types.create()
Create a trigger instance
Returns
trigger_instance_upsert_response.TriggerInstanceUpsertRes... — The trigger instance
subscribe()
Subscribe to a trigger and receive trigger events.
Returns
TriggerSubscription — The trigger subscription handler.
verify_webhook()
Verify an incoming webhook payload and signature. This method validates that the webhook request is authentic by: 1. Validating the webhook timestamp is within the tolerance window 2. Verifying the HMAC-SHA256 signature using the correct algorithm 3. Parsing the payload and detecting the webhook version (V1, V2, or V3)
Returns
VerifyWebhookResult — VerifyWebhookResult containing version, normalized payload, and raw payload
Raises
WebhookSignatureVerificationError— If the signature verification failsWebhookPayloadError— If the payload cannot be parsed or is invalid
parse()
Parse an incoming webhook request into a typed, normalized trigger payload. Pass a framework request object, or passbody= and headers= explicitly. When verify_secret is provided, the SDK verifies the webhook signature before returning the normalized trigger payload. When it is omitted, the SDK parses the body without verifying the signature. request may be any object exposing the request body and headers, such as a Flask, Django, or FastAPI request. The body is read from .body (or .data / .get_data()), and the headers are read from .headers. Because this SDK is synchronous, async frameworks must pass an already-read raw body, for example via body=await request.body().
Returns
VerifyWebhookResult — VerifyWebhookResult containing version, normalized payload, and raw payload
Raises
ValidationError— Ifverify_secretis empty, or is set but signature headers are missingWebhookSignatureVerificationError— If signature verification failsWebhookPayloadError— If the payload cannot be parsed
View source