HashiCorp Cloud Platform
Webhooks for HCP Vault Secrets
Webhooks can be used to notify other systems when certain events take place within HCP Vault Secrets. You can define webhooks within your HCP project settings. Refer to the webhooks documentation for additional information on how to create webhooks and review the standard payload format.
Events
HCP Vault Secrets sends webhook payloads for the following events.
- Create application
- Deleted application
- Created secret
- Updated secret
- Deleted secret
- Rotated secret
- Created integration
- Updated integration
- Deleted integration
Below are some example webhook payloads. The event payload for HCP Vault Secrets events contain attributes specific to the secret type or integration type and application they belong to within the HCP project.
Rotated secret
{
"resource_id": "21c6c23c-730b-4fab-a869-665b795e7778",
"resource_name": "secrets/project/00000000-0000-0000-0000-000000000002/app/my-app",
"event_id": "secrets.event:LgPdbzgTJQFN7Q7ftDgq",
"event_action": "rotate",
"event_description": "Rotate a secret",
"event_source": "hashicorp.secrets.secret",
"event_version": "1",
"event_payload": {
"app_name": "my-app",
"name": "my-secret",
"organization_id": "00000000-0000-0000-0000-000000000001",
"principal_id": "00000000-0000-0000-0000-000000000003",
"project_id": "00000000-0000-0000-0000-000000000002",
"provider": "mongodb-atlas",
"timestamp": "2024-07-30T13:29:08Z",
"type": "rotating",
"version": 2
}
}
Updated static secret
{
"resource_id": "5b03a2cc-c80f-49b0-8129-4090465e4fb1",
"resource_name": "secrets/project/00000000-0000-0000-0000-000000000002/app/my-app",
"event_id": "secrets.event:Lp8jdBcfLgcdCHNHjQbr",
"event_action": "update",
"event_description": "Update an existing KV secret",
"event_source": "hashicorp.secrets.secret",
"event_version": "1",
"event_payload": {
"app_name": "my-app",
"name": "my-secret",
"organization_id": "00000000-0000-0000-0000-000000000001",
"principal_id": "00000000-0000-0000-0000-000000000003",
"project_id": "00000000-0000-0000-0000-000000000002",
"timestamp": "2024-07-09T15:39:45Z",
"type": "static",
"version": 2
}
}
Create static secret
{
"resource_id": "5b03a2cc-c80f-49b0-8129-4090465e4fb1",
"resource_name": "secrets/project/00000000-0000-0000-0000-000000000002/app/my-app",
"event_id": "secrets.event:RHmdKFBbF6pCc8t6NkDp",
"event_action": "create",
"event_description": "Create a new KV secret",
"event_source": "hashicorp.secrets.secret",
"event_version": "1",
"event_payload": {
"app_name": "my-app",
"name": "my-secret",
"organization_id": "00000000-0000-0000-0000-000000000001",
"principal_id": "00000000-0000-0000-0000-000000000003",
"project_id": "00000000-0000-0000-0000-000000000002",
"timestamp": "2024-07-09T15:38:38Z",
"type": "static",
"version": 1
}
}
Create an integration
{
"resource_id": "secrets.integration:wgc66Hp9hQcTGJGrtdf6",
"resource_name": "secrets/project/00000000-0000-0000-0000-000000000002/integration/my-integration",
"event_id": "secrets.event:QFprrT6JtBrGgwGHFHHz",
"event_action": "create",
"event_description": "Create an integration",
"event_source": "hashicorp.secrets.integration",
"event_version": "1",
"event_payload": {
"name": "my-integration",
"organization_id": "00000000-0000-0000-0000-000000000001",
"principal_id": "00000000-0000-0000-0000-000000000003",
"project_id": "00000000-0000-0000-0000-000000000002",
"provider": "mongodb-atlas",
"timestamp": "2024-07-30T14:40:08Z"
}
}
Create application
{
"resource_id": "5b03a2cc-c80f-49b0-8129-4090465e4fb1",
"resource_name": "secrets/project/00000000-0000-0000-0000-000000000002/app/my-app",
"event_id": "secrets.event:fPzrNJLbqK7LzPdQWwb7",
"event_action": "create",
"event_description": "Create an application",
"event_source": "hashicorp.secrets.app",
"event_version": "1",
"event_payload": {
"name": "my-app",
"organization_id": "00000000-0000-0000-0000-000000000001",
"principal_id": "00000000-0000-0000-0000-000000000003",
"project_id": "00000000-0000-0000-0000-000000000002",
"timestamp": "2024-07-09T15:36:45Z"
}
}