Create a new webhook configuration
POST/accounts/{account_id}/data-security/posture/webhooks
Creates a new webhook configuration for sending finding notifications to external endpoints.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Accepted Permissions (at least one required)
Body ParametersJSON
Create a new webhook configuration
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/data-security/posture/webhooks \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"authentication_type": "Bearer Auth",
"destination_url": "https://example.com/webhook",
"label": "Send to Slack",
"headers": [
{
"key": "Authorization",
"value": "Bearer token123"
},
{
"key": "X-Custom-Header",
"value": "value"
}
],
"signing_secret": "my-secret-key"
}'{
"errors": [
{
"code": 1000,
"message": "Request processed successfully",
"documentation_url": "https://developers.cloudflare.com/api/operations/list-findings",
"source": {
"pointer": "/data/attributes/name"
}
}
],
"messages": [
{
"code": 1000,
"message": "Request processed successfully",
"documentation_url": "https://developers.cloudflare.com/api/operations/list-findings",
"source": {
"pointer": "/data/attributes/name"
}
}
],
"success": true,
"result": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"authentication_type": "Bearer Auth",
"created_at": "2024-01-15T10:30:00Z",
"destination_url": "https://example.com/webhook",
"label": "Send to Gmail",
"status": "enabled",
"updated_at": "2024-01-20T14:45:00Z",
"version": 1,
"headers": [
{
"key": "authorization"
}
]
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "Request processed successfully",
"documentation_url": "https://developers.cloudflare.com/api/operations/list-findings",
"source": {
"pointer": "/data/attributes/name"
}
}
],
"messages": [
{
"code": 1000,
"message": "Request processed successfully",
"documentation_url": "https://developers.cloudflare.com/api/operations/list-findings",
"source": {
"pointer": "/data/attributes/name"
}
}
],
"success": true,
"result": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"authentication_type": "Bearer Auth",
"created_at": "2024-01-15T10:30:00Z",
"destination_url": "https://example.com/webhook",
"label": "Send to Gmail",
"status": "enabled",
"updated_at": "2024-01-20T14:45:00Z",
"version": 1,
"headers": [
{
"key": "authorization"
}
]
}
}