Create a webhook subscription
Create a webhook
POST/webhooks
Create a webhook subscription
- This endpoint is used to create a webhook subscription for specific events in your organization or projects.
- Webhooks are scoped to a level (
organization
,project
, orenvironment
) and require areferenceId
that must exist in the corresponding scope. - You can also define entity-specific filters using
entityFilters
, allowing you to limit events to specific resource names, types, or categories.
Scopes
organization
: Applies to all projects/environments under the organization.project
: Targets events within a specific project (e.g. environments, runtimes).environment
: Focused on events within one environment (e.g. runtimes).
Entity Filters
- These allow you to filter only the events that match a particular pattern. For example:
- Filter only runtimes that start with
api-
:\{ "entity": "runtime", "name": "api-%" \}
- Only include clusters from a environment:
\{ "entity": "environment", "name": "dev" \}
- Filter only runtimes that start with
- The combination of
scope
,referenceId
,url
, andentityFilters
must be unique within an organization.
Body
- The
body
property is an optional string that uses the 'mustache' template syntax. If provided, it will be used to format the webhook payload according to the specified template. For example, when integrating with Microsoft Teams, thebody
must follow the structure required by Teams' webhook format. If thebody
property is not provided, the webhook will send the full event data as a JSON object.
Headers
Authorization
: Optional. If provided, it will be included in the webhook request headersX-Custom-Header
: Optional. If provided, it will be included in the webhook request headers
Request
Responses
- 200
- 400
- 404
Webhook created successfully
Bad Request
Not Found