How to setup your first webhook?

Connecting your business to RevOps is exciting and helps unlock new opportunities for automating your billing, feature activation, and notify different teams in your business what to do after a customer signs.

We use a simple example to show how deal-activated events can be used to enable feature flags. It is a simple application but demonstrates the power webhooks.

With this guide, you will:

  1. Create a webhook endpoint.
  2. Utilize information from a Deal.
  3. Print a message out in your app.

How do RevOps Webhooks work?

On every change that occurs to a Deal in RevOps, a webhook request will be sent to the URL(s) configured in your RevOps account. This request will contain information about the event.

Webhooks under the hood

URLs for webhooks are configured in your RevOps instance inside Settings > Webhook

The following is a python example, but can be adapted to any language.

Installation requirements

  1. ngrok
  2. python Python >=3.6
  3. pip

Step 1: Clone & run the example webhook server

Get started by cloning the following project from GitHub.

$> git clone
$> cd revops-webhook-server
$> pip install -r requirements.txt
$> python
$> ngrok http 3005

Start with, which uses Flask to handle a JSON POST request.

The following snippet is an example webhook server included:

Step 2: Connect your webhook server to RevOps

You must have been assigned a developer role in RevOps to access settings.

  1. Log in to your RevOps account.
  2. Go to Settings > Webhook
  3. Create a new webhook endpoint, and set the public facing ngrok url. Example:
  4. Click Save.
  5. Test with a specific Deal Id from your instance. See All Deals and grab your deal id from the URL.
  6. Click the Test Configuration button.

An example of a completed test! Webhooks Configuration

Step 3: Error handling

Let's extend the example a bit to handle errors when communicating to your own feature flag service.

from flask import Flask, request

app = Flask(__name__)

@app.route("/deals/activated", methods=['POST'])
def deal_activated():
    """ Get flags from deal activation """
    # Create a response object from the webhook's json
    response = request.get_json()

    # Get the deal
    deal = response.get('deal', {})
    flags = deal.get('feature_flags', [])

      for flag in flags:
        name = flag.get('name')
        enabled = flag.get('enabled', False)
        if enabled == True:
          print(f"Enabling FeatureFlag {name}")
          raise Exception("A problem occurred setting a flag")
    except Exception as e:
      print('An error occurred trying to set flags')
      # Return 500 will tell RevOps to retry requests
      return str(e), 500

    return 'received!', 200

if __name__ == "__main__":, port=3005)