Adding Webhooks

Learn how to use Webhooks in Humanitec.

Introduction

Webhooks allow you to set up complex workflows by connecting your Internal Developer Platform with other systems (e.g., to send a Slack or Microsoft Teams message once a Deployment has successfully finished). In this section, you will learn how to create, edit, delete a Webhook for your App and how to modify the Webhook payload.

Create a Webhook

You can create a new Webhook on your App Settings Screen.

  • Select the Webhooks tab.

  • Insert your Webhook name and URL.

  • If needed, add Headers or Modify Payload.

  • Click Create

You will see a webhook added below.

Example for a Webkook

Modify a Webhook Payload

All webhooks by default are set to All triggers and have a default payload that contains only the common properties of all the selected events.

{
"event": "${event}",
"triggered_at": "${triggered_at}",
"triggered_by": "${triggered_by}",
"org_id": "${org_id}",
"app_id": "${app_id}",
"env_id": "${env_id}"
}

You can change the payload by selecting a different trigger from the triggers dropdown. The payload will change accordingly.

You can also customize the payload by using placeholders. Every payload parameter is available to a user as a placeholder with the format ${parameter_name}.

Common Parameters

Parameter

Description

event

The ID of the event

org_id

The organization the event occurred in

triggered_at

The datetime of triggering the underlying event

triggered_by

The user who triggered the underlying event

environment.created and environment.deleted Events

Parameter

Description

app_id

The application the environment created in

env_id

The environment ID

name

The environment name

type

The environment type

deployment.started and deployment.finished Events

Parameter

Description

app_id

The application the deployment occurred in

env_id

The environment the deployment occurred in

deploy_id

The deployment ID

delta_id

The deployment delta id

set_id

The deployment set id

comment

The deployment comment

status

The deployment status

Example payload for a deployment.finished event:

{
"event": "${event}",
"org_id": "${org_id}",
"app_id": "${app_id}",
"env_id": "${env_id}",
"triggered_at": "${triggered_at}",
"triggered_by": "${triggered_by}",
"deploy_id": "${deploy_id}",
"delta_id": "${delta_id}",
"set_id": "${set_id}",
"comment": "${comment}",
"status": "${status}"
}

Edit or Delete a Webhook

You can edit or delete the Webhook by clicking on the three dots on the right side of your Webhook.

Edit or delete the Webhook

Webhook examples can be found here