Skip to main content
POST
/
v1
/
webhooks
Create Webhook
curl --request POST \
  --url https://api.example.com/v1/webhooks \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "events": [
    "<string>"
  ]
}
'
url
string
required
The URL to receive webhook events.
events
string[]
required
Events to subscribe to: email.sent, email.delivered, email.opened, email.clicked, email.bounced, email.complained.

Request

cURL
curl -X POST https://www.unosend.co/api/v1/webhooks \
  -H "Authorization: Bearer un_xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://yourapp.com/webhooks/unosend",
    "events": ["email.delivered", "email.bounced"]
  }'

Response

200
{
  "id": "wh_123",
  "url": "https://yourapp.com/webhooks/unosend",
  "events": ["email.delivered", "email.bounced"],
  "signing_secret": "whsec_abc123...",
  "created_at": "2024-01-15T10:30:00.000Z"
}
Store the signing_secret securely. It’s only shown once and is used to verify webhook signatures.