Create or Update a Webhook

Before you get started

You'll need to have your Access Token and Vendor ID or Product ID ready.

Upsert a Webhook

  1. Set up your webhook URL. This will need to be an endpoint that can receive an HTTP POST request. For our example, we'll use https://www.your-webhook-callback-url.com

  2. Identify the authentication type you want us to use. We support Basic and Header API keys.

  3. Send an authenticated POST request to https://api.tackle.io/v1/webhooks following the Create or Update a Webhook API Reference:

curl -L -X POST 'https://api.tackle.io/v1/authenticate' \
-H 'Authorization: Bearer your-jwt-here' \
-H 'Content-Type: application/json' \
--data-raw '{
    "url": "https://www.your-webhook-callback-url.com",
    "auth": {
        "auth_type": "header_api_key",
        "auth_header_name": "your-auth-header-here",
        "api_key": "your-api-key-here"
    },
    "filters": {
        "supported_clouds": ["aws", "azure", "gcp"]
    }
}'

πŸ“˜

Don't forget the "filters"

The filters object is required. Choose to send either:

  • productid as a string representing the product ID of the product to configure the webhook for
  • supported_clouds as an array of strings representing the cloud providers the webhook will trigger on events for

Sending an empty object will return a 400 Bad Request.

Webhooks can be created at a vendor or product level. Vendor-level webhooks receive notifications for all of your products, while product-level webhooks only receive them for a specific product. If you want to create a vendor-level webhook, you'll want to add "supported_clouds" to the filters object. Otherwise, if you want to create a product-level webhook, you'll want to add "product_id": "your-product-id" instead.

  1. If the request was successful, you will receive a 200 OK response similar to the following:
{
    "data": {
        "url": "https://www.your-webhook-callback-url.com",
        "auth_type": "header_api_key",
        "filters": {
            "supported_clouds": [
                "aws",
                "azure",
                "gcp"
            ]
        }
    },
    "metadata": {
        "link": "https://api.tackle.io/v1/webhooks"
    }
}

Ready to see the code in action? Check out our Create a Webhook recipe!