Create policy for child

POST/children/{childID}/policies

Create a new policy for a child. Policies start in 'draft' status.

Auth:Bearer

Path parameters

childID

uuidrequired

Request body

name

stringrequired

Response

id

Unique identifier for this resource.

uuid
child_id

Identifier of the child this resource belongs to.

uuid
name

Human-readable display name.

string
status

Current lifecycle state of the resource.

active | paused | draft
priority

Ordering weight when multiple policies apply; higher wins.

integer
version

Monotonically increasing version, bumped on every change.

integer
created_at

RFC 3339 timestamp of when the resource was created.

datetime
Request
bash
curl -sS -X POST "https://phosra-api-sandbox-production.up.railway.app/api/v1/children/a11ce0fa-0000-4000-8000-0000000000a1/policies" \
  -H "Authorization: Bearer $PHOSRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "After-school limits"
}'
Response
json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "child_id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "string",
  "status": "active",
  "priority": 0,
  "version": 0,
  "created_at": "2025-01-15T09:30:00Z"
}