Skip to main content

Policies & Rules

A policy is a named collection of rules assigned to a child. Policies have a status (draft, active, or paused) and a priority number for ordering when multiple policies exist. A rule belongs to a policy and controls one of 117 rule categories — the closed OCSS v4 vocabulary (internal/domain/models.go, canonical registry at registry/ocss-rules.json). Each rule has:
  • category — which of the 117 categories it controls (e.g., time_daily_limit, content_rating)
  • enabled — whether this rule is active
  • config — category-specific configuration JSON (e.g., {"max_ratings":{"mpaa":"PG-13"}} for content rating)
Only active policies are enforced. You can have multiple policies per child (e.g., “School Day” and “Weekend”) and switch between them using activate/pause.

Quick setup

The fastest path: POST /api/v1/setup/quick creates a family, child, and active policy in one call. Pass child_name, birth_date, and strictness (light, recommended, strict). The response includes max_ratings, rule_summary, and the full rules[] array.
curl -X POST https://prodapi.phosra.com/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"
  }'

Bulk upsert rules

PUT /api/v1/policies/{policyId}/rules/bulk creates or updates multiple rules in one call. The developer surface is identical: PUT /api/v1/developer/policies/{policyId}/rules/bulk. Request body:
{
  "rules": [
    {
      "category": "content_rating",
      "enabled": true,
      "config": {
        "max_ratings": {
          "mpaa": "PG-13",
          "tv": "TV-Y7",
          "esrb": "E"
        }
      }
    },
    {
      "category": "time_daily_limit",
      "enabled": true,
      "config": {
        "daily_minutes": 120
      }
    },
    {
      "category": "web_safesearch",
      "enabled": true,
      "config": {}
    }
  ]
}
Response: []PolicyRule — the full updated rule set for the policy.

Config shapes for common categories

CategoryConfig fieldExample value
content_ratingmax_ratings (object){"mpaa":"PG-13","tv":"TV-Y7","esrb":"E","pegi":"12"}
time_daily_limitdaily_minutes (int){"daily_minutes":120}
time_scheduled_hoursschedule (array of hour ranges){"schedule":[{"days":["mon","tue"],"start":"07:00","end":"21:00"}]}
time_downtimestart_hour, end_hour (ints, 0-23){"start_hour":22,"end_hour":7}
web_filter_levellevel (string){"level":"strict"}
web_category_blockcategories (array of strings){"categories":["adult","gambling"]}

Rule categories

The 117 closed OCSS v4 categories span:
  • Contentcontent_rating, content_block_title, violence_threshold, firearm_content_block, sexual_content_threshold, and 10 more
  • Timetime_daily_limit, time_scheduled_hours, time_per_app_limit, time_downtime, phone_free_school_hours
  • Purchasepurchase_approval, purchase_spending_cap, purchase_block_iap
  • Socialsocial_contacts, social_chat_control, social_multiplayer, stranger_dm_block, stranger_outreach_friction
  • Webweb_safesearch, web_category_block, web_custom_allowlist, web_custom_blocklist, web_filter_level
  • Privacyprivacy_location, privacy_profile_visibility, privacy_data_sharing, data_minimization_enforce, third_party_tracker_block, and more
  • Monitoringmonitoring_activity, monitoring_alerts, content-monitoring categories
  • Algorithmic Safetyalgo_feed_control, addictive_design_control, infinite_scroll_block, autoplay_disable, and more
  • Notificationsnotification_curfew, usage_timer_notification
  • Advertising / Datatargeted_ad_block, dm_restriction, age_gate, data_deletion_request
  • Age Assuranceapp_store_age_attestation, os_age_signal_ingest, age_signal_broadcast, parental_attestation_cert
  • AI Safetyai_chatbot_tier_gate, ai_no_simulated_companionship, ai_chatbot_age_assertion, and 12 more
  • Compliancecsam_reporting, social_media_min_age, student_privacy_school_mode, and more
  • Legislation-drivenparental_consent_gate, parental_event_notification, screen_time_report, commercial_data_ban, and more
  • Integration surfaceage_appropriate_profile_mode, ncii_takedown, adult_site_av_required, app_install_block, cipa_filter_attestation, and more
See GET /api/v1/standards for community packs that pre-configure curated subsets of these categories.