Configuring webhooks in CloudBees Feature Management

3 minute readExtensibility

Webhooks in CloudBees Feature Management are real-time notifications that are triggered when an event happens in the system. Webhooks can be configured to listen to events within a specific environment or all environments.

The event listener triggers a custom HTTP callback. The callback pushes an HTTP POST payload to the user-defined URL.

Webhook Configuration

Implementing webhooks to receive real time event notifications.

Watch the video
Your webhook endpoint should respond within 5 seconds with a success HTTP status code (200-299). If longer processing is required, your webhook endpoint should respond to the webhook POST, then handle the notification asynchronously by switching to a different thread, or by placing the notification on a queue to be processed elsewhere.
Sample payload
{ "channel": { "name": "test", "url": "https://example.net/api/webhook" }, "flag": "E2E Test Flag 1613570517455", "user": { "email": "example@email.com", "name": "Samuel Exampleton" }, "applicationName": "My Example App", "environmentName": "Production", "action": "changed flag visibility", "message": "Flag 'E2E Test Flag 1613570517455' visibility set to hidden" }
Example using interfaces for the payload
export interface IWebhookPayload { channel: { name: string url: string } flag: string user: { email: string name: string } | { externalUserUrl: string externalUserName: string } applicationName: string environmentName: string targetGroup: string action: string message: string }

Creating a webhook

To create a webhook:

  1. Sign in to CloudBees Feature Management as an administrator.

  2. Navigate to App Settings in the left-hand column.

  3. On the Integrations tab in the Webhooks section, select Create.

  4. Configure each field in the New webhook dialog as follows:

    • Webhook name: Enter a name for the webhook.

    • Webhook events: Select the type of events to report on; All changes per application or Changes in specific environments.

    • Environments: Specify one or more environments from the Environments dropdown. Note: This field is only required if Changes in specific environments is selected in Webhook events.

    • Payload example: Optionally, you can copy the payload by selecting Copy.

    • URL: Enter the URL that the webook will POST to, then select Test.

    The test verifies whether the URL is valid. If the test is successful, a green banner will display the HTTP status code that the endpoint responded with, for example: API returned 200 response successfully.
  5. Select Create.

    You will be returned to the Integrations tab.

    If you have created more than one webhook, you will see it listed on the Integrations tab.
  6. Turn on the toggle in the Webhooks section to enable the webhook.

    The webhook will not work unless you enable it.
    Enabling a webhook
    Figure 1. Enabling a webhook

Modifying a webhook

To modify a webhook:

  1. Sign in to CloudBees Feature Management as an administrator.

  2. Navigate to App Settings in the left-hand column.

  3. On the Integrations tab, select the webhook. It will appear in the Webhooks section.

  4. Update each field as needed.

  5. Select Update.

Deleting a webhook

Deleting a webhook may result in errors for an app that still uses it. Be sure that no apps are using a webhook before you delete it. Deleting a webhook cannot be undone.

To delete a webhook:

  1. Sign in to CloudBees Feature Management as an administrator.

  2. Navigate to App Settings in the left-hand column.

  3. On the Integrations tab, locate the webhook in the Webhooks section.

  4. Select the delete trashcan icon.

  5. Note the warning text. If you agree, select Yes, I understand the risks associated with this action.

  6. Select Yes, Delete.