This guide walks you through the complete flow: authenticate, create a family, add a child, generate policies, connect a platform, and trigger enforcement.
Set your API key as an environment variable:
export PHOSRA_API_KEY="phosra_live_sk_your_key_here"The fastest path. Creates everything in a single request:
curl -X POST https://phosra-api.fly.dev/api/v1/setup/quick \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"child_name": "Emma",
"birth_date": "2016-03-15",
"strictness": "recommended"
}'This returns a family, child, active policy, all 45 rules configured for the child's age, and a summary of key settings.
For more control over each stage.
curl -X POST https://phosra-api.fly.dev/api/v1/families \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Doe Family"}'curl -X POST https://phosra-api.fly.dev/api/v1/families/$FAMILY_ID/children \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Emma",
"birth_date": "2016-03-15"
}'# Create policy
curl -X POST https://phosra-api.fly.dev/api/v1/children/$CHILD_ID/policies \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Default Policy"}'
# Generate age-appropriate rules
curl -X POST https://phosra-api.fly.dev/api/v1/policies/$POLICY_ID/generate-from-age \
-H "Authorization: Bearer $PHOSRA_API_KEY"
# Activate the policy
curl -X POST https://phosra-api.fly.dev/api/v1/policies/$POLICY_ID/activate \
-H "Authorization: Bearer $PHOSRA_API_KEY"curl -X POST https://phosra-api.fly.dev/api/v1/compliance \
-H "Authorization: Bearer $PHOSRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"family_id": "'$FAMILY_ID'",
"platform_id": "nextdns",
"credentials": "your-nextdns-api-key"
}'curl -X POST https://phosra-api.fly.dev/api/v1/children/$CHILD_ID/enforce \
-H "Authorization: Bearer $PHOSRA_API_KEY"curl https://phosra-api.fly.dev/api/v1/enforcement/jobs/$JOB_ID/results \
-H "Authorization: Bearer $PHOSRA_API_KEY"