Skip to main content

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.
Parameters 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
Parameters Returns TriggersTypeRetrieveResponse — The trigger type

list_active()

List all active triggers
Parameters

list()

List all the trigger types.
Parameters

create()

Create a trigger instance
Parameters Returns trigger_instance_upsert_response.TriggerInstanceUpsertRes... — The trigger instance

subscribe()

Subscribe to a trigger and receive trigger events.
Parameters 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)
Parameters Returns VerifyWebhookResult — VerifyWebhookResult containing version, normalized payload, and raw payload Raises
  • WebhookSignatureVerificationError — If the signature verification fails
  • WebhookPayloadError — If the payload cannot be parsed or is invalid
Example

parse()

Parse an incoming webhook request into a typed, normalized trigger payload. Pass a framework request object, or pass body= 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().
Parameters Returns VerifyWebhookResult — VerifyWebhookResult containing version, normalized payload, and raw payload Raises
  • ValidationError — If verify_secret is empty, or is set but signature headers are missing
  • WebhookSignatureVerificationError — If signature verification fails
  • WebhookPayloadError — If the payload cannot be parsed
Example

View source