Create or Update a Webhook

Before you get started

You'll need to have your Access Token and either a Product ID or supported clouds.

Upsert a Webhook

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

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

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

Header API Keys Example:

-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", "redhat"]
    },
    "private_offer_events_enabled": true
}'

Basic Auth Example:

-H 'Authorization: Bearer your-jwt-here' \
-H 'Content-Type: application/json' \
--data-raw '{
    "url": "https://www.your-webhook-callback-url.com",
    "auth": {
          "auth_type": "basic",
          "username": "your-username-here",
          "password": "your-password-here"
     },
    "filters": {
        "supported_clouds": ["aws", "azure", "gcp", "redhat"]
    },
    "private_offer_events_enabled": true
}'

Oauth2 Example:

We use the Client Credentials Flow to use the client_id and client_secret to call the token_url to get an access token.

-H 'Authorization: Bearer your-jwt-here' \
-H 'Content-Type: application/json' \
--data-raw '{
    "url": "https://www.your-webhook-callback-url.com",
    "auth": {
        "auth_type": "oauth2",
        "oauth2": {
            "client_id": "your-client-id-here",
            "client_secret": "your-client-secret-here",
            "token_url": "https://www.token-url-example.com"
        },
    },
    "filters": {
        "supported_clouds": ["aws", "azure", "gcp", "redhat"]
     },
    "private_offer_events_enabled": true
    }'

๐Ÿ“˜

Don't forget the "filters"

The filters object is required. Choose to send one of the following:

  • 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. Product-level webhooks receive notifications for a specific product. When a product-level webhook does not exist, the vendor-level webhook will be used by default. 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. When configuring a vendor-level webhook, you may also specify "private_offer_events_enabled" to a value of true or false. This setting applies to all webhooks, including the vendor-level webhook and all product-level webhooks, and determines if private offer event notifications are enabled.

  2. 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",
                "redhat"
            ]
        },
        "private_offer_events_enabled": true
    },
    "metadata": {
        "link": "https://api.tackle.io/v1/webhooks"
    }
}

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