How to validate a Webhook in python


I’m trying to send the challenge test using python, I’m stuck with that any input.


Hey @Jorgemolina,

Thanks for reaching out.

When we send you the challenge, you can just respond with the same data as your app receives. To be transparent with you, I am not a Python developer myself, but this StackOverflow thread seems to provide a quick solution for a similar issue in Python.

I hope this helps clarify.


I managed myself, just leave it to get access through webhook using python/flask (this code is just a test but it works

from flask import Flask, request, abort, jsonify

app = Flask(__name__)

@app.route('/webhook', methods=['POST'])
def webhook():
    if request.method == 'POST':
        data = request.get_json()
        challenge = data['challenge']
        return jsonify({'challenge': challenge})

        # print(request.json)
        # return 'success', 200

if __name__ == '__main__':


Thanks so much for sharing your solution with us in the community! If you don’t mind, I could add this to our docs and mention that you’ve provided this code as an example starter solution for validating webhooks via Python.


Yes, Alex please use it for your docs. I hope this help.

1 Like


I really appreciate that! Thanks so much for helping us make our API more accessible :slight_smile: Kudos to you, sir!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.