Webhooks provide a way to receive real-time notifications when specific events occur in your Composio account. Instead of continuously polling for changes, webhooks push data to your application as events happen, making them ideal for building responsive integrations.

Configuring Your Webhook

1

Set Up Your Webhook URL in Composio

  1. Navigate to your Composio Dashboard
  2. Access the Settings section
  3. Locate and click on Events and Triggers
  4. For App triggers enter your webhook url in Trigger Webhook and for admin triggers add your webhook url in Admin Event Webhook
  5. Confirm by clicking the Update button
2

Install Required Packages

pip install flask
3

Implement the Webhook Receiver

import json
from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route('/webhook', methods=['POST'])
def webhook():
    if request.method == 'POST':
        payload = request.json
        print(json.dumps(payload, indent=2))
        return jsonify(success=True), 200
    return jsonify(success=False), 405

if __name__ == '__main__':
    app.run(debug=True, port=5000)

Understanding the Webhook Payload

Below is the payload for an app trigger for Slack’s SLACK_RECEIVE_MESSAGE trigger.

{
  "trigger_name": "SLACK_RECEIVE_MESSAGE",
  "connection_id": "7baac1d4-e3be-41ae-9550-5ce9829579c9",
  "trigger_id": "fb36f8db-caf0-4d2c-9cd6-0cb575a5689e",
  "payload": {
    "channel": "C07JB863EBW",
    "user": "U07JMDFMR7B",
    "text": "hey",
    "ts": "1733236813.895519",
    "team_id": "T07J24QFB62",
    "bot_id": null,
    "channel_type": "channel"
  }
}