Skip to main content
POST
/
webhooks
Create Webhook
curl --request POST \
  --url https://api.dfns.io/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-DFNS-USERACTION: <api-key>' \
  --data '{
  "url": "<string>",
  "status": "Enabled",
  "description": "<string>",
  "events": [
    "policy.triggered"
  ]
}'
{
  "id": "<string>",
  "url": "<string>",
  "events": [
    "policy.triggered"
  ],
  "status": "Enabled",
  "description": "<string>",
  "dateCreated": "<string>",
  "dateUpdated": "<string>",
  "secret": "<string>"
}

Authentication

✅ Organization User (CustomerEmployee)
❌ Delegated User (EndUser)
✅ Service Account

Required Permissions

Webhooks:Create: Always required.

Authorizations

Authorization
string
header
required

Bearer Token: Used to authenticate API requests. More details how to generate the token: Authentication flows

X-DFNS-USERACTION
string
header
required

User Action Signature: Used to sign the change-inducing API requests. More details how to generate the token: User Action Signing flows

Body

application/json
url
string
required

Webhook url

events
enum<string>[]
required

All events this webhook is subscribed to.

Minimum length: 1
status
enum<string>

Webhook status

Available options:
Enabled,
Disabled
description
string
Maximum length: 256

Response

200 - application/json

Success

Webhook

id
string
required

Webhook ID

url
string
required

Webhook url

events
enum<string>[]
required

All events this webhook is subscribed to.

status
enum<string>
required

Webhook status

Available options:
Enabled,
Disabled
dateCreated
string
required

Date when webhook was created

dateUpdated
string
required

Date when webhook was last updated

secret
string
required

The secret associated with this webhook, with which webhook requests will be signed.

description
string

Short description this webhook's purpose

I