Create a webhook subscription

POST/webhooks

Register a webhook endpoint to receive event notifications.

Auth:Bearer

Request body

family_id

uuidrequired
url

Webhook URL to receive events

stringrequired
events

Events to subscribe to (e.g. policy.updated, enforcement.completed)

string[]required

Response

id

Unique identifier for this resource.

uuid
family_id

Identifier of the family this resource belongs to.

uuid
url

HTTPS endpoint that receives POSTed webhook events.

string
events

List of event types this webhook subscribes to.

string[]
active

Whether the webhook is currently active and receiving deliveries.

boolean
created_at

RFC 3339 timestamp of when the resource was created.

datetime
updated_at

RFC 3339 timestamp of the resource's most recent update.

datetime
Request
bash
curl -sS -X POST "https://phosra-api-sandbox-production.up.railway.app/api/v1/webhooks" \
  -H "Authorization: Bearer $PHOSRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "family_id": "f0000000-0000-4000-8000-0000000000f1",
  "url": "https://yourapp.com/webhooks/phosra",
  "events": [
    "enforcement.completed",
    "policy.updated"
  ]
}'
Response
json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "family_id": "550e8400-e29b-41d4-a716-446655440000",
  "url": "string",
  "events": [
    "string"
  ],
  "active": true,
  "created_at": "2025-01-15T09:30:00Z",
  "updated_at": "2025-01-15T09:30:00Z"
}