Webhook Lifecycle Events
Mapped publishes an event when anyone in your org creates or deletes a webhook. Subscribe to them to audit who is receiving your org's events, or to alert when a webhook you depend on is removed.
Events
type | Sent when |
|---|---|
webhooks.subscriptions.created | A webhook was created, in the Console or with createWebhookTarget. |
webhooks.subscriptions.deleted | A webhook was deleted, in the Console or with deleteWebhookTarget. |
Editing, enabling, or disabling a webhook sends no event.
| Attribute | Value |
|---|---|
source | //com.mapped/org/{orgId}/webhooks-subscriptions (note org, singular) |
id | Unique per event. |
Payloads
webhooks.subscriptions.created carries the new webhook, without its endpoint: the URL, credentials, and signing
keys are never included.
{
"id": "WHSUBMgoLD3fHY329pKANvdAb12",
"name": "Connector changes",
"eventFilters": {
"jsonExpressionFilter": {
"jsonPathExpression": "@.type == 'connectorEntitiesChangelog'"
}
},
"maxRetry": "10",
"enabled": true,
"eventExtensions": { "team": "facilities" }
}
| Field | Description |
|---|---|
id | The webhook's ID. |
name | Its name. |
eventFilters | Its filter. |
maxRetry | Its retry count, as a string. |
enabled | Whether it was created enabled. |
contentMode | Its content mode, when set. |
eventExtensions | Its custom extensions, when set. |
The payload can also have other fields; ignore those you don't use.
webhooks.subscriptions.deleted carries the ID of the deleted webhook:
{
"target_id": "WHSUBMgoLD3fHY329pKANvdAb12"
}
Using Them
@.type == 'webhooks.subscriptions.created' || @.type == 'webhooks.subscriptions.deleted'
Don't count on a webhook receiving its own creation event: a new webhook can take up to a minute to start receiving
events. To see every webhook in your org at any time, use the webhookTargets query.