SafeWeb API

Create a webhook endpoint

POST
/api/integrations/webhooks

Header Parameters

SW-PARTNER-ID*string

Partner organization identifier

SW-API-KEY*string

API authentication key

Request Body

application/json

url*string

The URL to receive webhook POST requests

Formaturi
events*array<>

One or more event types to subscribe to

Items1 <= items
active?boolean

Whether the endpoint should start receiving deliveries immediately. Defaults to true.

Defaulttrue

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://connect.safeweb.co/api/integrations/webhooks" \  -H "SW-PARTNER-ID: string" \  -H "SW-API-KEY: string" \  -H "Content-Type: application/json" \  -d '{    "url": "https://partner.example.com/webhooks/safeweb",    "events": [      "breach.new",      "breach.resolved",      "breach.unresolved",      "email.added",      "email.removed"    ]  }'
{
  "success": true,
  "webhook": {
    "id": 1,
    "url": "https://partner.example.com/webhooks/safeweb",
    "secret": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "events": [
      "breach.new",
      "breach.resolved",
      "breach.unresolved",
      "email.added",
      "email.removed"
    ],
    "active": true,
    "created_at": "2026-03-18T12:00:00.000Z"
  }
}

{
  "success": false,
  "error": "Invalid JSON in request body"
}

{
  "success": false,
  "error": "Failed to verify org API key"
}
{
  "success": false,
  "error": "Partner ID and API key are required in headers"
}
{
  "success": false,
  "error": "Failed to create webhook"
}