Skip to main content
Real households are not one child. This recipe onboards one family with two kids of different ages and gives each an age-appropriate policy that Phosra generates from their birth date — a 9-year-old and a 16-year-old end up with genuinely different rules, screen-time, and rating ceilings, from the same three lines of code. You will chain five endpoints: Every request and response below is verbatim live output, captured by running these exact calls against https://phosra-api-sandbox-production.up.railway.app. No API key, nothing to install.
Sandbox-first. These calls run against the open sandbox with no credential — nothing you create touches a real family. The shapes are identical in production: swap the base URL for https://prodapi.phosra.com and authenticate as the signed-in parent with a WorkOS session JWT (these are consumer routes; a phosra_ developer key does not work here). See Authentication.

Before you start

Set the base URL once so every step is copy-paste:
1

Onboard the family with the first child

POST /setup/quick onboards a family, the first child, and an age-appropriate starter policy in one call. Give it the younger child — Leo, age 9.
The response returns the family, the child, a fully-seeded policy, and a rule_summary — Leo, at 9, lands in the child age group with a 90-minute daily limit and a PG rating ceiling. Truncated to what you carry forward:
Keep family.id (the next child is added to it) and child.id (Leo, for the ratings check at the end):

Reference: quickstart · setup/quick

The one-call onboarding path, with the full request and response documented.
2

Add the second child

The teenager is added to the same family with POST /families/{familyID}/children. Only a name and birth date are required — Ava, age 16.
Adding a child does not create a policy — unlike setup/quick, which bundles one. That is the next two steps: create a draft policy, then fill it from Ava’s age.
3

Create a draft policy for the teen

POST /children/{childID}/policies creates an empty draft policy. It has no rules yet — you fill it in the next step.
4

Generate rules from Ava's age

This is the load-bearing call. POST /policies/{policyID}/generate-from-age looks up the child on the policy, computes their age, and fills the policy with an age-appropriate rule set at the strictness you pass. We use strict for the teen.
The call returns the generated rules. Ava’s set is tuned to 16, not 9 — a longer daily limit, a PG-13 ceiling, a lighter web filter, contacts-only DMs, a later curfew, and no age gate:
Compare with Leo’s seeded policy from step 1 — same family, same code, different child:
generate-from-age replaces the policy’s rules — it is a regenerate, not a merge. A policy with no resolvable child returns 400. To hand-edit an individual rule afterward, see Change a rule and enforce it.
5

Activate the policy

A generated policy is still a draft. POST /policies/{policyID}/activate makes it the child’s live policy and stamps a version.
Both children now have an active, age-tuned policy. Leo’s went live at step 1; Ava’s is live now.
6

Confirm each child's rating ceiling

Isolation across children is not just “two policies exist” — it is “each policy matches that child’s age.” GET /children/{childID}/age-ratings returns the rating ceiling Phosra computes from a child’s birth date. Run it for both and the numbers line up with the policies you just generated.
Leo’s ceiling is PG / CSM 7+; Ava’s is PG-13 / CSM 13+ — exactly the content_rating rule each policy carries. One family, two children, two correct ceilings.

The whole flow at a glance

Every row is one call you just ran, in order:

Next steps

Change a rule and enforce it

Tighten one of these rules and push it to a connected platform — then read back what landed.

End-to-end walkthrough

Link two platforms to this family, unlink one, and prove per-service isolation.

Families & kids

The full family, child, and policy resource model behind these calls.

Strictness levels

How recommended, strict, and relaxed shift limits — and why the rating ceiling follows age.