Skip to main content
POST
/
webhooks
SDK (@phosra/sdk)
import { PhosraClient } from "@phosra/sdk";

const phosra = new PhosraClient({
  baseUrl: "https://phosra-api-sandbox-production.up.railway.app/api/v1",
  accessToken: process.env.PHOSRA_API_KEY,
});

const result = await phosra.webhooks.create({
  family_id: "f0000000-0000-4000-8000-0000000000f1",
  url: "https://yourapp.com/webhooks/phosra",
  events: ["enforcement.completed", "policy.updated"]
});
console.log(result);
{
  "id": "d41c8f2a-90b7-4e63-a15c-8f0e2b7d3946",
  "family_id": "fcdf4277-ba14-4732-8db5-0369b2c88d8b",
  "url": "https://api.rivera-safety.com/webhooks/phosra",
  "events": [
    "policy.updated",
    "enforcement.completed"
  ],
  "active": true,
  "created_at": "2026-06-18T14:32:07Z",
  "updated_at": "2026-06-30T09:15:44Z"
}
Webhooks deliver real-time events — enforcement completions, verification changes, policy updates — to an HTTPS endpoint you control. Register one, send a test delivery, and inspect the delivery log.
curl -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 '{"url":"https://example.com/hooks/phosra","events":["enforcement.completed"]}'
Use Send a test delivery to fire a sample payload, then read List deliveries to confirm receipt and debug retries.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
family_id
string<uuid>
required
url
string
required

Webhook URL to receive events

events
string[]
required

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

Response

Webhook created

id
string<uuid>

Unique identifier for this resource.

family_id
string<uuid>

Identifier of the family this resource belongs to.

url
string

HTTPS endpoint that receives POSTed webhook events.

events
string[]

List of event types this webhook subscribes to.

active
boolean

Whether the webhook is currently active and receiving deliveries.

created_at
string<date-time>

RFC 3339 timestamp of when the resource was created.

updated_at
string<date-time>

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