Skip to main content
This guide covers integrating Phosra into your application from scratch, including API key provisioning and your first enforcement run.
One auth header, everywhere. Every raw HTTP call on this page sends your key as Authorization: Bearer $PHOSRA_API_KEY — the one canonical form (X-Api-Key is accepted as an exact equivalent, but we use Bearer consistently so keys, WorkOS JWTs, and MCP tokens all share one header). Full detail: Authentication.

1. Create Your Account

Sign up at dashboard.phosra.com/signup via the WorkOS AuthKit hosted sign-up flow. There is no /auth/register endpoint on the Go API — account creation is handled by WorkOS. Once signed in, continue to step 2. (Full walkthrough: Create your account & get keys.)

2. Get an API Key

Use the developer console’s Keys page or call the API with your WorkOS session:
The response includes the key once. Store it immediately:
Key format: phosra_live_<64 hex chars> (production) or phosra_test_<64 hex chars> (sandbox). There is no _sk_ infix.

3. Use Quick Setup for Onboarding

The fastest path for your end users. When a parent signs up and adds their first child in your app, call the quick setup endpoint — as the signed-in parent, not with your phosra_ key. /setup/quick is a consumer route: in production it authenticates a WorkOS session JWT (Authorization: Bearer <workos_access_token>) belonging to that parent, and a phosra_ key sent instead returns 401. There is no /developer/setup/quick — a server-to-server integration that must act without a parent session builds the same graph from /developer/families, /developer/children, and /developer/policies instead (each of those does accept $PHOSRA_API_KEY).
This returns a family, child, and an active policy with age-appropriate rules populated across the applicable rule categories for the requested strictness level, plus age_group, max_ratings, and rule_summary. Store the family.id and child.id for subsequent calls.
Prefer to try this without any auth first? The Quickstart runs the exact same call against the open sandbox — no credential at all — and shows the real response. In the sandbox /setup/quick is keyless; the WorkOS session requirement above applies to production only.

4. Connect Platforms

For each platform the family uses, create a compliance link:
List available platforms with GET /platforms to see what integrations are supported, and check each platform’s enforcement_mode — one of dns, device, or manual_attested. dns and device apply rules programmatically (a live DNS-provider write, or on-device via the Phosra app); manual_attested returns guided steps for the parent to attest. See Platforms & enforcement modes.

5. Register Webhooks

Set up webhooks to receive real-time event notifications when a child’s policy changes (the full event catalog is exactly five events — policy.updated, pack.adopted, pack.revoked, pack.version.released, test; see Webhook events):
Note: webhooks do not fire on enforcement job completion. To verify enforcement results, poll GET /enforcement/jobs/{jobId}/results — see Enforcement.

6. Trigger Enforcement

Push the policy to all connected platforms, then poll the returned job for results:
A non-empty manual_steps array on any result means that platform is parent-guided, not programmatically applied.

Handle errors

Every failure returns a JSON envelope of the shape {"error", "message", "code"} (OCSS routes add class and, on standing checks, failed_step). Branch on code + class, never on the human-readable message. The full status/class matrix — every 4xx and 5xx, its cause, and its fix — is in the Errors reference. The one you will hit first while wiring auth:

Base URLs

api.phosra.com has no DNS record — do not use it. Use prodapi.phosra.com for production.

Checklist

  • Account created via WorkOS AuthKit
  • Developer org created and API key provisioned (test and production)
  • Quick setup tested with a sandbox child
  • At least one platform connected; enforcement_mode checked
  • Enforcement triggered and results polled (not webhook-waited)
  • Error handling implemented for 4xx and 5xx responses