diff --git a/docs/documentation/platform/webhooks.mdx b/docs/documentation/platform/webhooks.mdx new file mode 100644 index 000000000..e0de7be05 --- /dev/null +++ b/docs/documentation/platform/webhooks.mdx @@ -0,0 +1,36 @@ +--- +title: "Webhooks" +description: "How Infisical webhooks works?" +--- + +Webhooks can be used to trigger changes to your integrations when secrets are modified, providing smooth integration with other third-party applications. + +![webhooks](../../images/webhooks.png) + +To create a webhook for a particular project, go to `Project Settings > Webhooks`. + +When creating a webhook, you can specify an environment and folder path (using glob patterns) to trigger only specific integrations. + +## Secret Key Verification + +A secret key is a way for users to verify that a webhook request was sent by Infisical and is intended for the correct integration. + +When you provide a secret key, Infisical will sign the payload of the webhook request using the key and attach a header called `x-infisical-signature` to the request with a payload. + +The header will be in the format `t=;`. You can then generate the signature yourself by generating a SHA256 hash of the payload with the secret key that you know. + +If the signature in the header matches the signature that you generated, then you can be sure that the request was sent by Infisical and is intended for your integration. The timestamp in the header ensures that the request is not replayed. + +### Webhook Payload Format + +```json +{ + "event": "secret.modified", + "project": { + "workspaceId":"the workspace id", + "environment": "project environment", + "secretPath": "project folder path" + }, + "timestamp": "" +} +``` diff --git a/docs/images/webhooks.png b/docs/images/webhooks.png new file mode 100644 index 000000000..a726e77a0 Binary files /dev/null and b/docs/images/webhooks.png differ diff --git a/docs/mint.json b/docs/mint.json index d9b72e4e2..e496d7638 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -114,6 +114,7 @@ "documentation/platform/project", "documentation/platform/folder", "documentation/platform/secret-reference", + "documentation/platform/webhooks", "documentation/platform/pit-recovery", "documentation/platform/secret-versioning", "documentation/platform/audit-logs",