{"openapi":"3.1.0","info":{"title":"منصّة الشعب · Platform API","version":"1.0.0-dev+c9d4db4cae2e","summary":"Generated from platform/pn/*.py by platform/tools/openapi.py. Do not edit by hand.","description":"«وثيقة عمل — للنقاش». Human contract: platform/docs/API.md. Every handler checks permission and scope server-side (deny by default). Phase-1 tables hold no pupil names or identifiers.","license":{"name":"Proprietary (DIT AT MS); licence terms in the agreement","identifier":"LicenseRef-DIT-AT-MS"}},"jsonSchemaDialect":"https://spec.openapis.org/oas/3.1/dialect/base","servers":[{"url":"http://localhost:8100","description":"local dev (start.sh)"},{"url":"https://staging.projetnational.org","description":"staging (fictional seed)"}],"security":[{"session":[]}],"tags":[{"name":"Admin","description":"7. Admin (user management)"},{"name":"Aggregates, exports, jobs","description":"6. Aggregates, exports, jobs"},{"name":"Auth","description":"3. Auth"},{"name":"Class continuity","description":"16. Class continuity"},{"name":"Class rosters and class records","description":"16. Class rosters and class records («قسمي» on the server; phase 2: closed, 25 Nov 2026)"},{"name":"Cookies and CSRF","description":"2. Cookies and CSRF"},{"name":"Data + ML pipeline: ops API, export upload, live scores","description":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},{"name":"Director decisions","description":"Director decisions"},{"name":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures","description":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},{"name":"Family","description":"Family (guardians): both guardians share the child's space (pn/guardians.py, 28 Nov 2026; phase 2: closed)"},{"name":"Inclusive","description":"Inclusive"},{"name":"Inspector space, server-backed","description":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},{"name":"Inspector work, server-backed","description":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},{"name":"Lesson-prep journal, shares with the inspector, reviews, visits, school roster","description":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},{"name":"Me and notifications","description":"4. Me and notifications"},{"name":"Official class assignments for attendance counts","description":"Official class assignments for attendance counts"},{"name":"Ops","description":"8. Ops"},{"name":"Paper-activity","description":"Paper-activity"},{"name":"Parent access","description":"15. Parent access (phase 2: closed)"},{"name":"Parent guidance, confidential bullying reports and ministry indicators","description":"Parent guidance, confidential bullying reports and ministry indicators"},{"name":"Plans","description":"5. Plans (sample school-scoped resource, no pupil data)"},{"name":"Print-agent","description":"Print-agent"},{"name":"Print-packs","description":"Print-packs"},{"name":"SMS to parents through a school gateway","description":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},{"name":"School print packs","description":"School print packs"},{"name":"School team","description":"School team"},{"name":"Schools","description":"Schools"},{"name":"Single-case pool and plan records","description":"17. Single-case pool and plan records («ما ينجح لأطفال يشبهونه», pn/n1pool.py, 25 Nov 2026; flag PN_FEATURE_N1_POOL)"},{"name":"Stage 2 · Student accounts","description":"Stage 2 · Student accounts"},{"name":"Support plans and pupil-level ML","description":"12. Support plans and pupil-level ML (phase 2: closed)"},{"name":"Teacher circles, coaching cycles, lesson study, indicators","description":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},{"name":"Teacher workspace and sync","description":"11. Teacher workspace and sync (22 Nov 2026, phase 1)"},{"name":"Teacher–parent messages","description":"Teacher–parent messages («مراسلة الوليّ», pn/messages.py, 28 Nov 2026; phase 2: closed)"},{"name":"Voice assistant inside the page scope","description":"Voice assistant inside the page scope (pn/assist.py, 28 Nov 2026)"},{"name":"«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts","description":"«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts (pn/recognition.py, 28 Nov 2026)"}],"paths":{"/api/admin/audit":{"get":{"operationId":"get_admin_audit","tags":["Admin"],"summary":"{items:[{seq, ts, actor_id, action, target, scope, outcome, request_id}]}","x-pn-source":"platform/pn/routes.py audit_list()","description":"GET /api/admin/audit?action=&limit=&cursor= {items:[{seq, ts, actor_id, action, target, scope, outcome, request_id}]}","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"x-pn-permissions":["audit.read"],"x-pn-roles":["director","platform_operator","regional_admin"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"action","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/audit/verify":{"get":{"operationId":"get_admin_audit_verify","tags":["Admin"],"summary":"{ok: true, rows: N} or {ok:false, broken_at: seq} (hash chain)","x-pn-source":"platform/pn/routes.py audit_verify()","description":"GET /api/admin/audit/verify {ok: true, rows: N} or {ok:false, broken_at: seq} (hash chain)","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"x-pn-permissions":["audit.read"],"x-pn-roles":["director","platform_operator","regional_admin"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/ml/jobs":{"post":{"operationId":"post_admin_ml_jobs","tags":["Support plans and pupil-level ML"],"summary":"GET /api/aggregates/support-adaptations?scope= · POST /api/admin/ml/jobs · GET /api/admin/ml/models .","x-pn-source":"platform/pn/support.py ml_jobs()","description":"POST …/analysis/review-requests · GET /api/aggregates/support-adaptations?scope= · POST /api/admin/ml/jobs · GET /api/admin/ml/models .","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["ml.admin"],"x-pn-roles":["platform_operator"],"x-pn-gate":["feature_ml_pooled"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"instruction_ref":{},"kind":{},"scope":{}}}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, ml.instruction_required, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/ml/models":{"get":{"operationId":"get_admin_ml_models","tags":["Support plans and pupil-level ML"],"summary":"GET /api/aggregates/support-adaptations?scope= · POST /api/admin/ml/jobs · GET /api/admin/ml/models .","x-pn-source":"platform/pn/support.py ml_models()","description":"POST …/analysis/review-requests · GET /api/aggregates/support-adaptations?scope= · POST /api/admin/ml/jobs · GET /api/admin/ml/models .","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["ml.admin"],"x-pn-roles":["platform_operator"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/regions":{"get":{"operationId":"get_admin_regions","tags":["Admin"],"summary":"{items:[{id, name_ar, name_fr}]} within caller scope","x-pn-source":"platform/pn/routes.py regions_list()","description":"GET /api/admin/regions {items:[{id, name_ar, name_fr}]} within caller scope","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"x-pn-permissions":["school.read","user.read"],"x-pn-roles":["director","inspector","platform_operator","regional_admin"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/schools":{"get":{"operationId":"get_admin_schools","tags":["Admin"],"summary":"{items:[{id, region_id, name_ar, name_fr, status, users}]}","x-pn-source":"platform/pn/routes.py schools_list()","description":"GET /api/admin/schools?region_id= {items:[{id, region_id, name_ar, name_fr, status, users}]}","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"x-pn-permissions":["school.read"],"x-pn-roles":["director","inspector","platform_operator","regional_admin"],"parameters":[{"name":"region_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_admin_schools","tags":["Admin"],"summary":"{name_ar, name_fr, region_id, director:{username, display_name}} 201 {school, director:{id}, invite:{token, url, expi…","x-pn-source":"platform/pn/routes.py schools_create()","description":"POST /api/admin/schools {name_ar, name_fr, region_id, director:{username, display_name}} 201 {school, director:{id}, invite:{token, url, expires_at}} . Token shown once","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"x-pn-permissions":["school.provision"],"x-pn-roles":["platform_operator","regional_admin"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"director":{},"name_ar":{"type":"string","minLength":3,"maxLength":120},"name_fr":{"type":"string","minLength":3,"maxLength":120},"region_id":{"type":"string","minLength":1,"maxLength":40}},"required":["name_ar","name_fr","region_id"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"conflict.username_taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/users":{"get":{"operationId":"get_admin_users","tags":["Admin"],"summary":"users visible in caller scope","x-pn-source":"platform/pn/routes.py users_list()","description":"GET /api/admin/users?school_id=&region_id=&role=&status=&q=&limit=&cursor= users visible in caller scope","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"x-pn-permissions":["user.read"],"x-pn-roles":["director","platform_operator","regional_admin"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"role","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"school_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"region_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_admin_users","tags":["Admin"],"summary":"{username, display_name, role, scope_type, scope_id} 201 {user, invite:{token, url, expires_at}}","x-pn-source":"platform/pn/routes.py users_create()","description":"POST /api/admin/users {username, display_name, role, scope_type, scope_id} 201 {user, invite:{token, url, expires_at}}","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"x-pn-permissions":["user.manage"],"x-pn-roles":["director","platform_operator","regional_admin"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"display_name":{"type":"string","minLength":1,"maxLength":80},"username":{"type":"string","minLength":3,"maxLength":40}},"required":["display_name","username"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.grant_forbidden, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"conflict.username_taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/users/{uid}":{"get":{"operationId":"get_admin_users_by_uid","tags":["Admin"],"summary":"user + roles","x-pn-source":"platform/pn/routes.py users_get()","description":"GET /api/admin/users/{id} user + roles","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/users/{uid}/disable":{"post":{"operationId":"post_admin_users_by_uid_disable","tags":["Admin"],"summary":"/ enable 204 . Disable revokes all sessions now","x-pn-source":"platform/pn/routes.py users_disable()","description":"POST /api/admin/users/{id}/disable / enable 204 . Disable revokes all sessions now","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/users/{uid}/enable":{"post":{"operationId":"post_admin_users_by_uid_enable","tags":["Admin"],"summary":"/ enable 204 . Disable revokes all sessions now","x-pn-source":"platform/pn/routes.py users_enable()","description":"POST /api/admin/users/{id}/disable / enable 204 . Disable revokes all sessions now","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/users/{uid}/reset-password":{"post":{"operationId":"post_admin_users_by_uid_reset_password","tags":["Admin"],"summary":"200 {invite:{token, url, expires_at}} (single-use set-password link, old password stops working, sessions revoked)","x-pn-source":"platform/pn/routes.py users_reset()","description":"POST /api/admin/users/{id}/reset-password 200 {invite:{token, url, expires_at}} (single-use set-password link, old password stops working, sessions revoked)","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/users/{uid}/roles":{"post":{"operationId":"post_admin_users_by_uid_roles","tags":["Admin"],"summary":"{role, scope_type, scope_id} 201 assignment","x-pn-source":"platform/pn/routes.py roles_add()","description":"POST /api/admin/users/{id}/roles {role, scope_type, scope_id} 201 assignment","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.grant_forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"conflict.role_exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/admin/users/{uid}/roles/{aid}":{"delete":{"operationId":"delete_admin_users_by_uid_roles_by_aid","tags":["Admin"],"summary":"204","x-pn-source":"platform/pn/routes.py roles_remove()","description":"DELETE /api/admin/users/{id}/roles/{assignment_id} 204","x-pn-doc":{"file":"platform/docs/API.md","section":"7. Admin (user management)"},"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"aid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"conflict.last_role","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/aggregates":{"get":{"operationId":"get_aggregates","tags":["Aggregates, exports, jobs"],"summary":"region:R-TUN1 national → latest computed result","x-pn-source":"platform/pn/routes.py aggregates_get()","description":"- GET /api/aggregates?scope=school:S-TUN-001 region:R-TUN1 national → latest computed result:","x-pn-doc":{"file":"platform/docs/API.md","section":"6. Aggregates, exports, jobs"},"parameters":[{"name":"scope","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"aggregate.not_computed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/aggregates/jobs":{"post":{"operationId":"post_aggregates_jobs","tags":["Aggregates, exports, jobs"],"summary":"{ \"scope\": \"region:R-TUN1\" } → 202 { \"job\": {id, kind, status} } .","x-pn-source":"platform/pn/routes.py aggregates_job()","description":"- POST /api/aggregates/jobs { \"scope\": \"region:R-TUN1\" } → 202 { \"job\": {id, kind, status} } .","x-pn-doc":{"file":"platform/docs/API.md","section":"6. Aggregates, exports, jobs"},"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/aggregates/support-adaptations":{"get":{"operationId":"get_aggregates_support_adaptations","tags":["Support plans and pupil-level ML"],"summary":"GET /api/aggregates/support-adaptations?scope= · POST /api/admin/ml/jobs · GET /api/admin/ml/models .","x-pn-source":"platform/pn/support.py ml_agg()","description":"POST …/analysis/review-requests · GET /api/aggregates/support-adaptations?scope= · POST /api/admin/ml/jobs · GET /api/admin/ml/models .","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.aggregate.read"],"x-pn-roles":["director","inspector","regional_admin"],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/assist":{"post":{"operationId":"post_assist","tags":["Voice assistant inside the page scope"],"summary":"(teacher, parent, director, inspector: the role sent must be one of the session's roles)","x-pn-source":"platform/pn/assist.py assist()","description":"POST /api/assist (teacher, parent, director, inspector: the role sent must be one of the session's roles)","x-pn-doc":{"file":"platform/docs/API.md","section":"Voice assistant inside the page scope (pn/assist.py, 28 Nov 2026)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"context":{},"locale":{},"page":{},"role":{},"utterance":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied, assist.page_out_of_scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"validation.too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"assist.rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"assist.unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/attendance/counts":{"post":{"operationId":"post_attendance_counts","tags":["Teacher workspace and sync"],"summary":"(teacher, director; flag attendance_counts , off by default)","x-pn-source":"platform/pn/routes.py attendance_counts()","description":"POST /api/attendance/counts (teacher, director; flag attendance_counts , off by default)","x-pn-doc":{"file":"platform/docs/API.md","section":"11. Teacher workspace and sync (22 Nov 2026, phase 1)"},"x-pn-permissions":["attendance.report"],"x-pn-roles":["director","teacher"],"x-pn-gate":["feature_attendance_counts"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"absent":{"type":"integer","minimum":0,"maximum":80},"class_code":{"type":"string","minLength":1,"maxLength":16},"date":{"type":"string","format":"date"},"items":{},"school_id":{},"session":{"type":"string","minLength":2,"maxLength":2,"enum":["AM","PM"]}},"required":["absent","class_code","date","session"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/auth/2fa/disable":{"post":{"operationId":"post_auth_2fa_disable","tags":["Auth"],"summary":"{ \"password\": \"…\", \"code\": \"123456\" } → 204","x-pn-source":"platform/pn/routes.py mfa_disable()","description":"- POST /api/auth/2fa/disable { \"password\": \"…\", \"code\": \"123456\" } → 204","x-pn-doc":{"file":"platform/docs/API.md","section":"3. Auth"},"parameters":[{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{},"password":{}}}}}},"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/auth/2fa/enable":{"post":{"operationId":"post_auth_2fa_enable","tags":["Auth"],"summary":"{ \"code\": \"123456\" } → 204","x-pn-source":"platform/pn/routes.py mfa_enable()","description":"- POST /api/auth/2fa/enable { \"code\": \"123456\" } → 204","x-pn-doc":{"file":"platform/docs/API.md","section":"3. Auth"},"parameters":[{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":6,"maxLength":6}},"required":["code"]}}}},"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/auth/2fa/setup":{"post":{"operationId":"post_auth_2fa_setup","tags":["Auth"],"summary":"→ 200 { \"secret_base32\": \"…\", \"otpauth_uri\": \"otpauth://totp/…\" } (not active yet)","x-pn-source":"platform/pn/routes.py mfa_setup()","description":"- POST /api/auth/2fa/setup → 200 { \"secret_base32\": \"…\", \"otpauth_uri\": \"otpauth://totp/…\" } (not active yet)","x-pn-doc":{"file":"platform/docs/API.md","section":"3. Auth"},"parameters":[{"$ref":"#/components/parameters/CSRF"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/auth/2fa/verify":{"post":{"operationId":"post_auth_2fa_verify","tags":["Auth"],"summary":"POST /api/auth/2fa/verify","x-pn-source":"platform/pn/routes.py mfa_verify()","description":"POST /api/auth/2fa/verify","x-pn-doc":{"file":"platform/docs/API.md","section":"3. Auth"},"x-pn-mfa-ok":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":6,"maxLength":6}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/auth/invite/accept":{"post":{"operationId":"post_auth_invite_accept","tags":["Auth"],"summary":"POST /api/auth/invite/accept","x-pn-source":"platform/pn/routes.py invite_accept()","description":"POST /api/auth/invite/accept","x-pn-doc":{"file":"platform/docs/API.md","section":"3. Auth"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{},"token":{}},"required":["password"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/auth/login":{"post":{"operationId":"post_auth_login","tags":["Auth"],"summary":"POST /api/auth/login","x-pn-source":"platform/pn/routes.py login()","description":"POST /api/auth/login","x-pn-doc":{"file":"platform/docs/API.md","section":"3. Auth"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","minLength":1,"maxLength":256},"username":{"type":"string","minLength":1,"maxLength":80}},"required":["password","username"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"429":{"description":"auth.throttled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/auth/logout":{"post":{"operationId":"post_auth_logout","tags":["Auth"],"summary":"→ 204 , clears the cookie.","x-pn-source":"platform/pn/routes.py logout()","description":"POST /api/auth/logout → 204 , clears the cookie.","x-pn-doc":{"file":"platform/docs/API.md","section":"3. Auth"},"x-pn-mfa-ok":true,"responses":{"204":{"description":"No content"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/auth/oidc/callback":{"get":{"operationId":"get_auth_oidc_callback","tags":["Auth"],"summary":"→ 302 to return_to with login=ok , or login_error=<code>","x-pn-source":"platform/pn/routes.py oidc_callback()","description":"- GET /api/auth/oidc/callback?code&state → 302 to return_to with login=ok , or login_error=<code> :","x-pn-doc":{"file":"platform/docs/API.md","section":"3. Auth"},"x-pn-gate":["feature_students","parent_enabled"],"x-pn-mfa-ok":true,"parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"error","in":"query","required":false,"schema":{"type":"string"}},{"name":"code","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/auth/oidc/start":{"get":{"operationId":"get_auth_oidc_start","tags":["Auth"],"summary":"→ 302 to the provider. return_to must start with an allowed origin, else the default ( PN_FRONTEND_URL ).","x-pn-source":"platform/pn/routes.py oidc_start()","description":"- GET /api/auth/oidc/start?provider=mock-idp&return_to=<url> → 302 to the provider. return_to must start with an allowed origin, else the default ( PN_FRONTEND_URL ).","x-pn-doc":{"file":"platform/docs/API.md","section":"3. Auth"},"x-pn-gate":["feature_students"],"x-pn-mfa-ok":true,"parameters":[{"name":"student","in":"query","required":false,"schema":{"type":"string"}},{"name":"return_to","in":"query","required":false,"schema":{"type":"string"}},{"name":"provider","in":"query","required":false,"schema":{"type":"string"}},{"name":"role","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect","headers":{"Location":{"schema":{"type":"string"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/auth/password":{"post":{"operationId":"post_auth_password","tags":["Auth"],"summary":"POST /api/auth/password","x-pn-source":"platform/pn/routes.py change_password()","description":"POST /api/auth/password","x-pn-doc":{"file":"platform/docs/API.md","section":"3. Auth"},"x-pn-pw-ok":true,"parameters":[{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"current_password":{},"new_password":{}},"required":["current_password","new_password"]}}}},"responses":{"204":{"description":"No content"},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/auth/session":{"get":{"operationId":"get_auth_session","tags":["Cookies and CSRF"],"summary":"(before login) and from the login / session response (after login: the token changes at login).","x-pn-source":"platform/pn/routes.py session()","description":"GET /api/auth/session (before login) and from the login / session response (after login: the token changes at login).","x-pn-doc":{"file":"platform/docs/API.md","section":"2. Cookies and CSRF"},"x-pn-gate":["feature_students"],"x-pn-mfa-ok":true,"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/auth/student/activate":{"post":{"operationId":"post_auth_student_activate","tags":["Stage 2 · Student accounts"],"summary":"Body {token,password} . Consumes a school-issued, expiring, one-use code and opens a session. Staff password policy a…","x-pn-source":"platform/pn/students.py activate()","description":"POST /api/auth/student/activate Body {token,password} . Consumes a school-issued, expiring, one-use code and opens a session. Staff password policy applies and no TOTP enrollment is available.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","minLength":1,"maxLength":256},"token":{"type":"string","minLength":20,"maxLength":128}},"required":["password","token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/auth/student/login":{"post":{"operationId":"post_auth_student_login","tags":["Stage 2 · Student accounts"],"summary":"Existing CSRF, credentials, rate limits and lockout. Body {username,password} .","x-pn-source":"platform/pn/students.py login()","description":"POST /api/auth/student/login Existing CSRF, credentials, rate limits and lockout. Body {username,password} .","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","minLength":1,"maxLength":256},"username":{"type":"string","minLength":3,"maxLength":80}},"required":["password","username"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/bullying/aggregate":{"get":{"operationId":"get_bullying_aggregate","tags":["Parent guidance, confidential bullying reports and ministry indicators"],"summary":"(national viewer or scoped regional report role) returns the completed-month cohort with a two-week outcome window. C…","x-pn-source":"platform/pn/bullying.py ministry()","description":"- GET /api/bullying/aggregate (national viewer or scoped regional report role) returns the completed-month cohort with a two-week outcome window. Counts are based on submissions and suppression on distinct pupils, with PN_MIN_CELL and PN_MIN_SCHOOLS . The endpoint returns regional rows with eligible","x-pn-doc":{"file":"platform/docs/API.md","section":"Parent guidance, confidential bullying reports and ministry indicators"},"x-pn-permissions":["report.national"],"x-pn-roles":["national_viewer"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/bullying/children":{"get":{"operationId":"get_bullying_children","tags":["Parent guidance, confidential bullying reports and ministry indicators"],"summary":"(parent) returns the linked children and their bounded reading and explicit attendance records, shared trial verdicts…","x-pn-source":"platform/pn/bullying.py children()","description":"- GET /api/bullying/children (parent) returns the linked children and their bounded reading and explicit attendance records, shared trial verdicts and agreed support adaptations. It excludes internal notes and trial ratings. The magazine selects at most three cards from those inputs.","x-pn-doc":{"file":"platform/docs/API.md","section":"Parent guidance, confidential bullying reports and ministry indicators"},"x-pn-permissions":["child.plan.read"],"x-pn-roles":["parent"],"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/bullying/links":{"get":{"operationId":"get_bullying_links","tags":["Parent guidance, confidential bullying reports and ministry indicators"],"summary":"lists only verified children and their linked guardians for the assigned teacher or school director to register an SM…","x-pn-source":"platform/pn/bullying.py staff_links()","description":"- GET /api/bullying/links lists only verified children and their linked guardians for the assigned teacher or school director to register an SMS intake.","x-pn-doc":{"file":"platform/docs/API.md","section":"Parent guidance, confidential bullying reports and ministry indicators"},"x-pn-permissions":["classes.read","school.roster"],"x-pn-roles":["director","teacher"],"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"put":{"operationId":"put_bullying_links","tags":["Parent guidance, confidential bullying reports and ministry indicators"],"summary":"(school director) links or revokes a parent account after the school verifies guardianship. Send school_id , parent_i…","x-pn-source":"platform/pn/bullying.py link_child()","description":"- PUT /api/bullying/links (school director) links or revokes a parent account after the school verifies guardianship. Send school_id , parent_id , pupil_id and active . Enabling a link requires verification_ref for the school record that verifies this guardian–pupil relationship. To include support ","x-pn-doc":{"file":"platform/docs/API.md","section":"Parent guidance, confidential bullying reports and ministry indicators"},"x-pn-permissions":["school.roster"],"x-pn-roles":["director"],"x-pn-gate":["feature_students","feature_support_plans"],"x-pn-cache":"no-store","parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"},"adaptations_share_ref":{"type":"string","minLength":3,"maxLength":120},"parent_id":{"type":"string","minLength":1,"maxLength":80},"plan_id":{"type":"string","minLength":1,"maxLength":80},"pupil_id":{"type":"string","minLength":1,"maxLength":80},"school_id":{"type":"string","minLength":1,"maxLength":80},"verification_ref":{"type":"string","minLength":3,"maxLength":120}},"required":["active","parent_id","pupil_id","school_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/bullying/magazine":{"get":{"operationId":"get_bullying_magazine","tags":["Parent guidance, confidential bullying reports and ministry indicators"],"summary":"lists pending and available edition metadata for the assigned teacher or intended guardian. Content is retrieved sepa…","x-pn-source":"platform/pn/bullying.py magazine_list()","description":"- GET /api/bullying/magazine lists pending and available edition metadata for the assigned teacher or intended guardian. Content is retrieved separately.","x-pn-doc":{"file":"platform/docs/API.md","section":"Parent guidance, confidential bullying reports and ministry indicators"},"x-pn-permissions":["classes.read","child.plan.read"],"x-pn-roles":["parent","teacher"],"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_bullying_magazine","tags":["Parent guidance, confidential bullying reports and ministry indicators"],"summary":"(assigned teacher) submits the reviewed parent edition as {link, issue} . The verified link identifies the guardian a…","x-pn-source":"platform/pn/bullying.py magazine_publish()","description":"- POST /api/bullying/magazine (assigned teacher) submits the reviewed parent edition as {link, issue} . The verified link identifies the guardian and pupil. The exact edition is held for guardian permission and expires after seven days.","x-pn-doc":{"file":"platform/docs/API.md","section":"Parent guidance, confidential bullying reports and ministry indicators"},"x-pn-cache":"no-store","parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"issue":{},"link":{"type":"string","minLength":1,"maxLength":80}},"required":["link"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/bullying/magazine/{id}":{"post":{"operationId":"post_bullying_magazine_by_id","tags":["Parent guidance, confidential bullying reports and ministry indicators"],"summary":"accepts an action of consent , open or revoke . The intended guardian consents and opens. The guardian or assigned sc…","x-pn-source":"platform/pn/bullying.py magazine_action()","description":"- POST /api/bullying/magazine/{id} accepts an action of consent , open or revoke . The intended guardian consents and opens. The guardian or assigned school staff may revoke. An open records access and requires current linkage, edition consent and server-side expiry checks.","x-pn-doc":{"file":"platform/docs/API.md","section":"Parent guidance, confidential bullying reports and ministry indicators"},"x-pn-cache":"no-store","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["consent","open","revoke"]}},"required":["action"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/bullying/reports":{"get":{"operationId":"get_bullying_reports","tags":["Parent guidance, confidential bullying reports and ministry indicators"],"summary":"lists status and dates for the submitting parent, and shows incident details and checklist only to the assigned teach…","x-pn-source":"platform/pn/bullying.py list_reports()","description":"- GET /api/bullying/reports lists status and dates for the submitting parent, and shows incident details and checklist only to the assigned teacher and the director of that school. Case details are omitted from the audit log. An SMS fallback opens a minimal request for a private callback using a num","x-pn-doc":{"file":"platform/docs/API.md","section":"Parent guidance, confidential bullying reports and ministry indicators"},"x-pn-permissions":["child.plan.read","classes.read","school.roster"],"x-pn-roles":["director","parent","teacher"],"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_bullying_reports","tags":["Parent guidance, confidential bullying reports and ministry indicators"],"summary":"accepts a linked child ID and an opaque submission token. Optional incident fields are what , ISO date when , where a…","x-pn-source":"platform/pn/bullying.py create_report()","description":"- POST /api/bullying/reports accepts a linked child ID and an opaque submission token. Optional incident fields are what , ISO date when , where and frequency ( once , repeated , unknown ). The authenticated parent uses the default channel=web . The assigned teacher or director can use channel=sms a","x-pn-doc":{"file":"platform/docs/API.md","section":"Parent guidance, confidential bullying reports and ministry indicators"},"x-pn-permissions":["child.plan.read","classes.read","school.roster"],"x-pn-roles":["director","parent","teacher"],"x-pn-cache":"no-store","parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["web","sms"]},"child":{"type":"string","minLength":1,"maxLength":80},"frequency":{"type":"string","minLength":1,"maxLength":20,"enum":["once","repeated","unknown"]},"submission":{"type":"string","minLength":16,"maxLength":80},"what":{"type":"string","minLength":0,"maxLength":800},"when":{"type":"string","format":"date"},"where":{"type":"string","minLength":0,"maxLength":160}},"required":["child","submission"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"idempotency.key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/bullying/reports/{id}":{"patch":{"operationId":"patch_bullying_reports_by_id","tags":["Parent guidance, confidential bullying reports and ministry indicators"],"summary":"(assigned teacher or school director) accepts current status from , target status , and completed checklist IDs from …","x-pn-source":"platform/pn/bullying.py update_report()","description":"- PATCH /api/bullying/reports/{id} (assigned teacher or school director) accepts current status from , target status , and completed checklist IDs from the published guide. Use coordinate when recording follow-up. The response timestamp comes from the first committed private reply. Closure requires ","x-pn-doc":{"file":"platform/docs/API.md","section":"Parent guidance, confidential bullying reports and ministry indicators"},"x-pn-permissions":["classes.read","school.roster"],"x-pn-roles":["director","teacher"],"x-pn-cache":"no-store","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"checklist":{},"follow_up":{"type":"string","minLength":10,"maxLength":400},"follow_up_agreed":{"type":"boolean"},"from":{"type":"string","enum":["received","following"]},"resolved":{"type":"boolean"},"safety_review":{"type":"string","minLength":10,"maxLength":800},"status":{"type":"string","enum":["following","closed"]}},"required":["from","status"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/bullying/reports/{id}/reply":{"post":{"operationId":"post_bullying_reports_by_id_reply","tags":["Director decisions"],"summary":"replies to a sender in the school. POST /api/bullying/reports/{id}/reply replies to the report's linked parent and se…","x-pn-source":"platform/pn/bullying.py reply_report()","description":"- POST /api/schools/{sid}/director/messages/{key}/reply replies to a sender in the school. POST /api/bullying/reports/{id}/reply replies to the report's linked parent and sends an in-platform notification.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"x-pn-cache":"no-store","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":400}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"bullying.link_inactive","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/children/{cid}/messages":{"get":{"operationId":"get_children_by_cid_messages","tags":["Teacher–parent messages"],"summary":"200 {child:{id, name, class_id, class_label}, side, items:[row], next_cursor} , newest first (arrival order), 50 by d…","x-pn-source":"platform/pn/messages.py thread()","description":"GET /api/children/{cid}/messages?limit=1..200&cursor= — 200 {child:{id, name, class_id, class_label}, side, items:[row], next_cursor} , newest first (arrival order), 50 by default","x-pn-doc":{"file":"platform/docs/API.md","section":"Teacher–parent messages («مراسلة الوليّ», pn/messages.py, 28 Nov 2026; phase 2: closed)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_children_by_cid_messages","tags":["Teacher–parent messages"],"summary":"{text 1..1000, reply_to?, lesson_ref?, lesson_title?, step_ref?, step_title?} 201 row . reply_to must be a message of…","x-pn-source":"platform/pn/messages.py send()","description":"POST /api/children/{cid}/messages {text 1..1000, reply_to?, lesson_ref?, lesson_title?, step_ref?, step_title?} 201 row . reply_to must be a message of the same thread ( 400 fields.reply_to=not_in_thread ); a title needs its ref ( lesson_ref / step_ref = official ids such as g4.math.B4.L20 ). Notifi","x-pn-doc":{"file":"platform/docs/API.md","section":"Teacher–parent messages («مراسلة الوليّ», pn/messages.py, 28 Nov 2026; phase 2: closed)"},"x-pn-cache":"no-store","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lesson_ref":{"type":"string","minLength":1,"maxLength":80},"lesson_title":{"type":"string","minLength":1,"maxLength":160},"reply_to":{"type":"string","minLength":1,"maxLength":80},"step_ref":{"type":"string","minLength":1,"maxLength":80},"step_title":{"type":"string","minLength":1,"maxLength":160},"text":{"type":"string","minLength":1}},"required":["text"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/children/{cid}/messages/read":{"post":{"operationId":"post_children_by_cid_messages_read","tags":["Teacher–parent messages"],"summary":"{} 200 {marked, ids} : stamps every unread message of the other side (opening the thread)","x-pn-source":"platform/pn/messages.py mark_thread()","description":"POST /api/children/{cid}/messages/read {} 200 {marked, ids} : stamps every unread message of the other side (opening the thread)","x-pn-doc":{"file":"platform/docs/API.md","section":"Teacher–parent messages («مراسلة الوليّ», pn/messages.py, 28 Nov 2026; phase 2: closed)"},"x-pn-cache":"no-store","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/circles":{"get":{"operationId":"get_circles","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"teacher Her circles (member): {items:[{id, title, practice, practice_ar, objective:{id, ar, grade, subject}, school, …","x-pn-source":"platform/pn/circles.py circles_mine()","description":"GET /api/circles teacher Her circles (member): {items:[{id, title, practice, practice_ar, objective:{id, ar, grade, subject}, school, created_at, state, join_code, members_n, min_members:3, max_members:8, founder}]}","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_circles","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"teacher {practice: spaced interleaved retrieval concrete level worked feedback talk other, practice_ar, objective:{id…","x-pn-source":"platform/pn/circles.py circle_create()","description":"POST /api/circles teacher {practice: spaced interleaved retrieval concrete level worked feedback talk other, practice_ar, objective:{id, ar, grade 1..6, subject}, title?} → 201 (her school's region; she is the first member; join_code XXXX-XXXX given in person)","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"objective":{},"practice":{},"practice_ar":{},"title":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/circles/join":{"post":{"operationId":"post_circles_join","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"teacher {code} → 200 view with members . Wrong code and another region's circle: the same 404 ; 8 members → 409 circl…","x-pn-source":"platform/pn/circles.py circle_join()","description":"POST /api/circles/join teacher {code} → 200 view with members . Wrong code and another region's circle: the same 404 ; 8 members → 409 circle.full ; idempotent","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"circle.full","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/circles/{cid}":{"get":{"operationId":"get_circles_by_cid","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"member view + members:[{display_name, school, me}] + items:[{id, kind, title, body, lesson_id, created_at, mine, auth…","x-pn-source":"platform/pn/circles.py circle_get()","description":"GET /api/circles/{id} member view + members:[{display_name, school, me}] + items:[{id, kind, title, body, lesson_id, created_at, mine, author:{display_name}, uses, named, marked_by_me}] by date shared, newest first . uses = distinct teachers who marked «جرّبتها في قسمي», null below 5 ; named = names","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/circles/{cid}/items":{"post":{"operationId":"post_circles_by_cid_items","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"member {kind: fiche tried lesson obs debrief, publish: true (required), title?, body:{text?, fiche?:{fields[≤12], sta…","x-pn-source":"platform/pn/circles.py item_create()","description":"POST /api/circles/{id}/items member {kind: fiche tried lesson obs debrief, publish: true (required), title?, body:{text?, fiche?:{fields[≤12], stages[≤8]}, objective?, thinking?, worked?, puzzled?, change?, teacher?, observers?, day?}, lesson_id?} → 201. obs / debrief need lesson_id of a lesson ; a ","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{},"kind":{},"lesson_id":{},"publish":{},"title":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/circles/{cid}/items/{iid}":{"delete":{"operationId":"delete_circles_by_cid_items_by_iid","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"its author Withdraws: the row is deleted (marks and, for a lesson, its observations go with it); anyone else → 404","x-pn-source":"platform/pn/circles.py item_withdraw()","description":"DELETE /api/circles/{id}/items/{item} its author Withdraws: the row is deleted (marks and, for a lesson, its observations go with it); anyone else → 404","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"iid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/circles/{cid}/items/{iid}/mark":{"put":{"operationId":"put_circles_by_cid_items_by_iid_mark","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"member «جرّبتها في قسمي» {named?: bool} ; one per teacher; own item → 409 circle.own_item","x-pn-source":"platform/pn/circles.py item_mark()","description":"PUT DELETE /api/circles/{id}/items/{item}/mark member «جرّبتها في قسمي» {named?: bool} ; one per teacher; own item → 409 circle.own_item","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"iid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"named":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"circle.own_item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_circles_by_cid_items_by_iid_mark","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"member «جرّبتها في قسمي» {named?: bool} ; one per teacher; own item → 409 circle.own_item","x-pn-source":"platform/pn/circles.py item_unmark()","description":"PUT DELETE /api/circles/{id}/items/{item}/mark member «جرّبتها في قسمي» {named?: bool} ; one per teacher; own item → 409 circle.own_item","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"iid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/circles/{cid}/membership":{"delete":{"operationId":"delete_circles_by_cid_membership","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"member Leaves: every item and mark of hers is deleted. Last member → the circle closes (its code stops working)","x-pn-source":"platform/pn/circles.py circle_leave()","description":"DELETE /api/circles/{id}/membership member Leaves: every item and mark of hers is deleted. Last member → the circle closes (its code stops working)","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/cycles":{"get":{"operationId":"get_cycles","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"GET /api/cycles/{id} teacher, inspector Cycles where she is the teacher or he is the coach only: {id, state: proposed…","x-pn-source":"platform/pn/circles.py cycles_mine()","description":"GET /api/cycles · GET /api/cycles/{id} teacher, inspector Cycles where she is the teacher or he is the coach only: {id, state: proposed open closed declined, step: observe1 focus practice observe2 done closed, me: teacher coach, proposed_by, teacher, coach:{display_name, role: inspector peer}, focus","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share","visit.plan"],"x-pn-roles":["inspector","teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_cycles","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"teacher {coach_id, circle_id?, focus?} · inspector {teacher_id, training_id?, focus?} → 201 proposed ; the coach is a…","x-pn-source":"platform/pn/circles.py cycle_create()","description":"POST /api/cycles teacher {coach_id, circle_id?, focus?} · inspector {teacher_id, training_id?, focus?} → 201 proposed ; the coach is an inspector of her region or a teacher of her region ( peer ); outside → 404. Notifies the other party ( cycle_proposed , link circle.html /cycles )","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share","visit.plan"],"x-pn-roles":["inspector","teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"circle_id":{},"coach_id":{},"focus":{},"teacher_id":{},"training_id":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/cycles/{yid}":{"get":{"operationId":"get_cycles_by_yid","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"GET /api/cycles/{id} teacher, inspector Cycles where she is the teacher or he is the coach only: {id, state: proposed…","x-pn-source":"platform/pn/circles.py cycle_get()","description":"GET /api/cycles · GET /api/cycles/{id} teacher, inspector Cycles where she is the teacher or he is the coach only: {id, state: proposed open closed declined, step: observe1 focus practice observe2 done closed, me: teacher coach, proposed_by, teacher, coach:{display_name, role: inspector peer}, focus","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["journal.share","visit.plan"],"x-pn-roles":["inspector","teacher"],"parameters":[{"name":"yid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/cycles/{yid}/agree":{"post":{"operationId":"post_cycles_by_yid_agree","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"…/agree both ONE focus (≤ 120); setting it resets the other side's agreement; agreed when both agreed","x-pn-source":"platform/pn/circles.py cycle_agree()","description":"POST /api/cycles/{id}/focus · …/agree both ONE focus (≤ 120); setting it resets the other side's agreement; agreed when both agreed","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"parameters":[{"name":"yid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"cycle.no_focus","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/cycles/{yid}/answer":{"post":{"operationId":"post_cycles_by_yid_answer","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"the other party {answer: accept decline} ; the proposer → 409 cycle.own_proposal . Accept → open , start_day = today,…","x-pn-source":"platform/pn/circles.py cycle_answer()","description":"POST /api/cycles/{id}/answer the other party {answer: accept decline} ; the proposer → 409 cycle.own_proposal . Accept → open , start_day = today, due_day = +28 days","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"parameters":[{"name":"yid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"cycle.not_proposed, cycle.own_proposal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/cycles/{yid}/close":{"post":{"operationId":"post_cycles_by_yid_close","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"the teacher only coach → 403 cycle.teacher_closes . completed = closed with an observe2 note","x-pn-source":"platform/pn/circles.py cycle_close()","description":"POST /api/cycles/{id}/close the teacher only coach → 403 cycle.teacher_closes . completed = closed with an observe2 note","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"parameters":[{"name":"yid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"cycle.teacher_closes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"cycle.not_open","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/cycles/{yid}/focus":{"post":{"operationId":"post_cycles_by_yid_focus","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"…/agree both ONE focus (≤ 120); setting it resets the other side's agreement; agreed when both agreed","x-pn-source":"platform/pn/circles.py cycle_focus()","description":"POST /api/cycles/{id}/focus · …/agree both ONE focus (≤ 120); setting it resets the other side's agreement; agreed when both agreed","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"parameters":[{"name":"yid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"focus":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"cycle.not_open","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/cycles/{yid}/notes":{"post":{"operationId":"post_cycles_by_yid_notes","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"coach for observe1 / observe2 , teacher for practice {step, text ≤ 2000} , descriptive only; the other side → 403 cyc…","x-pn-source":"platform/pn/circles.py cycle_note()","description":"POST /api/cycles/{id}/notes coach for observe1 / observe2 , teacher for practice {step, text ≤ 2000} , descriptive only; the other side → 403 cycle.step_of_other ; not open → 409 cycle.not_open","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"parameters":[{"name":"yid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"step":{},"text":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"cycle.step_of_other","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"cycle.not_open","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/exports":{"post":{"operationId":"post_exports","tags":["Aggregates, exports, jobs"],"summary":"{ \"kind\": \"plans_status\", \"school_id\": \"S-TUN-001\" } → 202 { \"job\": … } . When done, an export_ready notification lin…","x-pn-source":"platform/pn/routes.py exports_create()","description":"- POST /api/exports { \"kind\": \"plans_status\", \"school_id\": \"S-TUN-001\" } → 202 { \"job\": … } . When done, an export_ready notification links to","x-pn-doc":{"file":"platform/docs/API.md","section":"6. Aggregates, exports, jobs"},"x-pn-permissions":["export.create"],"x-pn-roles":["director"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":40,"enum":["plans_status"]},"school_id":{"type":"string","minLength":1,"maxLength":80}},"required":["kind","school_id"]}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/exports/{eid}/download":{"get":{"operationId":"get_exports_by_eid_download","tags":["Aggregates, exports, jobs"],"summary":"(CSV, owner only).","x-pn-source":"platform/pn/routes.py exports_download()","description":"GET /api/exports/{id}/download (CSV, owner only).","x-pn-doc":{"file":"platform/docs/API.md","section":"6. Aggregates, exports, jobs"},"x-pn-permissions":["export.create"],"x-pn-roles":["director"],"x-pn-no-etag":true,"parameters":[{"name":"eid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/family/children":{"get":{"operationId":"get_family_children","tags":["Family"],"summary":"200 {children:[{link_id, pupil_id, name, class_label, school, guardians:[{name, relationship, relationship_ar, since,…","x-pn-source":"platform/pn/guardians.py children()","description":"GET /api/family/children — 200 {children:[{link_id, pupil_id, name, class_label, school, guardians:[{name, relationship, relationship_ar, since, via, me}], events:[row] (20, newest first)}]}","x-pn-doc":{"file":"platform/docs/API.md","section":"Family (guardians): both guardians share the child's space (pn/guardians.py, 28 Nov 2026; phase 2: closed)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/family/children/{lid}/events":{"post":{"operationId":"post_family_children_by_lid_events","tags":["Family"],"summary":"{kind:\"home_done\" \"excuse\", ref?, text?} 201 row ; the same home step marked again the same day → 200 the first row. …","x-pn-source":"platform/pn/guardians.py add_event()","description":"POST /api/family/children/{lid}/events {kind:\"home_done\" \"excuse\", ref?, text?} 201 row ; the same home step marked again the same day → 200 the first row. Notifies every OTHER guardian ( kind: family_event ); an excuse also the class teachers ( family_excuse )","x-pn-doc":{"file":"platform/docs/API.md","section":"Family (guardians): both guardians share the child's space (pn/guardians.py, 28 Nov 2026; phase 2: closed)"},"x-pn-cache":"no-store","parameters":[{"name":"lid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["home_done","excuse"]},"ref":{"type":"string","minLength":1,"maxLength":160},"text":{"type":"string","minLength":1}},"required":["kind"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/family/children/{lid}/invites":{"post":{"operationId":"post_family_children_by_lid_invites","tags":["Family"],"summary":"{relationship} 201 {id, token, url, expires_at} : url = <public base>/cnte/parent.html /join?t=<token> (QR), 7 days; …","x-pn-source":"platform/pn/guardians.py invite()","description":"POST /api/family/children/{lid}/invites {relationship} 201 {id, token, url, expires_at} : url = <public base>/cnte/parent.html /join?t=<token> (QR), 7 days; replaces the inviter's pending invite","x-pn-doc":{"file":"platform/docs/API.md","section":"Family (guardians): both guardians share the child's space (pn/guardians.py, 28 Nov 2026; phase 2: closed)"},"x-pn-cache":"no-store","parameters":[{"name":"lid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"relationship":{"type":"string"}},"required":["relationship"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/family/invites/accept":{"post":{"operationId":"post_family_invites_accept","tags":["Family"],"summary":"{token} 200 {status:\"accepted\", child_name_first, school_name} ; 400 invite.invalid (unknown, used, expired); 409 fam…","x-pn-source":"platform/pn/guardians.py accept()","description":"POST /api/family/invites/accept {token} 200 {status:\"accepted\", child_name_first, school_name} ; 400 invite.invalid (unknown, used, expired); 409 family.already_linked . Notifies the director ( family_invite )","x-pn-doc":{"file":"platform/docs/API.md","section":"Family (guardians): both guardians share the child's space (pn/guardians.py, 28 Nov 2026; phase 2: closed)"},"x-pn-cache":"no-store","parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":20,"maxLength":128}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"invite.invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"family.already_linked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/health":{"get":{"operationId":"get_health","tags":["Ops"],"summary":"→ 200 {\"status\":\"ok\"} (no auth, no data).","x-pn-source":"platform/pn/routes.py health()","description":"- GET /api/health → 200 {\"status\":\"ok\"} (no auth, no data).","x-pn-doc":{"file":"platform/docs/API.md","section":"8. Ops"},"x-pn-mfa-ok":true,"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/health/ready":{"get":{"operationId":"get_health_ready","tags":["Ops"],"summary":"→ 200 or 503 {\"status\":\"degraded\",\"checks\":{\"db\":\"ok\",\"worker\":\"stale\"}} .","x-pn-source":"platform/pn/routes.py ready()","description":"- GET /api/health/ready → 200 or 503 {\"status\":\"degraded\",\"checks\":{\"db\":\"ok\",\"worker\":\"stale\"}} .","x-pn-doc":{"file":"platform/docs/API.md","section":"8. Ops"},"x-pn-mfa-ok":true,"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/inclusive/contents":{"get":{"operationId":"get_inclusive_contents","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the teacher's adapted contents and their states.","x-pn-source":"platform/pn/inclusive.py my_contents()","description":"- GET /api/inclusive/contents the teacher's adapted contents and their states.","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.content"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_inclusive_contents","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the teacher submits adapted content (lesson fiche fields + profile + her wording) → pending .","x-pn-source":"platform/pn/inclusive.py submit()","description":"- POST /api/inclusive/contents the teacher submits adapted content (lesson fiche fields + profile + her wording) → pending .","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.content"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/contents/{cid}/history":{"get":{"operationId":"get_inclusive_contents_by_cid_history","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the audit trail of one content (teacher owner or inspector of the region).","x-pn-source":"platform/pn/inclusive.py content_history()","description":"- GET /api/inclusive/contents/{cid}/history the audit trail of one content (teacher owner or inspector of the region).","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/contents/{cid}/review":{"post":{"operationId":"post_inclusive_contents_by_cid_review","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the inspector decides: decision = validate request_changes ( note required). 409 inclusive.state unless pending.","x-pn-source":"platform/pn/inclusive.py review()","description":"- POST /api/inclusive/contents/{cid}/review the inspector decides: decision = validate request_changes ( note required). 409 inclusive.state unless pending.","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.review"],"x-pn-roles":["inspector"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"inclusive.state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/contents/{cid}/withdraw":{"post":{"operationId":"post_inclusive_contents_by_cid_withdraw","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the teacher takes a pending content back to draft .","x-pn-source":"platform/pn/inclusive.py withdraw()","description":"- POST /api/inclusive/contents/{cid}/withdraw the teacher takes a pending content back to draft .","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.content"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"inclusive.state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/home-steps":{"post":{"operationId":"post_inclusive_home_steps","tags":["Inclusive"],"summary":"POST /api/inclusive/home-steps","x-pn-source":"platform/pn/inclusive.py share_home_step()","x-pn-permissions":["inclusive.content"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"class_id":{},"parts":{},"pupil_id":{},"title":{}},"required":["class_id"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/home-steps/{token}":{"get":{"operationId":"get_inclusive_home_steps_by_token","tags":["Inclusive"],"summary":"GET /api/inclusive/home-steps/{token}","x-pn-source":"platform/pn/inclusive.py open_home_step()","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/inclusive/indicator":{"get":{"operationId":"get_inclusive_indicator","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"counts by region × profile, cells < 3 → null (national viewer: all regions; regional admin, inspector: their region).","x-pn-source":"platform/pn/inclusive.py indicator()","description":"- GET /api/inclusive/indicator counts by region × profile, cells < 3 → null (national viewer: all regions; regional admin, inspector: their region).","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["report.national"],"x-pn-roles":["national_viewer"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/indicator/compute":{"post":{"operationId":"post_inclusive_indicator_compute","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"enqueues the job inclusive.aggregate (platform operator, regional admin).","x-pn-source":"platform/pn/inclusive.py compute()","description":"- POST /api/inclusive/indicator/compute enqueues the job inclusive.aggregate (platform operator, regional admin).","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.compute"],"x-pn-roles":["platform_operator","regional_admin"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/lesson-planning/{cls}":{"get":{"operationId":"get_inclusive_lesson_planning_by_cls","tags":["Inclusive"],"summary":"GET /api/inclusive/lesson-planning/{cls}","x-pn-source":"platform/pn/inclusive.py planning_profiles()","x-pn-permissions":["inclusive.select"],"x-pn-roles":["teacher"],"parameters":[{"name":"cls","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/review-queue":{"get":{"operationId":"get_inclusive_review_queue","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the inspector's queue: pending contents of his region (+ the last reviewed).","x-pn-source":"platform/pn/inclusive.py queue()","description":"- GET /api/inclusive/review-queue the inspector's queue: pending contents of his region (+ the last reviewed).","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.review"],"x-pn-roles":["inspector"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/selections":{"get":{"operationId":"get_inclusive_selections","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the teacher's own choices (code, profile, chosen_by teacher parent, chosen_at).","x-pn-source":"platform/pn/inclusive.py my_selections()","description":"- GET /api/inclusive/selections the teacher's own choices (code, profile, chosen_by teacher parent, chosen_at).","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.select"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/selections/{code}":{"put":{"operationId":"put_inclusive_selections_by_code","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the teacher sets a presentation for a pupil code. Body: profile , optional class_ref ; any other field → 400 validati…","x-pn-source":"platform/pn/inclusive.py select()","description":"- PUT /api/inclusive/selections/{code} the teacher sets a presentation for a pupil code. Body: profile , optional class_ref ; any other field → 400 validation.failed ( not_allowed ).","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.select"],"x-pn-roles":["teacher"],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_inclusive_selections_by_code","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the teacher removes her choice.","x-pn-source":"platform/pn/inclusive.py unselect()","description":"- DELETE /api/inclusive/selections/{code} the teacher removes her choice.","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.select"],"x-pn-roles":["teacher"],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/shares":{"post":{"operationId":"post_inclusive_shares","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the teacher creates the parent's link (token, stored hashed, 120 days).","x-pn-source":"platform/pn/inclusive.py share()","description":"- POST /api/inclusive/shares the teacher creates the parent's link (token, stored hashed, 120 days).","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.content"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inclusive/shares/{tok}":{"get":{"operationId":"get_inclusive_shares_by_tok","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"public: the lesson in the chosen presentation, ONLY when that content is validated.","x-pn-source":"platform/pn/inclusive.py open_share()","description":"- GET /api/inclusive/shares/{tok} public: the lesson in the chosen presentation, ONLY when that content is validated.","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"parameters":[{"name":"tok","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/inclusive/shares/{tok}/profile":{"put":{"operationId":"put_inclusive_shares_by_tok_profile","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"public: the parent changes the presentation at home ( profile only); the teacher's list shows chosen_by: parent .","x-pn-source":"platform/pn/inclusive.py home_choose()","description":"- PUT /api/inclusive/shares/{tok}/profile public: the parent changes the presentation at home ( profile only); the teacher's list shows chosen_by: parent .","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"parameters":[{"name":"tok","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/inspector/circles/indicators":{"get":{"operationId":"get_inspector_circles_indicators","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"inspector His region(s). {rows:[{label, teachers, cycles_completed, practices}] (circles of ≥ 5 members), pooled: {la…","x-pn-source":"platform/pn/circles.py ind_inspector()","description":"GET /api/inspector/circles/indicators inspector His region(s). {rows:[{label, teachers, cycles_completed, practices}] (circles of ≥ 5 members), pooled: {label, circles, teachers, cycles_completed, practices} {suppressed:true} null, trainings:{days, followed, share} {suppressed:true, days}, min_cell:","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/edits":{"get":{"operationId":"get_inspector_edits","tags":["Inspector work, server-backed"],"summary":"training visit session&id= that inspector {kind, id, items:[{at, changes}]} newest first (≤ 100). Another inspector g…","x-pn-source":"platform/pn/inspector_work.py edits_list()","description":"GET /api/inspector/edits?kind=suggestion training visit session&id= that inspector {kind, id, items:[{at, changes}]} newest first (≤ 100). Another inspector gets items: []","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string"}},{"name":"id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/reports":{"get":{"operationId":"get_inspector_reports","tags":["Inspector work, server-backed"],"summary":"GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visi…","x-pn-source":"platform/pn/inspector_work.py rep_list()","description":"GET POST /api/inspector/reports · GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visit_id?, class_label?} → 201 draft (same teacher + day → 409 report.exists ). View: {id, state: draft delivered, state_ar, day, day_ar, class_label, fa","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_inspector_reports","tags":["Inspector work, server-backed"],"summary":"GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visi…","x-pn-source":"platform/pn/inspector_work.py rep_create()","description":"GET POST /api/inspector/reports · GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visit_id?, class_label?} → 201 draft (same teacher + day → 409 report.exists ). View: {id, state: draft delivered, state_ar, day, day_ar, class_label, fa","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"class_label":{},"day":{},"teacher_id":{},"visit_id":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"report.exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/reports/{rid}":{"get":{"operationId":"get_inspector_reports_by_rid","tags":["Inspector work, server-backed"],"summary":"GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visi…","x-pn-source":"platform/pn/inspector_work.py rep_get()","description":"GET POST /api/inspector/reports · GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visit_id?, class_label?} → 201 draft (same teacher + day → 409 report.exists ). View: {id, state: draft delivered, state_ar, day, day_ar, class_label, fa","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"put":{"operationId":"put_inspector_reports_by_rid","tags":["Inspector work, server-backed"],"summary":"GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visi…","x-pn-source":"platform/pn/inspector_work.py rep_save()","description":"GET POST /api/inspector/reports · GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visit_id?, class_label?} → 201 draft (same teacher + day → 409 report.exists ). View: {id, state: draft delivered, state_ar, day, day_ar, class_label, fa","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"class_label":{},"day":{},"sections":{}},"required":["class_label","day","sections"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"report.delivered, report.exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_inspector_reports_by_rid","tags":["Inspector work, server-backed"],"summary":"GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visi…","x-pn-source":"platform/pn/inspector_work.py rep_del()","description":"GET POST /api/inspector/reports · GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visit_id?, class_label?} → 201 draft (same teacher + day → 409 report.exists ). View: {id, state: draft delivered, state_ar, day, day_ar, class_label, fa","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"report.delivered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/reports/{rid}/deliver":{"post":{"operationId":"post_inspector_reports_by_rid_deliver","tags":["Inspector work, server-backed"],"summary":"GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visi…","x-pn-source":"platform/pn/inspector_work.py rep_deliver()","description":"GET POST /api/inspector/reports · GET PUT DELETE …/{id} · POST …/{id}/deliver inspector (own, his region) «تقرير التفقّد». POST {teacher_id, day?, visit_id?, class_label?} → 201 draft (same teacher + day → 409 report.exists ). View: {id, state: draft delivered, state_ar, day, day_ar, class_label, fa","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"report.review_changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/revoked-shares":{"get":{"operationId":"get_inspector_revoked_shares","tags":["Inspector work, server-backed"],"summary":"inspector {items:[{teacher:{display_name}, school:{name_ar}, revoked_at}]} : the neutral line «مشاركة أُلغيت · التاري…","x-pn-source":"platform/pn/inspector_work.py revoked()","description":"GET /api/inspector/revoked-shares inspector {items:[{teacher:{display_name}, school:{name_ar}, revoked_at}]} : the neutral line «مشاركة أُلغيت · التاريخ». No title, no content, no reason. Trusted read (revoked rows are invisible to him under RLS), audited","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["journal.review"],"x-pn-roles":["inspector"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/rules":{"get":{"operationId":"get_inspector_rules","tags":["Inspector space, server-backed"],"summary":"inspector (own) His rule card: {req:{manhaji,idmaji,taqyimi,daam: {field: bool}}, goalStart, goalWho: learner pupil a…","x-pn-source":"platform/pn/inspector.py rules_get()","description":"GET PUT DELETE /api/inspector/rules inspector (own) His rule card: {req:{manhaji,idmaji,taqyimi,daam: {field: bool}}, goalStart, goalWho: learner pupil any, objFromProgramme, evalWindow, stages:[1..8 strings ≤ 24], deadline: الجمعة السبت الاثنين صباحاً} . Anything else → 400. DELETE = back to the ba","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"put":{"operationId":"put_inspector_rules","tags":["Inspector space, server-backed"],"summary":"inspector (own) His rule card: {req:{manhaji,idmaji,taqyimi,daam: {field: bool}}, goalStart, goalWho: learner pupil a…","x-pn-source":"platform/pn/inspector.py rules_put()","description":"GET PUT DELETE /api/inspector/rules inspector (own) His rule card: {req:{manhaji,idmaji,taqyimi,daam: {field: bool}}, goalStart, goalWho: learner pupil any, objFromProgramme, evalWindow, stages:[1..8 strings ≤ 24], deadline: الجمعة السبت الاثنين صباحاً} . Anything else → 400. DELETE = back to the ba","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_inspector_rules","tags":["Inspector space, server-backed"],"summary":"inspector (own) His rule card: {req:{manhaji,idmaji,taqyimi,daam: {field: bool}}, goalStart, goalWho: learner pupil a…","x-pn-source":"platform/pn/inspector.py rules_reset()","description":"GET PUT DELETE /api/inspector/rules inspector (own) His rule card: {req:{manhaji,idmaji,taqyimi,daam: {field: bool}}, goalStart, goalWho: learner pupil any, objFromProgramme, evalWindow, stages:[1..8 strings ≤ 24], deadline: الجمعة السبت الاثنين صباحاً} . Anything else → 400. DELETE = back to the ba","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/shared-summary":{"get":{"operationId":"get_inspector_shared_summary","tags":["Inspector space, server-backed"],"summary":"inspector From his active shares only (his region): progress per share (inspection file dist : done/total/delay per c…","x-pn-source":"platform/pn/inspector.py shared_summary()","description":"GET /api/inspector/shared-summary inspector From his active shares only (his region): progress per share (inspection file dist : done/total/delay per class and subject; entries: last shared session and last objective per class and subject), errors.totals (error counts of the shared evalrec , summed ","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.review"],"x-pn-roles":["inspector"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/support-groups":{"get":{"operationId":"get_inspector_support_groups","tags":["Inspector space, server-backed"],"summary":"inspector Support groups computed from his active shares only (his region): teachers who shared the same criterion co…","x-pn-source":"platform/pn/inspector.py sgroups()","description":"GET /api/inspector/support-groups inspector Support groups computed from his active shares only (his region): teachers who shared the same criterion code (مع1…مع4 targeted in a shared daam / taqyimi session) or the same error label (rows of a shared inspection file evalrec , count > 0) in the same s","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.review"],"x-pn-roles":["inspector"],"parameters":[{"name":"order","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/support-suggestions":{"post":{"operationId":"post_inspector_support_suggestions","tags":["Inspector space, server-backed"],"summary":"DELETE …/{id} inspector {group_id, text} (1..280) → 201 {id, …, recipients:[{teacher, school, answer: accepted no_rep…","x-pn-source":"platform/pn/inspector.py sug_send()","description":"POST /api/inspector/support-suggestions · DELETE …/{id} inspector {group_id, text} (1..280) → 201 {id, …, recipients:[{teacher, school, answer: accepted no_reply}]} . The group is recomputed on the server from his shares (an id that no longer matches → 404); members who already have an open suggesti","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.review"],"x-pn-roles":["inspector"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"group_id":{},"text":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"support.exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/support-suggestions/{sid}":{"patch":{"operationId":"patch_inspector_support_suggestions_by_sid","tags":["Inspector work, server-backed"],"summary":"that inspector {text?, add?:[teacher ids], remove?:[teacher ids]} . add : she must be in the group recomputed now fro…","x-pn-source":"platform/pn/inspector_work.py sug_edit()","description":"PATCH /api/inspector/support-suggestions/{id} that inspector {text?, add?:[teacher ids], remove?:[teacher ids]} . add : she must be in the group recomputed now from his active shares ( not_in_group ), not already a recipient ( already ), not in another open suggestion of the same group ( 409 support","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["journal.review"],"x-pn-roles":["inspector"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"add":{},"remove":{},"text":{}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"support.withdrawn, support.empty, support.exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_inspector_support_suggestions_by_sid","tags":["Inspector space, server-backed"],"summary":"DELETE …/{id} inspector {group_id, text} (1..280) → 201 {id, …, recipients:[{teacher, school, answer: accepted no_rep…","x-pn-source":"platform/pn/inspector.py sug_withdraw()","description":"POST /api/inspector/support-suggestions · DELETE …/{id} inspector {group_id, text} (1..280) → 201 {id, …, recipients:[{teacher, school, answer: accepted no_reply}]} . The group is recomputed on the server from his shares (an id that no longer matches → 404); members who already have an open suggesti","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.review"],"x-pn-roles":["inspector"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/support-suggestions/{sid}/session":{"post":{"operationId":"post_inspector_support_suggestions_by_sid_session","tags":["Inspector work, server-backed"],"summary":"inspector «حدّد موعد الحصّة» {day, time?, place} ; needs ≥ 2 acceptances ( 409 support.too_few ); 201 then 200 on cha…","x-pn-source":"platform/pn/inspector_work.py sug_session()","description":"POST /api/inspector/support-suggestions/{id}/session inspector «حدّد موعد الحصّة» {day, time?, place} ; needs ≥ 2 acceptances ( 409 support.too_few ); 201 then 200 on change; notifies those who accepted ( support_session )","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["journal.review"],"x-pn-roles":["inspector"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"day":{},"place":{},"time":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"support.withdrawn, support.too_few","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/teachers":{"get":{"operationId":"get_inspector_teachers","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"inspector Roster of his region by school then name: {school, teachers:[{id, display_name}]} . No figure about anyone","x-pn-source":"platform/pn/journal.py insp_roster()","description":"GET /api/inspector/teachers inspector Roster of his region by school then name: {school, teachers:[{id, display_name}]} . No figure about anyone","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/trainings":{"get":{"operationId":"get_inspector_trainings","tags":["Inspector work, server-backed"],"summary":"GET …/{id}/sheet · DELETE …/{id} inspector «يوم تكويني». POST {topic 1..120, source?:{kind: criteria evalrec, subject…","x-pn-source":"platform/pn/inspector_work.py tr_list()","description":"POST GET /api/inspector/trainings · GET …/{id}/sheet · DELETE …/{id} inspector «يوم تكويني». POST {topic 1..120, source?:{kind: criteria evalrec, subject, label} (must be in his active shares now, else source: not_shared ), day (> today, teaching day), time?, place 1..120, schools?:[ids], teachers?:","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_inspector_trainings","tags":["Inspector work, server-backed"],"summary":"GET …/{id}/sheet · DELETE …/{id} inspector «يوم تكويني». POST {topic 1..120, source?:{kind: criteria evalrec, subject…","x-pn-source":"platform/pn/inspector_work.py tr_create()","description":"POST GET /api/inspector/trainings · GET …/{id}/sheet · DELETE …/{id} inspector «يوم تكويني». POST {topic 1..120, source?:{kind: criteria evalrec, subject, label} (must be in his active shares now, else source: not_shared ), day (> today, teaching day), time?, place 1..120, schools?:[ids], teachers?:","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"day":{},"place":{},"schools":{},"source":{},"teachers":{},"time":{},"topic":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/trainings/{tid}":{"patch":{"operationId":"patch_inspector_trainings_by_tid","tags":["Inspector work, server-backed"],"summary":"that inspector {topic?, day?, time?, place?, add_schools?:[ids], add_teachers?:[ids], remove_teachers?:[ids]} (his re…","x-pn-source":"platform/pn/inspector_work.py tr_edit()","description":"PATCH /api/inspector/trainings/{id} that inspector {topic?, day?, time?, place?, add_schools?:[ids], add_teachers?:[ids], remove_teachers?:[ids]} (his region; remove_teachers must be invited, else not_invited ; nobody left → invite: empty ). Cancelled → 409 training.cancelled , past → 409 training.p","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"tid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"add_schools":{},"add_teachers":{},"day":{},"place":{},"remove_teachers":{},"time":{},"topic":{}},"required":["day","place","topic"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"training.cancelled, training.past","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_inspector_trainings_by_tid","tags":["Inspector work, server-backed"],"summary":"GET …/{id}/sheet · DELETE …/{id} inspector «يوم تكويني». POST {topic 1..120, source?:{kind: criteria evalrec, subject…","x-pn-source":"platform/pn/inspector_work.py tr_cancel()","description":"POST GET /api/inspector/trainings · GET …/{id}/sheet · DELETE …/{id} inspector «يوم تكويني». POST {topic 1..120, source?:{kind: criteria evalrec, subject, label} (must be in his active shares now, else source: not_shared ), day (> today, teaching day), time?, place 1..120, schools?:[ids], teachers?:","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"tid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/trainings/{tid}/sheet":{"get":{"operationId":"get_inspector_trainings_by_tid_sheet","tags":["Inspector work, server-backed"],"summary":"GET …/{id}/sheet · DELETE …/{id} inspector «يوم تكويني». POST {topic 1..120, source?:{kind: criteria evalrec, subject…","x-pn-source":"platform/pn/inspector_work.py tr_sheet()","description":"POST GET /api/inspector/trainings · GET …/{id}/sheet · DELETE …/{id} inspector «يوم تكويني». POST {topic 1..120, source?:{kind: criteria evalrec, subject, label} (must be in his active shares now, else source: not_shared ), day (> today, teaching day), time?, place 1..120, schools?:[ids], teachers?:","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"tid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/visit-groups":{"get":{"operationId":"get_inspector_visit_groups","tags":["Inspector space, server-backed"],"summary":"inspector {groups:[{k: first_year requested over_two_years, title_ar, source_ar, items:[{teacher:{id,display_name}, s…","x-pn-source":"platform/pn/inspector.py visit_groups()","description":"GET /api/inspector/visit-groups inspector {groups:[{k: first_year requested over_two_years, title_ar, source_ar, items:[{teacher:{id,display_name}, school:{id,name_ar}}]}], no_visit_recorded} . His region(s) only; names only; by school then name. over_two_years = last visit (any inspector, day ≤ tod","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/visit-plan":{"get":{"operationId":"get_inspector_visit_plan","tags":["Inspector work, server-backed"],"summary":"inspector {today, min_day, default_day, default_day_ar, items:[{id, day, day_ar, time, school, teacher}], closed:[{da…","x-pn-source":"platform/pn/inspector_work.py plan_list()","description":"GET /api/inspector/visit-plan?from= inspector {today, min_day, default_day, default_day_ar, items:[{id, day, day_ar, time, school, teacher}], closed:[{day, reason_ar}], per_day_max} . default_day = first teaching day ≥ today + 2 (Sunday, closed holidays, primary vacations of the official calendar sk","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_inspector_visit_plan","tags":["Inspector work, server-backed"],"summary":"inspector {teacher_id, day, time?} → 201. day > today ( not_after_today : never today), not a closed day ( school_clo…","x-pn-source":"platform/pn/inspector_work.py plan_add()","description":"POST /api/inspector/visit-plan inspector {teacher_id, day, time?} → 201. day > today ( not_after_today : never today), not a closed day ( school_closed ), ≤ 400 days; time HH:MM 07:00–18:30. One per teacher per week ( 409 visit.exists ), two per day ( 409 visit.day_full ). Closes her open request ( ","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"day":{},"teacher_id":{},"time":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"visit.exists, visit.day_full","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/visit-plan/{vid}":{"put":{"operationId":"put_inspector_visit_plan_by_vid","tags":["Inspector work, server-backed"],"summary":"that inspector {time} only ( null clears); past visit → 409 visit.past ; notifies her","x-pn-source":"platform/pn/inspector_work.py plan_time()","description":"PUT /api/inspector/visit-plan/{id} that inspector {time} only ( null clears); past visit → 409 visit.past ; notifies her","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"vid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"time":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"visit.past","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"patch":{"operationId":"patch_inspector_visit_plan_by_vid","tags":["Inspector work, server-backed"],"summary":"that inspector {day?, time?} ( time: null clears). Same rules as POST for a new day ( not_after_today , school_closed…","x-pn-source":"platform/pn/inspector_work.py plan_edit()","description":"PATCH /api/inspector/visit-plan/{id} that inspector {day?, time?} ( time: null clears). Same rules as POST for a new day ( not_after_today , school_closed , 409 visit.exists same week, 409 visit.day_full ); past visit → 409 visit.past . She is told «تغيّر موعد الزيارة» with the new and the old date.","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"vid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"day":{},"time":{}},"required":["day","time"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"visit.past, visit.exists, visit.day_full","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/visit-records":{"get":{"operationId":"get_inspector_visit_records","tags":["Inspector space, server-backed"],"summary":"PUT DELETE …/{id} inspector (own) «الزيارات السابقة»: visits made before the platform. POST {teacher_id, day, kind: v…","x-pn-source":"platform/pn/inspector.py vrec_list()","description":"GET POST /api/inspector/visit-records · PUT DELETE …/{id} inspector (own) «الزيارات السابقة»: visits made before the platform. POST {teacher_id, day, kind: visit followup, note?} → 201: a teacher of his region (else 404), day ≤ today ( in_the_future ), ≥ 1990, note ≤ 280 chars without control charac","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_inspector_visit_records","tags":["Inspector space, server-backed"],"summary":"PUT DELETE …/{id} inspector (own) «الزيارات السابقة»: visits made before the platform. POST {teacher_id, day, kind: v…","x-pn-source":"platform/pn/inspector.py vrec_add()","description":"GET POST /api/inspector/visit-records · PUT DELETE …/{id} inspector (own) «الزيارات السابقة»: visits made before the platform. POST {teacher_id, day, kind: visit followup, note?} → 201: a teacher of his region (else 404), day ≤ today ( in_the_future ), ≥ 1990, note ≤ 280 chars without control charac","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"day":{},"kind":{},"note":{},"teacher_id":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"visit.exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/visit-records/batch":{"post":{"operationId":"post_inspector_visit_records_batch","tags":["Inspector work, server-backed"],"summary":"inspector {rows:[{teacher_id, day, kind}] 1..200, confirm?: bool} . Preview (default): 200 {rows:[{i, ok, error?, tea…","x-pn-source":"platform/pn/inspector_work.py vrec_batch()","description":"POST /api/inspector/visit-records/batch inspector {rows:[{teacher_id, day, kind}] 1..200, confirm?: bool} . Preview (default): 200 {rows:[{i, ok, error?, teacher?, school?, day, kind, kind_ar?, day_ar?}], valid, invalid, stored:0} ; errors not_allowed, teacher_required, not_in_region, bad_day, in_th","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{},"rows":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/visit-records/{rid}":{"put":{"operationId":"put_inspector_visit_records_by_rid","tags":["Inspector space, server-backed"],"summary":"PUT DELETE …/{id} inspector (own) «الزيارات السابقة»: visits made before the platform. POST {teacher_id, day, kind: v…","x-pn-source":"platform/pn/inspector.py vrec_note()","description":"GET POST /api/inspector/visit-records · PUT DELETE …/{id} inspector (own) «الزيارات السابقة»: visits made before the platform. POST {teacher_id, day, kind: visit followup, note?} → 201: a teacher of his region (else 404), day ≤ today ( in_the_future ), ≥ 1990, note ≤ 280 chars without control charac","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_inspector_visit_records_by_rid","tags":["Inspector space, server-backed"],"summary":"PUT DELETE …/{id} inspector (own) «الزيارات السابقة»: visits made before the platform. POST {teacher_id, day, kind: v…","x-pn-source":"platform/pn/inspector.py vrec_del()","description":"GET POST /api/inspector/visit-records · PUT DELETE …/{id} inspector (own) «الزيارات السابقة»: visits made before the platform. POST {teacher_id, day, kind: visit followup, note?} → 201: a teacher of his region (else 404), day ≤ today ( in_the_future ), ≥ 1990, note ≤ 280 chars without control charac","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/visits":{"get":{"operationId":"get_inspector_visits","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"inspector (his) · teacher (visits to her)","x-pn-source":"platform/pn/journal.py visits_list()","description":"GET /api/inspector/visits?from= inspector (his) · teacher (visits to her)","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan","visit.read"],"x-pn-roles":["inspector","teacher"],"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_inspector_visits","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"inspector {teacher_id, day} («أضف إلى الأسبوع»): teacher of his region (else 404), not a Sunday, not past; one per te…","x-pn-source":"platform/pn/journal.py visits_add()","description":"POST /api/inspector/visits inspector {teacher_id, day} («أضف إلى الأسبوع»): teacher of his region (else 404), not a Sunday, not past; one per teacher per week ( 409 visit.exists ), two per day ( 409 visit.day_full )","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"day":{},"teacher_id":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"visit.exists, visit.day_full","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/inspector/visits/{vid}":{"delete":{"operationId":"delete_inspector_visits_by_vid","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"that inspector «أزل من الأسبوع» → 204","x-pn-source":"platform/pn/journal.py visits_remove()","description":"DELETE /api/inspector/visits/{id} that inspector «أزل من الأسبوع» → 204","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"x-pn-permissions":["visit.plan"],"x-pn-roles":["inspector"],"parameters":[{"name":"vid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/jobs/{jid}":{"get":{"operationId":"get_jobs_by_jid","tags":["Aggregates, exports, jobs"],"summary":"→ { \"id\", \"kind\", \"status\": \"queued running done failed\", \"attempts\", \"result\", \"created_at\", \"finished_at\" } (creato…","x-pn-source":"platform/pn/routes.py jobs_get()","description":"- GET /api/jobs/{id} → { \"id\", \"kind\", \"status\": \"queued running done failed\", \"attempts\", \"result\", \"created_at\", \"finished_at\" } (creator only).","x-pn-doc":{"file":"platform/docs/API.md","section":"6. Aggregates, exports, jobs"},"parameters":[{"name":"jid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/entries":{"get":{"operationId":"get_journal_entries","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"teacher (own) Her other phone: {items:[{key, rev, status, body, device, at, deleted, seq}], next, more}","x-pn-source":"platform/pn/journal.py journal_pull()","description":"GET /api/journal/entries?since=&limit= teacher (own) Her other phone: {items:[{key, rev, status, body, device, at, deleted, seq}], next, more}","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.read"],"x-pn-roles":["teacher"],"parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_journal_entries","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"teacher (own) {dev, items:[{key, base, at, status, saved_at, body} {key, base, at, deleted:true}]} ≤ 40 → {items:[{ke…","x-pn-source":"platform/pn/journal.py journal_push()","description":"POST /api/journal/entries teacher (own) {dev, items:[{key, base, at, status, saved_at, body} {key, base, at, deleted:true}]} ≤ 40 → {items:[{key, rev} {key, conflict:true, rev, at}], cursor}","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.write"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"conflicts":{},"dev":{},"items":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"idempotency.key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/inspectors":{"get":{"operationId":"get_journal_inspectors","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"teacher Inspectors whose region covers her school: {items:[{id, display_name}], region_name_ar}","x-pn-source":"platform/pn/journal.py journal_inspectors()","description":"GET /api/journal/inspectors teacher Inspectors whose region covers her school: {items:[{id, display_name}], region_name_ar}","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/reports":{"get":{"operationId":"get_journal_reports","tags":["Inspector work, server-backed"],"summary":"GET …/{id} teacher Delivered reports about her only (a draft → 404, and RLS hides it): list {items:[{id, day, day_ar,…","x-pn-source":"platform/pn/inspector_work.py rep_mine()","description":"GET /api/journal/reports · GET …/{id} teacher Delivered reports about her only (a draft → 404, and RLS hides it): list {items:[{id, day, day_ar, class_label, inspector:{display_name}, delivered_at}]} ; one = the view above without facts.classes and without her id, plus inspector:{display_name} . Rea","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/reports/{rid}":{"get":{"operationId":"get_journal_reports_by_rid","tags":["Inspector work, server-backed"],"summary":"GET …/{id} teacher Delivered reports about her only (a draft → 404, and RLS hides it): list {items:[{id, day, day_ar,…","x-pn-source":"platform/pn/inspector_work.py rep_mine_one()","description":"GET /api/journal/reports · GET …/{id} teacher Delivered reports about her only (a draft → 404, and RLS hides it): list {items:[{id, day, day_ar, class_label, inspector:{display_name}, delivered_at}]} ; one = the view above without facts.classes and without her id, plus inspector:{display_name} . Rea","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/rules":{"get":{"operationId":"get_journal_rules","tags":["Inspector space, server-backed"],"summary":"teacher The saved cards of the inspectors of her region (her journal shows them as warnings, never a block)","x-pn-source":"platform/pn/inspector.py rules_for_teacher()","description":"GET /api/journal/rules teacher The saved cards of the inspectors of her region (her journal shows them as warnings, never a block)","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.read"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/shares":{"get":{"operationId":"get_journal_shares","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"teacher (her shares, any state) · inspector (active shares made to him) Ordered by date, never by a value. Director →…","x-pn-source":"platform/pn/journal.py shares_list()","description":"GET /api/journal/shares teacher (her shares, any state) · inspector (active shares made to him) Ordered by date, never by a value. Director → 403","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share","journal.review"],"x-pn-roles":["inspector","teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_journal_shares","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"teacher {kind:\"entries\", inspector_id, title?, items:[{key, entry}] ≤ 40} or {kind:\"inspection_file\", inspector_id, z…","x-pn-source":"platform/pn/journal.py shares_create()","description":"POST /api/journal/shares teacher {kind:\"entries\", inspector_id, title?, items:[{key, entry}] ≤ 40} or {kind:\"inspection_file\", inspector_id, z:\"z…\"} → 201 (same thing again → 200, version +1)","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"inspector_id":{},"items":{},"kind":{},"title":{},"z":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"journal.not_synced","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/shares/{sid}":{"get":{"operationId":"get_journal_shares_by_sid","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"owner · the grantee while active + content (her copy, text included), thread ; owner also gets access (who read, when…","x-pn-source":"platform/pn/journal.py shares_get()","description":"GET /api/journal/shares/{id} owner · the grantee while active + content (her copy, text included), thread ; owner also gets access (who read, when). Anyone else → 404 . Grantee read is audited","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_journal_shares_by_sid","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"owner only Revoke: content deleted, state revoked ; the inspector gets 404 from then on; the thread stays hers","x-pn-source":"platform/pn/journal.py shares_revoke()","description":"DELETE /api/journal/shares/{id} owner only Revoke: content deleted, state revoked ; the inspector gets 404 from then on; the thread stays hers","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/shares/{sid}/reviews":{"post":{"operationId":"post_journal_shares_by_sid_reviews","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"grantee: approve («صادِق على الدفتر») · note («أرسل الملاحظة دون مصادقة», body required) · comment ; owner: comment o…","x-pn-source":"platform/pn/journal.py reviews_create()","description":"POST /api/journal/shares/{id}/reviews grantee: approve («صادِق على الدفتر») · note («أرسل الملاحظة دون مصادقة», body required) · comment ; owner: comment only 201 {id, kind, body, at, review} ; revoked → 409 journal.share_revoked ; notifies the other party (no review text in the notification)","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{},"kind":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"journal.share_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/support-suggestions":{"get":{"operationId":"get_journal_support_suggestions","tags":["Inspector space, server-backed"],"summary":"POST …/{id}/answer teacher (recipient) {answer: accept ignore, show_name?: bool} . peers = other recipients who accep…","x-pn-source":"platform/pn/inspector.py sug_mine()","description":"GET /api/journal/support-suggestions · POST …/{id}/answer teacher (recipient) {answer: accept ignore, show_name?: bool} . peers = other recipients who accepted and set show_name , shown only to a teacher who accepted, only while open. The inspector sees accepted or no_reply : an «ignore» is never re","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/support-suggestions/{sid}/answer":{"post":{"operationId":"post_journal_support_suggestions_by_sid_answer","tags":["Inspector space, server-backed"],"summary":"POST …/{id}/answer teacher (recipient) {answer: accept ignore, show_name?: bool} . peers = other recipients who accep…","x-pn-source":"platform/pn/inspector.py sug_answer()","description":"GET /api/journal/support-suggestions · POST …/{id}/answer teacher (recipient) {answer: accept ignore, show_name?: bool} . peers = other recipients who accepted and set show_name , shown only to a teacher who accepted, only while open. The inspector sees accepted or no_reply : an «ignore» is never re","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{},"show_name":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"support.withdrawn","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/trainings":{"get":{"operationId":"get_journal_trainings","tags":["Inspector work, server-backed"],"summary":"POST …/{id}/answer teacher (invited) {answer: accept decline, show_name?: bool} ; cancelled → 409 training.cancelled …","x-pn-source":"platform/pn/inspector_work.py tr_mine()","description":"GET /api/journal/trainings · POST …/{id}/answer teacher (invited) {answer: accept decline, show_name?: bool} ; cancelled → 409 training.cancelled , past → 409 training.past","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/trainings/{tid}/answer":{"post":{"operationId":"post_journal_trainings_by_tid_answer","tags":["Inspector work, server-backed"],"summary":"POST …/{id}/answer teacher (invited) {answer: accept decline, show_name?: bool} ; cancelled → 409 training.cancelled …","x-pn-source":"platform/pn/inspector_work.py tr_answer()","description":"GET /api/journal/trainings · POST …/{id}/answer teacher (invited) {answer: accept decline, show_name?: bool} ; cancelled → 409 training.cancelled , past → 409 training.past","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"tid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{},"show_name":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"training.cancelled, training.past","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/visit-records":{"get":{"operationId":"get_journal_visit_records","tags":["Inspector space, server-backed"],"summary":"teacher Visits recorded about her: {id, day, kind, kind_ar, school, inspector:{display_name}, recorded_at} . Never th…","x-pn-source":"platform/pn/inspector.py vrec_mine()","description":"GET /api/journal/visit-records teacher Visits recorded about her: {id, day, kind, kind_ar, school, inspector:{display_name}, recorded_at} . Never the note","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/visit-requests":{"get":{"operationId":"get_journal_visit_requests","tags":["Inspector space, server-backed"],"summary":"DELETE …/{id} teacher (own) {inspector_id} only (no reason text) → 201; same inspector again while open/planned → 200…","x-pn-source":"platform/pn/inspector.py vreq_list()","description":"GET POST /api/journal/visit-requests · DELETE …/{id} teacher (own) {inspector_id} only (no reason text) → 201; same inspector again while open/planned → 200 (same request). Inspector outside her region → 404. DELETE = withdraw (row kept, withdrawn ). Notifies him ( visit_requested ). Planning a visi","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_journal_visit_requests","tags":["Inspector space, server-backed"],"summary":"DELETE …/{id} teacher (own) {inspector_id} only (no reason text) → 201; same inspector again while open/planned → 200…","x-pn-source":"platform/pn/inspector.py vreq_create()","description":"GET POST /api/journal/visit-requests · DELETE …/{id} teacher (own) {inspector_id} only (no reason text) → 201; same inspector again while open/planned → 200 (same request). Inspector outside her region → 404. DELETE = withdraw (row kept, withdrawn ). Notifies him ( visit_requested ). Planning a visi","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"inspector_id":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/visit-requests/{vid}":{"delete":{"operationId":"delete_journal_visit_requests_by_vid","tags":["Inspector space, server-backed"],"summary":"DELETE …/{id} teacher (own) {inspector_id} only (no reason text) → 201; same inspector again while open/planned → 200…","x-pn-source":"platform/pn/inspector.py vreq_withdraw()","description":"GET POST /api/journal/visit-requests · DELETE …/{id} teacher (own) {inspector_id} only (no reason text) → 201; same inspector again while open/planned → 200 (same request). Inspector outside her region → 404. DELETE = withdraw (row kept, withdrawn ). Notifies him ( visit_requested ). Planning a visi","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"vid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/journal/visits":{"get":{"operationId":"get_journal_visits","tags":["Inspector work, server-backed"],"summary":"teacher Her visits from today on: {items:[{id, day, day_ar, time, school:{name_ar}, inspector:{id, display_name}}]}","x-pn-source":"platform/pn/inspector_work.py my_visits()","description":"GET /api/journal/visits teacher Her visits from today on: {items:[{id, day, day_ar, time, school:{name_ar}, inspector:{id, display_name}}]}","x-pn-doc":{"file":"platform/docs/API.md","section":"11d. Inspector work, server-backed (23 Nov 2026, phase 1)"},"x-pn-permissions":["journal.share"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me":{"get":{"operationId":"get_me","tags":["Me and notifications"],"summary":"GET /api/me","x-pn-source":"platform/pn/routes.py me()","description":"GET /api/me","x-pn-doc":{"file":"platform/docs/API.md","section":"4. Me and notifications"},"x-pn-pw-ok":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/classes":{"get":{"operationId":"get_me_classes","tags":["Class rosters and class records"],"summary":"(teacher, own)","x-pn-source":"platform/pn/classes.py me_classes()","description":"GET /api/me/classes (teacher, own)","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class rosters and class records («قسمي» on the server; phase 2: closed, 25 Nov 2026)"},"x-pn-permissions":["classes.read"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/classes/records":{"post":{"operationId":"post_me_classes_records","tags":["Class rosters and class records"],"summary":"(teacher, own; Idempotency-Key as everywhere)","x-pn-source":"platform/pn/classes.py post_records()","description":"POST /api/me/classes/records (teacher, own; Idempotency-Key as everywhere)","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class rosters and class records («قسمي» on the server; phase 2: closed, 25 Nov 2026)"},"x-pn-permissions":["classes.write"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"dev":{"type":"string","minLength":1,"maxLength":64},"ops":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/classes/{cid}/continuity":{"get":{"operationId":"get_me_classes_by_cid_continuity","tags":["Class continuity"],"summary":"original teacher reads the class journal position and programme coverage. From this migration onward, the previous sc…","x-pn-source":"platform/pn/continuity.py history()","description":"- GET /api/me/classes/{cid}/continuity — original teacher reads the class journal position and programme coverage. From this migration onward, the previous school year’s coverage survives rollover. The existing classes route provides the teacher's dated pupil records.","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["continuity.use"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/classes/{cid}/roster":{"put":{"operationId":"put_me_classes_by_cid_roster","tags":["Class rosters and class records"],"summary":"(teacher, own)","x-pn-source":"platform/pn/classes.py put_roster()","description":"PUT /api/me/classes/{cid}/roster (teacher, own)","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class rosters and class records («قسمي» on the server; phase 2: closed, 25 Nov 2026)"},"x-pn-permissions":["classes.write"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":60},"pupils":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"precondition.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/delegations":{"get":{"operationId":"get_me_delegations","tags":["Class continuity"],"summary":"list incoming active assignments and outgoing assignments.","x-pn-source":"platform/pn/continuity.py mine()","description":"- GET /api/me/delegations — list incoming active assignments and outgoing assignments.","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["continuity.use"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/delegations/{did}":{"get":{"operationId":"get_me_delegations_by_did","tags":["Class continuity"],"summary":"class pack for the assigned teacher or return summary for the original teacher.","x-pn-source":"platform/pn/continuity.py pack()","description":"- GET /api/me/delegations/{did} — class pack for the assigned teacher or return summary for the original teacher.","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["continuity.use"],"x-pn-roles":["teacher"],"parameters":[{"name":"did","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/delegations/{did}/activity":{"post":{"operationId":"post_me_delegations_by_did_activity","tags":["Class continuity"],"summary":"assigned teacher adds class session entries or attendance. Each item has a unique id , date and kind . A session has …","x-pn-source":"platform/pn/continuity.py activity()","description":"- POST /api/me/delegations/{did}/activity — assigned teacher adds class session entries or attendance. Each item has a unique id , date and kind . A session has title , an optional class-level note , and an optional timetable slot checked against the delegated roster and weekday. Attendance has sess","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["continuity.use"],"x-pn-roles":["teacher"],"parameters":[{"name":"did","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/delegations/{did}/briefing":{"put":{"operationId":"put_me_delegations_by_did_briefing","tags":["Class continuity"],"summary":"original teacher publishes class-level briefing, dated prepared lesson outlines and an optional encrypted consented s…","x-pn-source":"platform/pn/continuity.py publish()","description":"- PUT /api/me/delegations/{did}/briefing — original teacher publishes class-level briefing, dated prepared lesson outlines and an optional encrypted consented supplement.","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["continuity.use"],"x-pn-roles":["teacher"],"parameters":[{"name":"did","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"briefing":{"type":"string","minLength":0,"maxLength":400},"lessons":{},"supplement":{}},"required":["briefing"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/delegations/{did}/sms":{"post":{"operationId":"post_me_delegations_by_did_sms","tags":["Class continuity"],"summary":"queue a message with the existing SMS safeguards. The pack exposes only authorized contact handles and pupil names. H…","x-pn-source":"platform/pn/sms.py sms_send()","description":"- POST /api/me/delegations/{did}/sms — queue a message with the existing SMS safeguards. The pack exposes only authorized contact handles and pupil names. Held messages are rechecked before dispatch.","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["sms.send"],"x-pn-roles":["teacher"],"x-pn-gate":["feature_pupil_records"],"parameters":[{"name":"did","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"type":"string","minLength":1,"maxLength":80},"template_id":{"type":"string","minLength":1,"maxLength":16},"text":{"type":"string","minLength":1,"maxLength":201}},"required":["contact_id","template_id","text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, sms.school_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"idempotency.key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/delegations/{did}/sms-contacts":{"post":{"operationId":"post_me_delegations_by_did_sms_contacts","tags":["Class continuity"],"summary":"original teacher binds a consented SMS contact to an active pupil in this roster using a consent reference that cover…","x-pn-source":"platform/pn/continuity.py grant_sms()","description":"- POST /api/me/delegations/{did}/sms-contacts — original teacher binds a consented SMS contact to an active pupil in this roster using a consent reference that covers the assignment.","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["continuity.use","sms.send"],"x-pn-roles":["teacher"],"parameters":[{"name":"did","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"consent_ref":{"type":"string","minLength":1,"maxLength":80},"contact_id":{"type":"string","minLength":1,"maxLength":80},"pupil_id":{"type":"string","minLength":1,"maxLength":80}},"required":["consent_ref","contact_id","pupil_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/delegations/{did}/sms-contacts/{cid}":{"delete":{"operationId":"delete_me_delegations_by_did_sms_contacts_by_cid","tags":["Class continuity"],"summary":"withdraw the SMS contact authorization.","x-pn-source":"platform/pn/continuity.py revoke_sms()","description":"- DELETE /api/me/delegations/{did}/sms-contacts/{cid} — withdraw the SMS contact authorization.","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["continuity.use"],"x-pn-roles":["teacher"],"parameters":[{"name":"did","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/notification-prefs":{"get":{"operationId":"get_me_notification_prefs","tags":["Me and notifications"],"summary":"/ PUT { \"email\": false, \"sms\": false } → the prefs. In-app is always on. Email/SMS are stubs that only log in this demo.","x-pn-source":"platform/pn/routes.py prefs_get()","description":"- GET /api/me/notification-prefs / PUT { \"email\": false, \"sms\": false } → the prefs. In-app is always on. Email/SMS are stubs that only log in this demo.","x-pn-doc":{"file":"platform/docs/API.md","section":"4. Me and notifications"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"put":{"operationId":"put_me_notification_prefs","tags":["Me and notifications"],"summary":"/ PUT { \"email\": false, \"sms\": false } → the prefs. In-app is always on. Email/SMS are stubs that only log in this demo.","x-pn-source":"platform/pn/routes.py prefs_put()","description":"- GET /api/me/notification-prefs / PUT { \"email\": false, \"sms\": false } → the prefs. In-app is always on. Email/SMS are stubs that only log in this demo.","x-pn-doc":{"file":"platform/docs/API.md","section":"4. Me and notifications"},"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"boolean"},"sms":{"type":"boolean"}},"required":["email","sms"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/profile":{"put":{"operationId":"put_me_profile","tags":["Me and notifications"],"summary":") picks the feminine or masculine form; with no declaration (empty, not a teacher, inspectors,","x-pn-source":"platform/pn/routes.py me_profile()","description":"PUT /api/me/profile ) picks the feminine or masculine form; with no declaration (empty, not a teacher, inspectors,","x-pn-doc":{"file":"platform/docs/API.md","section":"4. Me and notifications"},"x-pn-permissions":["profile.write"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/school-office":{"get":{"operationId":"get_me_school_office","tags":["Director decisions"],"summary":"shows the caller's school correspondence, journal comments addressed to them, and announcements for linked parents. P…","x-pn-source":"platform/pn/director.py office()","description":"- GET /api/me/school-office shows the caller's school correspondence, journal comments addressed to them, and announcements for linked parents. POST /api/me/school-office/{sid}/messages sends a message to the school office.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/school-office/{sid}/messages":{"post":{"operationId":"post_me_school_office_by_sid_messages","tags":["Director decisions"],"summary":"shows the caller's school correspondence, journal comments addressed to them, and announcements for linked parents. P…","x-pn-source":"platform/pn/director.py send()","description":"- GET /api/me/school-office shows the caller's school correspondence, journal comments addressed to them, and announcements for linked parents. POST /api/me/school-office/{sid}/messages sends a message to the school office.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":600}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/school-office/{sid}/support-help":{"post":{"operationId":"post_me_school_office_by_sid_support_help","tags":["Support plans and pupil-level ML"],"summary":"Teacher at the school. Accepts {\"request\":\"review_time\"} and creates a message for the school office.","x-pn-source":"platform/pn/director.py support_help()","description":"POST /api/me/school-office/{sid}/support-help Teacher at the school. Accepts {\"request\":\"review_time\"} and creates a message for the school office.","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/school-shares":{"get":{"operationId":"get_me_school_shares","tags":["«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts"],"summary":"(teacher) her items with reused / thanked per item, reusers / thankers (distinct colleagues).","x-pn-source":"platform/pn/recognition.py my_shares()","description":"- GET /api/me/school-shares (teacher) her items with reused / thanked per item, reusers / thankers (distinct colleagues).","x-pn-doc":{"file":"platform/docs/API.md","section":"«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts (pn/recognition.py, 28 Nov 2026)"},"x-pn-permissions":["school.share"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/seniority":{"get":{"operationId":"get_me_seniority","tags":["Inspector space, server-backed"],"summary":"PUT /api/me/seniority {band} teacher (own) Optional, declared by her: y1 (first year) y2_5 y6_15 y16 or null (withdra…","x-pn-source":"platform/pn/inspector.py seniority_get()","description":"GET /api/me/seniority · PUT /api/me/seniority {band} teacher (own) Optional, declared by her: y1 (first year) y2_5 y6_15 y16 or null (withdrawn). Any other key → 400. Used only for the group «سنة أولى تدريس»","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["profile.write"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"put":{"operationId":"put_me_seniority","tags":["Inspector space, server-backed"],"summary":"PUT /api/me/seniority {band} teacher (own) Optional, declared by her: y1 (first year) y2_5 y6_15 y16 or null (withdra…","x-pn-source":"platform/pn/inspector.py seniority_put()","description":"GET /api/me/seniority · PUT /api/me/seniority {band} teacher (own) Optional, declared by her: y1 (first year) y2_5 y6_15 y16 or null (withdrawn). Any other key → 400. Used only for the group «سنة أولى تدريس»","x-pn-doc":{"file":"platform/docs/API.md","section":"11c. Inspector space, server-backed (22 Nov 2026, phase 1)"},"x-pn-permissions":["profile.write"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"band":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/me/workspace":{"get":{"operationId":"get_me_workspace","tags":["Teacher workspace and sync"],"summary":"(any role)","x-pn-source":"platform/pn/routes.py me_workspace()","description":"GET /api/me/workspace (any role)","x-pn-doc":{"file":"platform/docs/API.md","section":"11. Teacher workspace and sync (22 Nov 2026, phase 1)"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/messages/children":{"get":{"operationId":"get_messages_children","tags":["Teacher–parent messages"],"summary":"200 {children:[{id, name, class_id, class_label, side, messages, unread, last_at, guardians?}]} , most recent thread …","x-pn-source":"platform/pn/messages.py children()","description":"GET /api/messages/children — 200 {children:[{id, name, class_id, class_label, side, messages, unread, last_at, guardians?}]} , most recent thread first; on the teacher / director side guardians:[{name, relationship_ar}] lists every verified guardian of the child (both parents); the class teacher als","x-pn-doc":{"file":"platform/docs/API.md","section":"Teacher–parent messages («مراسلة الوليّ», pn/messages.py, 28 Nov 2026; phase 2: closed)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/messages/{mid}/read":{"post":{"operationId":"post_messages_by_mid_read","tags":["Teacher–parent messages"],"summary":"{} 200 {id, read_at, changed} : stamps one message when the caller is its recipient side","x-pn-source":"platform/pn/messages.py mark_one()","description":"POST /api/messages/{mid}/read {} 200 {id, read_at, changed} : stamps one message when the caller is its recipient side","x-pn-doc":{"file":"platform/docs/API.md","section":"Teacher–parent messages («مراسلة الوليّ», pn/messages.py, 28 Nov 2026; phase 2: closed)"},"x-pn-cache":"no-store","parameters":[{"name":"mid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/metrics":{"get":{"operationId":"get_metrics","tags":["Ops"],"summary":"→ Prometheus text. Needs a platform_operator or engineer_viewer session (§11g) or Authorization: Bearer $PN_METRICS_T…","x-pn-source":"platform/pn/routes.py metrics()","description":"- GET /api/metrics → Prometheus text. Needs a platform_operator or engineer_viewer session (§11g) or Authorization: Bearer $PN_METRICS_TOKEN .","x-pn-doc":{"file":"platform/docs/API.md","section":"8. Ops"},"x-pn-permissions":["ops.metrics"],"x-pn-roles":["engineer_viewer","platform_operator"],"x-pn-mfa-ok":true,"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"Prometheus text exposition (PII-free counters, route templates only)","content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{"session":[]},{"metricsToken":[]}]}},"/api/n1/effects":{"post":{"operationId":"post_n1_effects","tags":["Single-case pool and plan records"],"summary":"teacher ( support.plan.write ) {adapt, domain, area, grade, design, est, se, n, v} only — any other key is 400 valida…","x-pn-source":"platform/pn/n1pool.py effects_post()","description":"POST /api/n1/effects teacher ( support.plan.write ) {adapt, domain, area, grade, design, est, se, n, v} only — any other key is 400 validation.unexpected_field (no day, rating, plan, code, name or text). Grade kept as a band. → 201 {id}","x-pn-doc":{"file":"platform/docs/API.md","section":"17. Single-case pool and plan records («ما ينجح لأطفال يشبهونه», pn/n1pool.py, 25 Nov 2026; flag PN_FEATURE_N1_POOL)"},"x-pn-permissions":["support.plan.write"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/n1/pool":{"get":{"operationId":"get_n1_pool","tags":["Single-case pool and plan records"],"summary":"support.plan.read , report.read or report.national {pool: {adapt: {n, mu, sdMu, tau, omega, predNew, cells: {\"domain …","x-pn-source":"platform/pn/n1pool.py pool_get()","description":"GET /api/n1/pool support.plan.read , report.read or report.national {pool: {adapt: {n, mu, sdMu, tau, omega, predNew, cells: {\"domain area band\": {n, m, sd, pred, pPos, raw}}}}, n, min_cell, model_version} ; cells under PN_MIN_CELL are left out; no school or region is returned","x-pn-doc":{"file":"platform/docs/API.md","section":"17. Single-case pool and plan records («ما ينجح لأطفال يشبهونه», pn/n1pool.py, 25 Nov 2026; flag PN_FEATURE_N1_POOL)"},"x-pn-permissions":["support.plan.read","report.read","report.national"],"x-pn-roles":["director","inspector","national_viewer","regional_admin","support_staff","teacher"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/n1/records/{pid}":{"get":{"operationId":"get_n1_records_by_pid","tags":["Single-case pool and plan records"],"summary":"the plan's teacher, or assigned support staff (needs PN_FEATURE_SUPPORT_PLANS too) {v, profile, trials, history, upda…","x-pn-source":"platform/pn/n1pool.py record_get()","description":"GET /api/n1/records/{pid} the plan's teacher, or assigned support staff (needs PN_FEATURE_SUPPORT_PLANS too) {v, profile, trials, history, updated_at} — the multi-year support record and the trials with their drawn schedules; audited n1.record.read","x-pn-doc":{"file":"platform/docs/API.md","section":"17. Single-case pool and plan records («ما ينجح لأطفال يشبهونه», pn/n1pool.py, 25 Nov 2026; flag PN_FEATURE_N1_POOL)"},"x-pn-permissions":["support.plan.read"],"x-pn-roles":["support_staff","teacher"],"x-pn-gate":["feature_support_plans"],"x-pn-no-etag":true,"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"put":{"operationId":"put_n1_records_by_pid","tags":["Single-case pool and plan records"],"summary":"the plan's teacher {v, profile, trials[, history]} ≤ 60 KB; without history the past years stay as they are (seed, ha…","x-pn-source":"platform/pn/n1pool.py record_put()","description":"PUT /api/n1/records/{pid} the plan's teacher {v, profile, trials[, history]} ≤ 60 KB; without history the past years stay as they are (seed, handover) → 204; audited n1.record.write","x-pn-doc":{"file":"platform/docs/API.md","section":"17. Single-case pool and plan records («ما ينجح لأطفال يشبهونه», pn/n1pool.py, 25 Nov 2026; flag PN_FEATURE_N1_POOL)"},"x-pn-permissions":["support.plan.write"],"x-pn-roles":["teacher"],"x-pn-gate":["feature_support_plans"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/notifications":{"get":{"operationId":"get_notifications","tags":["Me and notifications"],"summary":"→ items { \"id\", \"kind\", \"title_ar\", \"body_ar\", \"link\", \"created_at\", \"read_at\" } .","x-pn-source":"platform/pn/routes.py notif_list()","description":"- GET /api/notifications?unread=1&limit=20&cursor= → items { \"id\", \"kind\", \"title_ar\", \"body_ar\", \"link\", \"created_at\", \"read_at\" } .","x-pn-doc":{"file":"platform/docs/API.md","section":"4. Me and notifications"},"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"unread","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/notifications/read-all":{"post":{"operationId":"post_notifications_read_all","tags":["Me and notifications"],"summary":"→ 204 . POST /api/notifications/read-all → 204 .","x-pn-source":"platform/pn/routes.py notif_read_all()","description":"- POST /api/notifications/{id}/read → 204 . POST /api/notifications/read-all → 204 .","x-pn-doc":{"file":"platform/docs/API.md","section":"4. Me and notifications"},"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/notifications/unread-count":{"get":{"operationId":"get_notifications_unread_count","tags":["Me and notifications"],"summary":"→ { \"unread\": 3 } (cheap; poll every 30 to 60 s with If-None-Match ).","x-pn-source":"platform/pn/routes.py notif_count()","description":"- GET /api/notifications/unread-count → { \"unread\": 3 } (cheap; poll every 30 to 60 s with If-None-Match ).","x-pn-doc":{"file":"platform/docs/API.md","section":"4. Me and notifications"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/notifications/{nid}/read":{"post":{"operationId":"post_notifications_by_nid_read","tags":["Me and notifications"],"summary":"→ 204 . POST /api/notifications/read-all → 204 .","x-pn-source":"platform/pn/routes.py notif_read()","description":"- POST /api/notifications/{id}/read → 204 . POST /api/notifications/read-all → 204 .","x-pn-doc":{"file":"platform/docs/API.md","section":"4. Me and notifications"},"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/ops/alerts":{"get":{"operationId":"get_ops_alerts","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"ops.data pn.ops.alerts/2 : open + recently closed alerts, the rules","x-pn-source":"platform/pn/opsmon.py ops_alerts()","description":"GET /api/ops/alerts ops.data pn.ops.alerts/2 : open + recently closed alerts, the rules","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/ops/ingest/uploads":{"post":{"operationId":"post_ops_ingest_uploads","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"feed token ( Authorization: Bearer PN_VS_FEED_TOKEN ) or ops.ingest {kind, name, sha256, size} → 201 {upload_id, part…","x-pn-source":"platform/pn/opsmon.py up_create()","description":"POST /api/ops/ingest/uploads feed token ( Authorization: Bearer PN_VS_FEED_TOKEN ) or ops.ingest {kind, name, sha256, size} → 201 {upload_id, part_max_bytes}","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{},"name":{},"sha256":{},"size":{}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/ops/ingest/uploads/{uid}/complete":{"post":{"operationId":"post_ops_ingest_uploads_by_uid_complete","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"same sha256 + size checked ( 409 upload.checksum_mismatch ) → 202 {upload_id, queued_job, file} ; the drop folder imp…","x-pn-source":"platform/pn/opsmon.py up_complete()","description":"POST /api/ops/ingest/uploads/{uid}/complete same sha256 + size checked ( 409 upload.checksum_mismatch ) → 202 {upload_id, queued_job, file} ; the drop folder imports it","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"409":{"description":"upload.checksum_mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/ops/ingest/uploads/{uid}/parts/{n}":{"put":{"operationId":"put_ops_ingest_uploads_by_uid_parts_by_n","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"same raw bytes (≤ 8 MB), parts in order ( 409 upload.part_order ) → {upload_id, parts}","x-pn-source":"platform/pn/opsmon.py up_part()","description":"PUT /api/ops/ingest/uploads/{uid}/parts/{n} same raw bytes (≤ 8 MB), parts in order ( 409 upload.part_order ) → {upload_id, parts}","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"n","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"upload.part_order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/ops/live":{"get":{"operationId":"get_ops_live","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"ops.data Server-Sent Events, one event: stage per stage change of an app event ( id = rev; Last-Event-ID / ?since= re…","x-pn-source":"platform/pn/opsmon.py ops_live()","description":"GET /api/ops/live ops.data Server-Sent Events, one event: stage per stage change of an app event ( id = rev; Last-Event-ID / ?since= resumes; ?max_s ≤ 600, the client reconnects); payload pn.ops.live/2 (docs/ops-snapshots.md)","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"string"}},{"name":"max_s","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/ops/live/print":{"get":{"operationId":"get_ops_live_print","tags":["Ops"],"summary":"GET /api/ops/live/print","x-pn-source":"platform/pn/print_dispatch.py live()","x-pn-no-etag":true,"parameters":[{"name":"school","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/ops/live/recent":{"get":{"operationId":"get_ops_live_recent","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"ops.data {schema, events, count, next} : the same events as JSON ( ?since=<rev> ), for a projector without SSE","x-pn-source":"platform/pn/opsmon.py ops_live_recent()","description":"GET /api/ops/live/recent ops.data {schema, events, count, next} : the same events as JSON ( ?since=<rev> ), for a projector without SSE","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"string"}},{"name":"focus","in":"query","required":false,"schema":{"type":"string"}},{"name":"latest","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/ops/paper-metrics":{"get":{"operationId":"get_ops_paper_metrics","tags":["Ops"],"summary":"GET /api/ops/paper-metrics","x-pn-source":"platform/pn/print_dispatch.py paper_metrics()","x-pn-permissions":["ops.metrics"],"x-pn-roles":["engineer_viewer","platform_operator"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/ops/quality":{"get":{"operationId":"get_ops_quality","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"ops.data pn.ops.quality/2 : data-quality metrics per run, rejection threshold, reason codes","x-pn-source":"platform/pn/opsmon.py ops_quality()","description":"GET /api/ops/quality ops.data pn.ops.quality/2 : data-quality metrics per run, rejection threshold, reason codes","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/ops/registry":{"get":{"operationId":"get_ops_registry","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"ops.data pn.ops.registry/2 : the 5 models, every version, champion, metrics, drift","x-pn-source":"platform/pn/opsmon.py ops_registry()","description":"GET /api/ops/registry ops.data pn.ops.registry/2 : the 5 models, every version, champion, metrics, drift","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/ops/runs":{"get":{"operationId":"get_ops_runs","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"ops.data (platform operator, national viewer) pn.ops.runs/2 : import runs (newest first, ?limit ≤ 200) + freshness pe…","x-pn-source":"platform/pn/opsmon.py ops_runs()","description":"GET /api/ops/runs ops.data (platform operator, national viewer) pn.ops.runs/2 : import runs (newest first, ?limit ≤ 200) + freshness per source","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/ops/scoring":{"get":{"operationId":"get_ops_scoring","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"ops.data pn.ops.scoring/2 : event → score latency p50/p95/p99, live-day runs, bulk runs, score table sizes","x-pn-source":"platform/pn/opsmon.py ops_scoring()","description":"GET /api/ops/scoring ops.data pn.ops.scoring/2 : event → score latency p50/p95/p99, live-day runs, bulk runs, score table sizes","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/paper-activity":{"post":{"operationId":"post_paper_activity","tags":["Paper-activity"],"summary":"POST /api/paper-activity","x-pn-source":"platform/pn/print_dispatch.py record_activity()","parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{},"school":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/parent/child-plan":{"get":{"operationId":"get_parent_child_plan","tags":["Parent access"],"summary":"(parent; flag PN_PARENT_ENABLED , off by default)","x-pn-source":"platform/pn/routes.py parent_plan()","description":"GET /api/parent/child-plan (parent; flag PN_PARENT_ENABLED , off by default)","x-pn-doc":{"file":"platform/docs/API.md","section":"15. Parent access (phase 2: closed)"},"x-pn-permissions":["child.plan.read"],"x-pn-roles":["parent"],"x-pn-gate":["parent_enabled"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/plans":{"get":{"operationId":"get_plans","tags":["Plans"],"summary":"teacher (own), director (school), inspector (region) Without school_id : everything the caller may see","x-pn-source":"platform/pn/routes.py plans_list()","description":"GET /api/plans?school_id=&status=&limit=&cursor= teacher (own), director (school), inspector (region) Without school_id : everything the caller may see","x-pn-doc":{"file":"platform/docs/API.md","section":"5. Plans (sample school-scoped resource, no pupil data)"},"x-pn-permissions":["plan.read"],"x-pn-roles":["director","inspector","teacher"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"school_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_plans","tags":["Plans"],"summary":"teacher Body {title, subject, grade, week_start, due_date} → 201","x-pn-source":"platform/pn/routes.py plans_create()","description":"POST /api/plans teacher Body {title, subject, grade, week_start, due_date} → 201","x-pn-doc":{"file":"platform/docs/API.md","section":"5. Plans (sample school-scoped resource, no pupil data)"},"x-pn-permissions":["plan.create"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"due_date":{"type":"string","format":"date"},"grade":{"type":"integer","minimum":1,"maximum":6},"school_id":{},"subject":{"type":"string","minLength":2,"maxLength":5},"title":{"type":"string","minLength":3,"maxLength":160},"week_start":{"type":"string","format":"date"}},"required":["due_date","grade","subject","title","week_start"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/plans/{pid}":{"get":{"operationId":"get_plans_by_pid","tags":["Plans"],"summary":"as list Out of scope → 404 not_found (not 403: no existence leak)","x-pn-source":"platform/pn/routes.py plans_get()","description":"GET /api/plans/{id} as list Out of scope → 404 not_found (not 403: no existence leak)","x-pn-doc":{"file":"platform/docs/API.md","section":"5. Plans (sample school-scoped resource, no pupil data)"},"x-pn-permissions":["plan.read"],"x-pn-roles":["director","inspector","teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"patch":{"operationId":"patch_plans_by_pid","tags":["Plans"],"summary":"owner teacher; director may set reviewed If-Match recommended → 412 if stale","x-pn-source":"platform/pn/routes.py plans_patch()","description":"PATCH /api/plans/{id} owner teacher; director may set reviewed If-Match recommended → 412 if stale","x-pn-doc":{"file":"platform/docs/API.md","section":"5. Plans (sample school-scoped resource, no pupil data)"},"x-pn-permissions":["plan.update","plan.create"],"x-pn-roles":["director","teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"due_date":{"type":"string","format":"date"},"grade":{"type":"integer","minimum":1,"maximum":6},"status":{"type":"string","minLength":4,"maxLength":10,"enum":["draft","submitted","reviewed"]},"subject":{"type":"string","minLength":2,"maxLength":5},"title":{"type":"string","minLength":3,"maxLength":160},"week_start":{"type":"string","format":"date"}},"required":["due_date","grade","subject","title","week_start"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"precondition.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/plans/{pid}/comments":{"get":{"operationId":"get_plans_by_pid_comments","tags":["Plans"],"summary":", POST {body} inspector, director (write); owner (read) Creates an inspector_comment notification","x-pn-source":"platform/pn/routes.py comments_list()","description":"GET /api/plans/{id}/comments , POST {body} inspector, director (write); owner (read) Creates an inspector_comment notification","x-pn-doc":{"file":"platform/docs/API.md","section":"5. Plans (sample school-scoped resource, no pupil data)"},"x-pn-permissions":["plan.read"],"x-pn-roles":["director","inspector","teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_plans_by_pid_comments","tags":["Plans"],"summary":", POST {body} inspector, director (write); owner (read) Creates an inspector_comment notification","x-pn-source":"platform/pn/routes.py comments_create()","description":"GET /api/plans/{id}/comments , POST {body} inspector, director (write); owner (read) Creates an inspector_comment notification","x-pn-doc":{"file":"platform/docs/API.md","section":"5. Plans (sample school-scoped resource, no pupil data)"},"x-pn-permissions":["plan.comment"],"x-pn-roles":["director","inspector"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":2000}},"required":["body"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/print-agent/claim":{"post":{"operationId":"post_print_agent_claim","tags":["Print-agent"],"summary":"POST /api/print-agent/claim","x-pn-source":"platform/pn/print_dispatch.py claim()","x-pn-no-etag":true,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"claim":{},"school":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"422":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/print-agent/report":{"post":{"operationId":"post_print_agent_report","tags":["Print-agent"],"summary":"POST /api/print-agent/report","x-pn-source":"platform/pn/print_dispatch.py report()","x-pn-no-etag":true,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"claim":{},"state":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"409":{"description":"print_pack.claim","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/print-packs":{"get":{"operationId":"get_print_packs","tags":["School print packs"],"summary":"lists the teacher's or school's print packs.","x-pn-source":"platform/pn/print_packs.py listing()","description":"- GET /api/print-packs lists the teacher's or school's print packs.","x-pn-doc":{"file":"platform/docs/API.md","section":"School print packs"},"x-pn-no-etag":true,"parameters":[{"name":"role","in":"query","required":false,"schema":{"type":"string"}},{"name":"week","in":"query","required":false,"schema":{"type":"string"}},{"name":"school","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_print_packs","tags":["School print packs"],"summary":"submits a teacher's print pack.","x-pn-source":"platform/pn/print_packs.py send()","description":"- POST /api/print-packs submits a teacher's print pack.","x-pn-doc":{"file":"platform/docs/API.md","section":"School print packs"},"x-pn-no-etag":true,"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{},"pages":{},"school":{},"week":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"idempotency.key_reused, print_pack.unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"payload.too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/print-packs/approval":{"post":{"operationId":"post_print_packs_approval","tags":["Director decisions"],"summary":"approves or withdraws approval for selected pending packs. Documents and print confirmation require approval.","x-pn-source":"platform/pn/print_packs.py approval()","description":"- POST /api/print-packs/approval approves or withdraws approval for selected pending packs. Documents and print confirmation require approval.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"print_pack.printer_unavailable, print_pack.unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/print-packs/confirm":{"post":{"operationId":"post_print_packs_confirm","tags":["School print packs"],"summary":"marks selected packs as printed and clears their document bodies.","x-pn-source":"platform/pn/print_packs.py confirm()","description":"- POST /api/print-packs/confirm marks selected packs as printed and clears their document bodies.","x-pn-doc":{"file":"platform/docs/API.md","section":"School print packs"},"x-pn-no-etag":true,"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"print_pack.unavailable, print_pack.approval_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/print-packs/documents":{"post":{"operationId":"post_print_packs_documents","tags":["School print packs"],"summary":"loads documents for selected packs in the director's school.","x-pn-source":"platform/pn/print_packs.py documents()","description":"- POST /api/print-packs/documents loads documents for selected packs in the director's school.","x-pn-doc":{"file":"platform/docs/API.md","section":"School print packs"},"x-pn-no-etag":true,"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"print_pack.unavailable, print_pack.approval_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/print-packs/ready":{"post":{"operationId":"post_print_packs_ready","tags":["Print-packs"],"summary":"POST /api/print-packs/ready","x-pn-source":"platform/pn/print_dispatch.py ready()","x-pn-no-etag":true,"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"print_pack.unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/region/circles/indicators":{"get":{"operationId":"get_region_circles_indicators","tags":["Teacher circles, coaching cycles, lesson study, indicators"],"summary":"regional administration ( aggregate.read , region scope) Same shape for the whole region (all inspectors' training days)","x-pn-source":"platform/pn/circles.py ind_region()","description":"GET /api/region/circles/indicators regional administration ( aggregate.read , region scope) Same shape for the whole region (all inspectors' training days)","x-pn-doc":{"file":"platform/docs/API.md","section":"11e. Teacher circles, coaching cycles, lesson study, indicators (24 Nov 2026, phase 2; strategy moves 4 and 9)"},"x-pn-permissions":["aggregate.read"],"x-pn-roles":["director","inspector","regional_admin"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/region/programme-load":{"get":{"operationId":"get_region_programme_load","tags":["Teacher workspace and sync"],"summary":"(«حجم البرنامج في الواقع», 24 Nov 2026)","x-pn-source":"platform/pn/routes.py programme_load()","description":"GET /api/region/programme-load?year=2026-2027[&scope=region:<id>] («حجم البرنامج في الواقع», 24 Nov 2026)","x-pn-doc":{"file":"platform/docs/API.md","section":"11. Teacher workspace and sync (22 Nov 2026, phase 1)"},"x-pn-permissions":["report.read","report.national"],"x-pn-roles":["director","inspector","national_viewer","regional_admin"],"parameters":[{"name":"year","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied, access.scope_mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/school/classes":{"get":{"operationId":"get_school_classes","tags":["Class rosters and class records"],"summary":"(director, his school)","x-pn-source":"platform/pn/classes.py school_classes()","description":"GET /api/school/classes[?school=<id>] (director, his school)","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class rosters and class records («قسمي» on the server; phase 2: closed, 25 Nov 2026)"},"x-pn-permissions":["classes.school.read"],"x-pn-roles":["director"],"parameters":[{"name":"school","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/school/guardian-invites":{"get":{"operationId":"get_school_guardian_invites","tags":["Family"],"summary":"director: 200 {invites:[{id, school_id, child, class_label, from:{name, relationship, relationship_ar}, invitee:{name…","x-pn-source":"platform/pn/guardians.py invites()","description":"GET /api/school/guardian-invites — director: 200 {invites:[{id, school_id, child, class_label, from:{name, relationship, relationship_ar}, invitee:{name, relationship, relationship_ar}, created_at, expires_at}]} (accepted, awaiting decision)","x-pn-doc":{"file":"platform/docs/API.md","section":"Family (guardians): both guardians share the child's space (pn/guardians.py, 28 Nov 2026; phase 2: closed)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/school/guardian-invites/{iid}/decision":{"post":{"operationId":"post_school_guardian_invites_by_iid_decision","tags":["Family"],"summary":"{confirm: bool} 200 {id, status:\"confirmed\" \"declined\", link_id?} ; confirm creates the verified link and the parent …","x-pn-source":"platform/pn/guardians.py decide()","description":"POST /api/school/guardian-invites/{iid}/decision {confirm: bool} 200 {id, status:\"confirmed\" \"declined\", link_id?} ; confirm creates the verified link and the parent role at the school; 409 family.invite_state when not awaiting","x-pn-doc":{"file":"platform/docs/API.md","section":"Family (guardians): both guardians share the child's space (pn/guardians.py, 28 Nov 2026; phase 2: closed)"},"x-pn-cache":"no-store","parameters":[{"name":"iid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean"}},"required":["confirm"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"family.invite_state, family.already_linked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/school/report":{"get":{"operationId":"get_school_report","tags":["Teacher workspace and sync"],"summary":"region:<id>]","x-pn-source":"platform/pn/routes.py school_report()","description":"GET /api/school/report?year=2026-2027[&scope=school:<id> region:<id>]","x-pn-doc":{"file":"platform/docs/API.md","section":"11. Teacher workspace and sync (22 Nov 2026, phase 1)"},"x-pn-permissions":["report.national","report.read"],"x-pn-roles":["director","inspector","national_viewer","regional_admin"],"parameters":[{"name":"year","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/school/roster":{"get":{"operationId":"get_school_roster","tags":["Lesson-prep journal, shares with the inspector, reviews, visits, school roster"],"summary":"director (own school) Staff by role (الإدارة، المعلّمون، مرافقو الدعم) with classes and subjects of the timetable. No…","x-pn-source":"platform/pn/journal.py school_roster()","description":"GET /api/school/roster director (own school) Staff by role (الإدارة، المعلّمون، مرافقو الدعم) with classes and subjects of the timetable. No performance, no sync state","x-pn-doc":{"file":"platform/docs/API.md","section":"11b. Lesson-prep journal, shares with the inspector, reviews, visits, school roster (22 Nov 2026, phase 1)"},"x-pn-permissions":["school.roster"],"x-pn-roles":["director"],"parameters":[{"name":"school_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/school/shares":{"get":{"operationId":"get_school_shares","tags":["«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts"],"summary":"(teacher) «من زملائك»: items of colleagues of her school, newest first, with reused / thanked for HER only.","x-pn-source":"platform/pn/recognition.py colleagues()","description":"- GET /api/school/shares (teacher) «من زملائك»: items of colleagues of her school, newest first, with reused / thanked for HER only.","x-pn-doc":{"file":"platform/docs/API.md","section":"«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts (pn/recognition.py, 28 Nov 2026)"},"x-pn-permissions":["school.share"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_school_shares","tags":["«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts"],"summary":"(teacher) {kind:'fiche' 'adapted', item:<fiche fields>, profile?, edits?, school_id?} → 201 (200 when shared again: u…","x-pn-source":"platform/pn/recognition.py share()","description":"- POST /api/school/shares (teacher) {kind:'fiche' 'adapted', item:<fiche fields>, profile?, edits?, school_id?} → 201 (200 when shared again: updated). Extra fields → 400.","x-pn-doc":{"file":"platform/docs/API.md","section":"«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts (pn/recognition.py, 28 Nov 2026)"},"x-pn-permissions":["school.share"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/school/shares/{shid}":{"get":{"operationId":"get_school_shares_by_shid","tags":["«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts"],"summary":"(teacher, same school; else 404) the item.","x-pn-source":"platform/pn/recognition.py one()","description":"- GET /api/school/shares/{shid} (teacher, same school; else 404) the item.","x-pn-doc":{"file":"platform/docs/API.md","section":"«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts (pn/recognition.py, 28 Nov 2026)"},"x-pn-permissions":["school.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"shid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_school_shares_by_shid","tags":["«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts"],"summary":"(the author) the item and its events are deleted.","x-pn-source":"platform/pn/recognition.py withdraw()","description":"- DELETE /api/school/shares/{shid} (the author) the item and its events are deleted.","x-pn-doc":{"file":"platform/docs/API.md","section":"«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts (pn/recognition.py, 28 Nov 2026)"},"x-pn-permissions":["school.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"shid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/school/shares/{shid}/reuse":{"post":{"operationId":"post_school_shares_by_shid_reuse","tags":["«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts"],"summary":"(teacher, same school; 409 on her own) → the item; once per colleague.","x-pn-source":"platform/pn/recognition.py reuse()","description":"- POST /api/school/shares/{shid}/reuse (teacher, same school; 409 on her own) → the item; once per colleague.","x-pn-doc":{"file":"platform/docs/API.md","section":"«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts (pn/recognition.py, 28 Nov 2026)"},"x-pn-permissions":["school.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"shid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/school/shares/{shid}/thanks":{"post":{"operationId":"post_school_shares_by_shid_thanks","tags":["«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts"],"summary":"(teacher, same school; 409 on her own) once per colleague.","x-pn-source":"platform/pn/recognition.py thanks()","description":"- POST /api/school/shares/{shid}/thanks (teacher, same school; 409 on her own) once per colleague.","x-pn-doc":{"file":"platform/docs/API.md","section":"«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts (pn/recognition.py, 28 Nov 2026)"},"x-pn-permissions":["school.share"],"x-pn-roles":["teacher"],"parameters":[{"name":"shid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{school}/support-summary":{"get":{"operationId":"get_schools_by_school_support_summary","tags":["Support plans and pupil-level ML"],"summary":"Scoped school director with support.aggregate.read . Returns the school's support progress summary.","x-pn-source":"platform/pn/support.py school_summary()","description":"GET /api/schools/{school}/support-summary Scoped school director with support.aggregate.read . Returns the school's support progress summary.","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.aggregate.read"],"x-pn-roles":["director","inspector","regional_admin"],"x-pn-no-etag":true,"parameters":[{"name":"school","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/class-assignment-requests":{"get":{"operationId":"get_schools_by_sid_class_assignment_requests","tags":["Official class assignments for attendance counts"],"summary":"Director. List pending requests for the school.","x-pn-source":"platform/pn/classes.py list_requests()","description":"GET /api/schools/{sid}/class-assignment-requests Director. List pending requests for the school.","x-pn-doc":{"file":"platform/docs/API.md","section":"Official class assignments for attendance counts"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_schools_by_sid_class_assignment_requests","tags":["Official class assignments for attendance counts"],"summary":"Teacher. Submit the complete requested class_codes array. A new request replaces the pending one. An empty list reque…","x-pn-source":"platform/pn/classes.py request_assignment()","description":"POST /api/schools/{sid}/class-assignment-requests Teacher. Submit the complete requested class_codes array. A new request replaces the pending one. An empty list requests removal of all assignments.","x-pn-doc":{"file":"platform/docs/API.md","section":"Official class assignments for attendance counts"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"class_codes":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/class-assignment-requests/{rid}/confirm":{"post":{"operationId":"post_schools_by_sid_class_assignment_requests_by_rid_confirm","tags":["Official class assignments for attendance counts"],"summary":"Director. Confirm the exact pending request, replace the teacher's official roster and record classes.assignment.conf…","x-pn-source":"platform/pn/classes.py confirm_assignment()","description":"POST /api/schools/{sid}/class-assignment-requests/{rid}/confirm Director. Confirm the exact pending request, replace the teacher's official roster and record classes.assignment.confirm in the audit log.","x-pn-doc":{"file":"platform/docs/API.md","section":"Official class assignments for attendance counts"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"class_codes":{},"review_revision":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"classes.assignment.review_changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/class-assignment-requests/{rid}/undo":{"post":{"operationId":"post_schools_by_sid_class_assignment_requests_by_rid_undo","tags":["Director decisions"],"summary":"restores the previous roster and reopens the request unless a newer request already exists. Confirmation accepts opti…","x-pn-source":"platform/pn/classes.py undo_assignment()","description":"- POST /api/schools/{sid}/class-assignment-requests/{rid}/undo restores the previous roster and reopens the request unless a newer request already exists. Confirmation accepts optional adjusted class codes.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teacher_id":{"type":"string","minLength":1,"maxLength":80}},"required":["teacher_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"classes.assignment.review_changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/delegations":{"get":{"operationId":"get_schools_by_sid_delegations","tags":["Class continuity"],"summary":"list eligible rosters, teachers and assignments for the school.","x-pn-source":"platform/pn/continuity.py management()","description":"- GET /api/schools/{sid}/delegations — list eligible rosters, teachers and assignments for the school.","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["continuity.manage"],"x-pn-roles":["director"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_schools_by_sid_delegations","tags":["Class continuity"],"summary":"assign a teacher with roster_id , delegate_id , starts , mode ( substitute or replacement ), decision_ref for the sch…","x-pn-source":"platform/pn/continuity.py create()","description":"- POST /api/schools/{sid}/delegations — assign a teacher with roster_id , delegate_id , starts , mode ( substitute or replacement ), decision_ref for the school decision, and ends for a substitute.","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["continuity.manage"],"x-pn-roles":["director"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision_ref":{"type":"string","minLength":3,"maxLength":120},"delegate_id":{"type":"string","minLength":1,"maxLength":80},"ends":{"type":"string","format":"date"},"mode":{"type":"string","minLength":1,"maxLength":16,"enum":["substitute","replacement"]},"roster_id":{"type":"string","minLength":1,"maxLength":80},"starts":{"type":"string","format":"date"}},"required":["decision_ref","delegate_id","mode","roster_id","starts"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"continuity.assignment_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/delegations/{did}":{"delete":{"operationId":"delete_schools_by_sid_delegations_by_did","tags":["Class continuity"],"summary":"revoke an assignment.","x-pn-source":"platform/pn/continuity.py revoke()","description":"- DELETE /api/schools/{sid}/delegations/{did} — revoke an assignment.","x-pn-doc":{"file":"platform/docs/API.md","section":"16. Class continuity"},"x-pn-permissions":["continuity.manage"],"x-pn-roles":["director"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"did","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/director":{"get":{"operationId":"get_schools_by_sid_director","tags":["Director decisions"],"summary":"returns the school's schedule and decision records to a director assigned to that school.","x-pn-source":"platform/pn/director.py workspace()","description":"- GET /api/schools/{sid}/director returns the school's schedule and decision records to a director assigned to that school.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/director/announcement":{"patch":{"operationId":"patch_schools_by_sid_director_announcement","tags":["Director decisions"],"summary":"replaces the parent's current school announcement using its revision. An empty text withdraws it. The director can al…","x-pn-source":"platform/pn/director.py announcement()","description":"- PATCH /api/schools/{sid}/director/announcement replaces the parent's current school announcement using its revision. An empty text withdraws it. The director can also open the saved announcement in the device SMS composer.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":0,"maxLength":480}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"director.changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/director/comments":{"post":{"operationId":"post_schools_by_sid_director_comments","tags":["Director decisions"],"summary":"creates a comment against a teacher's week and notifies the teacher. PATCH /api/schools/{sid}/director/comments/{key}…","x-pn-source":"platform/pn/director.py comment()","description":"- POST /api/schools/{sid}/director/comments creates a comment against a teacher's week and notifies the teacher. PATCH /api/schools/{sid}/director/comments/{key} and DELETE /api/schools/{sid}/director/comments/{key} allow the author to edit and delete it.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teacher_id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":400},"week":{"type":"string","format":"date"}},"required":["teacher_id","text","week"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"director.changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/director/comments/{key}":{"patch":{"operationId":"patch_schools_by_sid_director_comments_by_key","tags":["Director decisions"],"summary":"creates a comment against a teacher's week and notifies the teacher. PATCH /api/schools/{sid}/director/comments/{key}…","x-pn-source":"platform/pn/director.py comment()","description":"- POST /api/schools/{sid}/director/comments creates a comment against a teacher's week and notifies the teacher. PATCH /api/schools/{sid}/director/comments/{key} and DELETE /api/schools/{sid}/director/comments/{key} allow the author to edit and delete it.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teacher_id":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":400},"week":{"type":"string","format":"date"}},"required":["teacher_id","text","week"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"director.changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_schools_by_sid_director_comments_by_key","tags":["Director decisions"],"summary":"creates a comment against a teacher's week and notifies the teacher. PATCH /api/schools/{sid}/director/comments/{key}…","x-pn-source":"platform/pn/director.py comment()","description":"- POST /api/schools/{sid}/director/comments creates a comment against a teacher's week and notifies the teacher. PATCH /api/schools/{sid}/director/comments/{key} and DELETE /api/schools/{sid}/director/comments/{key} allow the author to edit and delete it.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"director.changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/director/messages/{key}/reply":{"post":{"operationId":"post_schools_by_sid_director_messages_by_key_reply","tags":["Director decisions"],"summary":"replies to a sender in the school. POST /api/bullying/reports/{id}/reply replies to the report's linked parent and se…","x-pn-source":"platform/pn/director.py reply()","description":"- POST /api/schools/{sid}/director/messages/{key}/reply replies to a sender in the school. POST /api/bullying/reports/{id}/reply replies to the report's linked parent and sends an in-platform notification.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":600}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/director/slots/{key}":{"patch":{"operationId":"patch_schools_by_sid_director_slots_by_key","tags":["Director decisions"],"summary":"checks a proposed room and time against overlapping teacher, class, and room bookings. PATCH /api/schools/{sid}/direc…","x-pn-source":"platform/pn/director.py edit_slot()","description":"- POST /api/schools/{sid}/director/slots/{key}/preview checks a proposed room and time against overlapping teacher, class, and room bookings. PATCH /api/schools/{sid}/director/slots/{key} rechecks the revision and conflicts before saving the change.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"revision":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"director.changed, director.timetable_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/director/slots/{key}/preview":{"post":{"operationId":"post_schools_by_sid_director_slots_by_key_preview","tags":["Director decisions"],"summary":"checks a proposed room and time against overlapping teacher, class, and room bookings. PATCH /api/schools/{sid}/direc…","x-pn-source":"platform/pn/director.py edit_slot()","description":"- POST /api/schools/{sid}/director/slots/{key}/preview checks a proposed room and time against overlapping teacher, class, and room bookings. PATCH /api/schools/{sid}/director/slots/{key} rechecks the revision and conflicts before saving the change.","x-pn-doc":{"file":"platform/docs/API.md","section":"Director decisions"},"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"revision":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"director.changed, director.timetable_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/inclusive/summary":{"get":{"operationId":"get_schools_by_sid_inclusive_summary","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"the headmaster's counts: pupils, classes, pending, validated.","x-pn-source":"platform/pn/inclusive.py summary()","description":"- GET /api/schools/{sid}/inclusive/summary the headmaster's counts: pupils, classes, pending, validated.","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["inclusive.school"],"x-pn-roles":["director"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/measures/{code}":{"get":{"operationId":"get_schools_by_sid_measures_by_code","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"stage 2: the measures and exam measures (teacher, inspector of the region); the categories and the report's existence…","x-pn-source":"platform/pn/inclusive.py read_measures()","description":"- GET /api/schools/{sid}/measures/{code} stage 2: the measures and exam measures (teacher, inspector of the region); the categories and the report's existence for the headmaster only.","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["measures.read"],"x-pn-roles":["director","inspector","teacher"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"put":{"operationId":"put_schools_by_sid_measures_by_code","tags":["Document 06 · مدرسة دامجة: presentation profiles and exceptional measures"],"summary":"stage 2 (PN_FEATURE_EXCEPTIONAL_MEASURES): the headmaster records the ticked categories, the measures m1–m7 of note 1…","x-pn-source":"platform/pn/inclusive.py record_measures()","description":"- PUT /api/schools/{sid}/measures/{code} stage 2 (PN_FEATURE_EXCEPTIONAL_MEASURES): the headmaster records the ticked categories, the measures m1–m7 of note 17597, the exam measures, the report's date and specialist type, and the consent date. A report file is refused.","x-pn-doc":{"file":"platform/docs/API.md","section":"Document 06 · مدرسة دامجة: presentation profiles and exceptional measures (pn/inclusive.py, 28 Nov 2026)"},"x-pn-permissions":["measures.record"],"x-pn-roles":["director"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"code","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/office/documents":{"get":{"operationId":"get_schools_by_sid_office_documents","tags":["Schools"],"summary":"GET /api/schools/{sid}/office/documents","x-pn-source":"platform/pn/school_office.py listing()","parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_schools_by_sid_office_documents","tags":["Schools"],"summary":"POST /api/schools/{sid}/office/documents","x-pn-source":"platform/pn/school_office.py create()","parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"direction":{},"doc_date":{},"fields":{},"id":{},"image":{},"kind":{},"text":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"office.id_taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/office/documents/{did}":{"get":{"operationId":"get_schools_by_sid_office_documents_by_did","tags":["Schools"],"summary":"GET /api/schools/{sid}/office/documents/{did}","x-pn-source":"platform/pn/school_office.py one()","parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"did","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"patch":{"operationId":"patch_schools_by_sid_office_documents_by_did","tags":["Schools"],"summary":"PATCH /api/schools/{sid}/office/documents/{did}","x-pn-source":"platform/pn/school_office.py edit()","parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"did","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"direction":{},"doc_date":{},"fields":{},"revision":{},"text":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"office.medical_locked, office.changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"office.medical_refused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_schools_by_sid_office_documents_by_did","tags":["Schools"],"summary":"DELETE /api/schools/{sid}/office/documents/{did}","x-pn-source":"platform/pn/school_office.py remove()","parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"did","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/recognition":{"get":{"operationId":"get_schools_by_sid_recognition","tags":["«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts"],"summary":"(director, his school) {shared, progress:{improved, by_domain} null} : counts only. progress comes from the class rec…","x-pn-source":"platform/pn/recognition.py counts()","description":"- GET /api/schools/{sid}/recognition[?month=YYYY-MM] (director, his school) {shared, progress:{improved, by_domain} null} : counts only. progress comes from the class records (§16, PN_FEATURE_PUPIL_RECORDS ): a pupil improved when, in one domain, a criterion level (or the reading text level) recorde","x-pn-doc":{"file":"platform/docs/API.md","section":"«من المدرسة»: shared work between colleagues of one school, and the headmaster's counts (pn/recognition.py, 28 Nov 2026)"},"x-pn-permissions":["school.share.counts"],"x-pn-roles":["director"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"month","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/team":{"get":{"operationId":"get_schools_by_sid_team","tags":["School team"],"summary":"lists teachers, with optional q filtering name, username, subjects, and class codes. Each row includes school contact…","x-pn-source":"platform/pn/school_team.py list_team()","description":"- GET /api/schools/{sid}/team lists teachers, with optional q filtering name, username, subjects, and class codes. Each row includes school contact details, the internal teaching role, official class codes, active / invited / suspended status, leave history, and a revision for confirmation.","x-pn-doc":{"file":"platform/docs/API.md","section":"School team"},"x-pn-permissions":["school.team.manage"],"x-pn-roles":["director"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_schools_by_sid_team","tags":["School team"],"summary":"provisions an invited teacher and a teacher role assignment for this school. Supply username , display_name , and opt…","x-pn-source":"platform/pn/school_team.py create_teacher()","description":"- POST /api/schools/{sid}/team provisions an invited teacher and a teacher role assignment for this school. Supply username , display_name , and optionally subjects , class_codes , phone , email , and internal_role . Returns 201 with the new user ID and a single-use invite containing token , url , a","x-pn-doc":{"file":"platform/docs/API.md","section":"School team"},"x-pn-permissions":["school.team.manage"],"x-pn-roles":["director"],"x-pn-credential-response":true,"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"class_codes":{"type":"array","items":{"type":"string"},"uniqueItems":true,"maxItems":60},"decision_ref":{"type":"string","minLength":3,"maxLength":120},"display_name":{"type":"string","minLength":1,"maxLength":80},"email":{"type":"string","minLength":0,"maxLength":160},"internal_role":{"type":"string","minLength":1,"maxLength":30},"phone":{"type":"string","minLength":0,"maxLength":32},"subjects":{"type":"array","items":{"type":"string"},"uniqueItems":true,"maxItems":60},"username":{"type":"string","minLength":3,"maxLength":40}},"required":["decision_ref","display_name","username"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"conflict.username_taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/team/{uid}":{"patch":{"operationId":"patch_schools_by_sid_team_by_uid","tags":["School team"],"summary":"accepts the reviewed revision and any editable fields from the create request except username . Stale reviews return …","x-pn-source":"platform/pn/school_team.py edit_teacher()","description":"- PATCH /api/schools/{sid}/team/{uid} accepts the reviewed revision and any editable fields from the create request except username . Stale reviews return 409 school.team.review_changed . Internal roles are teacher , substitute , physical_education , and other . They are school display labels. Class","x-pn-doc":{"file":"platform/docs/API.md","section":"School team"},"x-pn-permissions":["school.team.manage"],"x-pn-roles":["director"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"class_codes":{"type":"array","items":{"type":"string"},"uniqueItems":true,"maxItems":60},"display_name":{"type":"string","minLength":1,"maxLength":80},"email":{"type":"string","minLength":0,"maxLength":160},"internal_role":{"type":"string","minLength":1,"maxLength":30},"phone":{"type":"string","minLength":0,"maxLength":32},"revision":{"type":"string","minLength":64,"maxLength":64},"subjects":{"type":"array","items":{"type":"string"},"uniqueItems":true,"maxItems":60}},"required":["revision"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"school.team.review_changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/team/{uid}/invite":{"post":{"operationId":"post_schools_by_sid_team_by_uid_invite","tags":["School team"],"summary":"accepts action of resend or reset . Resend replaces a pending invite. Reset requires a new password through invite ac…","x-pn-source":"platform/pn/school_team.py renew_invite()","description":"- POST /api/schools/{sid}/team/{uid}/invite accepts action of resend or reset . Resend replaces a pending invite. Reset requires a new password through invite acceptance, invalidates the old password and sessions, and queues an account notice. The response includes the same one-time credentials as c","x-pn-doc":{"file":"platform/docs/API.md","section":"School team"},"x-pn-permissions":["school.team.manage"],"x-pn-roles":["director"],"x-pn-credential-response":true,"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","minLength":1,"maxLength":10,"enum":["resend","reset"]}},"required":["action"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"school.team.account_state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/team/{uid}/leave":{"post":{"operationId":"post_schools_by_sid_team_by_uid_leave","tags":["School team"],"summary":"accepts revision , reason of transfer or leave , and starts on or after today. Leave also requires an inclusive ends …","x-pn-source":"platform/pn/school_team.py schedule_leave()","description":"- POST /api/schools/{sid}/team/{uid}/leave accepts revision , reason of transfer or leave , and starts on or after today. Leave also requires an inclusive ends date. When classes are assigned, provide an active same-school delegate_id . Continuity must be enabled. The handover uses existing pupil ro","x-pn-doc":{"file":"platform/docs/API.md","section":"School team"},"x-pn-permissions":["school.team.manage"],"x-pn-roles":["director"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision_ref":{"type":"string","minLength":3,"maxLength":120},"delegate_id":{"type":"string","minLength":1,"maxLength":80},"ends":{"type":"string","format":"date"},"reason":{"type":"string","minLength":1,"maxLength":10,"enum":["transfer","leave"]},"revision":{"type":"string","minLength":64,"maxLength":64},"starts":{"type":"string","format":"date"}},"required":["decision_ref","reason","revision","starts"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"school.team.review_changed, school.team.account_state, school.team.leave_overlap, continuity.overlap, school.team.roster_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/schools/{sid}/team/{uid}/leave/{lid}/undo":{"post":{"operationId":"post_schools_by_sid_team_by_uid_leave_by_lid_undo","tags":["School team"],"summary":"cancels a scheduled or current suspension and revokes its linked cover. The original decision and cancellation remain…","x-pn-source":"platform/pn/school_team.py undo_leave()","description":"- POST /api/schools/{sid}/team/{uid}/leave/{lid}/undo cancels a scheduled or current suspension and revokes its linked cover. The original decision and cancellation remain in history.","x-pn-doc":{"file":"platform/docs/API.md","section":"School team"},"x-pn-permissions":["school.team.manage"],"x-pn-roles":["director"],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"uid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"lid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"school.team.leave_closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/scores/class":{"get":{"operationId":"get_scores_class","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"scores.class (teacher, her own class: ?class= ) {class, pace, needs_you: [{pupil, rti_tier, support, reasons, skills}…","x-pn-source":"platform/pn/scores_api.py scores_class()","description":"GET /api/scores/class scores.class (teacher, her own class: ?class= ) {class, pace, needs_you: [{pupil, rti_tier, support, reasons, skills}], remediation, pupils_scored, meta} — pupils by the app's own ids","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","parameters":[{"name":"class","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/scores/national":{"get":{"operationId":"get_scores_national","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"scores.national (national viewer) {governorates: [{gov, schools, pupils, ew_mean, high_share, gov_prior}], min_cell, …","x-pn-source":"platform/pn/scores_api.py scores_national()","description":"GET /api/scores/national scores.national (national viewer) {governorates: [{gov, schools, pupils, ew_mean, high_share, gov_prior}], min_cell, limits, meta} — no school named","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-permissions":["scores.national"],"x-pn-roles":["national_viewer"],"x-pn-no-etag":true,"x-pn-cache":"no-store","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/scores/pupil":{"get":{"operationId":"get_scores_pupil","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"scores.class ( ?class=&pupil= ) {pupil, signal, skills, next_step: {code, subject, why}, meta}","x-pn-source":"platform/pn/scores_api.py scores_pupil()","description":"GET /api/scores/pupil scores.class ( ?class=&pupil= ) {pupil, signal, skills, next_step: {code, subject, why}, meta}","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","parameters":[{"name":"class","in":"query","required":false,"schema":{"type":"string"}},{"name":"pupil","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/scores/school":{"get":{"operationId":"get_scores_school","tags":["Data + ML pipeline: ops API, export upload, live scores"],"summary":"scores.school (director, his school) {school_id, classes: [tiles], support: {by_tier, reasons}, risk: {n_pupils, ew_m…","x-pn-source":"platform/pn/scores_api.py scores_school()","description":"GET /api/scores/school scores.school (director, his school) {school_id, classes: [tiles], support: {by_tier, reasons}, risk: {n_pupils, ew_mean, high_share, gov_prior, limits}, meta}","x-pn-doc":{"file":"platform/docs/API.md","section":"18. Data + ML pipeline: ops API, export upload, live scores (28 Nov 2026; flag PN_FEATURE_WAREHOUSE)"},"x-pn-no-etag":true,"x-pn-cache":"no-store","parameters":[{"name":"school","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/sms/contacts":{"get":{"operationId":"get_sms_contacts","tags":["SMS to parents through a school gateway"],"summary":"teacher (own) masked numbers, consent, opted_out","x-pn-source":"platform/pn/sms.py sms_contact_list()","description":"GET /api/sms/contacts teacher (own) masked numbers, consent, opted_out","x-pn-doc":{"file":"platform/docs/API.md","section":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},"x-pn-permissions":["sms.send"],"x-pn-roles":["teacher"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_sms_contacts","tags":["SMS to parents through a school gateway"],"summary":"teacher {pupil_ref (school code, never a name), number, consent_date (≤ today), consent_by: mother father guardian, c…","x-pn-source":"platform/pn/sms.py sms_contact_create()","description":"POST /api/sms/contacts teacher {pupil_ref (school code, never a name), number, consent_date (≤ today), consent_by: mother father guardian, consent_ref} ; any other key refused. Number: Tunisian 8 digits → +216, fixed lines and service numbers refused, +country accepted. Stored AES-256-GCM + keyed ha","x-pn-doc":{"file":"platform/docs/API.md","section":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},"x-pn-permissions":["sms.send"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"consent_by":{"type":"string","minLength":1,"maxLength":10},"consent_date":{"type":"string","format":"date"},"consent_ref":{"type":"string","minLength":1,"maxLength":80},"number":{"type":"string","minLength":6,"maxLength":24},"pupil_ref":{"type":"string","minLength":1,"maxLength":16}},"required":["consent_by","consent_date","consent_ref","number","pupil_ref"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"sms.contact_exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/sms/contacts/{cid}":{"delete":{"operationId":"delete_sms_contacts_by_cid","tags":["SMS to parents through a school gateway"],"summary":"teacher (own; others 404) deletes the number; queued messages cancelled; past messages keep template / dates / state …","x-pn-source":"platform/pn/sms.py sms_contact_delete()","description":"DELETE /api/sms/contacts/{id} teacher (own; others 404) deletes the number; queued messages cancelled; past messages keep template / dates / state only","x-pn-doc":{"file":"platform/docs/API.md","section":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},"x-pn-permissions":["sms.send"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/sms/contacts/{cid}/opt-out":{"post":{"operationId":"post_sms_contacts_by_cid_opt_out","tags":["SMS to parents through a school gateway"],"summary":"teacher (own) the parent asked to stop: number on the school's opt-out list for good","x-pn-source":"platform/pn/sms.py sms_contact_optout()","description":"POST /api/sms/contacts/{id}/opt-out teacher (own) the parent asked to stop: number on the school's opt-out list for good","x-pn-doc":{"file":"platform/docs/API.md","section":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},"x-pn-permissions":["sms.send"],"x-pn-roles":["teacher"],"parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/sms/messages":{"get":{"operationId":"get_sms_messages","tags":["SMS to parents through a school gateway"],"summary":"teacher (own) last 200: template, dates, segments, state ( queued, held, sent, delivered, failed, cancelled )","x-pn-source":"platform/pn/sms.py sms_list()","description":"GET /api/sms/messages teacher (own) last 200: template, dates, segments, state ( queued, held, sent, delivered, failed, cancelled )","x-pn-doc":{"file":"platform/docs/API.md","section":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},"x-pn-permissions":["sms.send"],"x-pn-roles":["teacher"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_sms_messages","tags":["SMS to parents through a school gateway"],"summary":"teacher Idempotency-Key required. {contact_id, template_id, text} . Text refused if it holds a diagnosis word (same l…","x-pn-source":"platform/pn/sms.py sms_send()","description":"POST /api/sms/messages teacher Idempotency-Key required. {contact_id, template_id, text} . Text refused if it holds a diagnosis word (same list as the page), a ranking, marks, or more than 3 parts. → 202 {id, template_id, segments, state, created_at, not_before, sent_at} (never the text or number). ","x-pn-doc":{"file":"platform/docs/API.md","section":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},"x-pn-permissions":["sms.send"],"x-pn-roles":["teacher"],"x-pn-gate":["feature_pupil_records"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"type":"string","minLength":1,"maxLength":80},"template_id":{"type":"string","minLength":1,"maxLength":16},"text":{"type":"string","minLength":1,"maxLength":201}},"required":["contact_id","template_id","text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, sms.school_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"idempotency.key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/sms/settings":{"get":{"operationId":"get_sms_settings","tags":["SMS to parents through a school gateway"],"summary":"teacher, director (own school) {school_id, enabled, quiet_hours, limits, provider}","x-pn-source":"platform/pn/sms.py sms_settings_get()","description":"GET /api/sms/settings teacher, director (own school) {school_id, enabled, quiet_hours, limits, provider}","x-pn-doc":{"file":"platform/docs/API.md","section":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},"x-pn-permissions":["sms.admin"],"x-pn-roles":["director"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"put":{"operationId":"put_sms_settings","tags":["SMS to parents through a school gateway"],"summary":"director {enabled:bool} only. The school switch: off → sending answers 403 sms.school_disabled . Audited","x-pn-source":"platform/pn/sms.py sms_settings_put()","description":"PUT /api/sms/settings director {enabled:bool} only. The school switch: off → sending answers 403 sms.school_disabled . Audited","x-pn-doc":{"file":"platform/docs/API.md","section":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},"x-pn-permissions":["sms.admin"],"x-pn-roles":["director"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/sms/summary":{"get":{"operationId":"get_sms_summary","tags":["SMS to parents through a school gateway"],"summary":"director 30 days, counts by state, segments sent, opt-outs. No number, pupil, teacher or ranking","x-pn-source":"platform/pn/sms.py sms_summary()","description":"GET /api/sms/summary director 30 days, counts by state, segments sent, opt-outs. No number, pupil, teacher or ranking","x-pn-doc":{"file":"platform/docs/API.md","section":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},"x-pn-permissions":["sms.admin"],"x-pn-roles":["director"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/sms/templates":{"get":{"operationId":"get_sms_templates","tags":["SMS to parents through a school gateway"],"summary":"teacher {templates:[absence, meeting, results, week, note], max_segments:3, segment_ucs2:70, segment_ucs2_multi:67}","x-pn-source":"platform/pn/sms.py sms_templates()","description":"GET /api/sms/templates teacher {templates:[absence, meeting, results, week, note], max_segments:3, segment_ucs2:70, segment_ucs2_multi:67}","x-pn-doc":{"file":"platform/docs/API.md","section":"14. SMS to parents through a school gateway (phase 2: closed, 24 Nov 2026)"},"x-pn-permissions":["sms.send"],"x-pn-roles":["teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/guardian":{"get":{"operationId":"get_students_guardian","tags":["Stage 2 · Student accounts"],"summary":"Verified active guardian links with consent state and the child's published homework, marks and comments.","x-pn-source":"platform/pn/students.py guardian()","description":"GET /api/students/guardian Verified active guardian links with consent state and the child's published homework, marks and comments.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/guardian/{lid}/consent":{"put":{"operationId":"put_students_guardian_by_lid_consent","tags":["Stage 2 · Student accounts"],"summary":"Verified guardian of a minor. {granted:boolean} . Revocation suspends the account and removes sessions. A new consent…","x-pn-source":"platform/pn/students.py consent()","description":"PUT /api/students/guardian/{lid}/consent Verified guardian of a minor. {granted:boolean} . Revocation suspends the account and removes sessions. A new consent grant is needed to resume access.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"lid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"granted":{"type":"boolean"}},"required":["granted"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/homework/{hid}/audio":{"get":{"operationId":"get_students_homework_by_hid_audio","tags":["Stage 2 · Student accounts"],"summary":"Plays a published recording for an enrolled student, linked guardian, or roster owner.","x-pn-source":"platform/pn/students.py audio()","description":"GET /api/students/homework/{hid}/audio Plays a published recording for an enrolled student, linked guardian, or roster owner.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["student.read","student.guardian"],"x-pn-roles":["parent","student"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"hid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"Published audio recording","content":{"audio/webm":{"schema":{"type":"string","format":"binary"}},"audio/mp4":{"schema":{"type":"string","format":"binary"}},"audio/ogg":{"schema":{"type":"string","format":"binary"}},"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/homework/{hid}/view":{"post":{"operationId":"post_students_homework_by_hid_view","tags":["Stage 2 · Student accounts"],"summary":"Records the first opening by this student. Idempotent per assignment and student.","x-pn-source":"platform/pn/students.py viewed()","description":"POST /api/students/homework/{hid}/view Records the first opening by this student. Idempotent per assignment and student.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["student.read"],"x-pn-roles":["student"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"hid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/me":{"get":{"operationId":"get_students_me","tags":["Stage 2 · Student accounts"],"summary":"Own class memberships, weekly timetable, date, homework, published marks and comments, school-year attendance, school…","x-pn-source":"platform/pn/students.py me()","description":"GET /api/students/me Own class memberships, weekly timetable, date, homework, published marks and comments, school-year attendance, school announcements and own practice progress.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["student.read"],"x-pn-roles":["student"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied, access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/progress":{"post":{"operationId":"post_students_progress","tags":["Stage 2 · Student accounts"],"summary":"{exercise,correct:boolean} . Records one self-practice attempt. Use the same Idempotency-Key on retry.","x-pn-source":"platform/pn/students.py progress()","description":"POST /api/students/progress {exercise,correct:boolean} . Records one self-practice attempt. Use the same Idempotency-Key on retry.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["student.read"],"x-pn-roles":["student"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"correct":{"type":"boolean"},"exercise":{"type":"string","minLength":1,"maxLength":100}},"required":["correct","exercise"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/school/inbox":{"get":{"operationId":"get_students_school_inbox","tags":["Stage 2 · Student accounts"],"summary":"Teacher sees threads in their own rosters and a message preview. ?preview=1 returns open and closed counts without id…","x-pn-source":"platform/pn/students.py inbox()","description":"GET /api/students/school/inbox Teacher sees threads in their own rosters and a message preview. ?preview=1 returns open and closed counts without identities or messages.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["student.teach"],"x-pn-roles":["teacher"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"preview","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/school/rosters":{"get":{"operationId":"get_students_school_rosters","tags":["Stage 2 · Student accounts"],"summary":"Upper primary through lycée (roster grades 4–13). Teacher's own rosters or director's school rosters.","x-pn-source":"platform/pn/students.py rosters()","description":"GET /api/students/school/rosters Upper primary through lycée (roster grades 4–13). Teacher's own rosters or director's school rosters.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["student.provision"],"x-pn-roles":["director","teacher"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/school/rosters/{rid}":{"get":{"operationId":"get_students_school_rosters_by_rid","tags":["Stage 2 · Student accounts"],"summary":"Active roster entries and bound accounts. The owner also receives assigned assessments, release state and current hom…","x-pn-source":"platform/pn/students.py roster()","description":"GET /api/students/school/rosters/{rid} Active roster entries and bound accounts. The owner also receives assigned assessments, release state and current homework summaries.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/school/rosters/{rid}/accounts":{"post":{"operationId":"post_students_school_rosters_by_rid_accounts","tags":["Stage 2 · Student accounts"],"summary":"Atomic import of up to 60 students with pupil_id and username . Existing pending accounts can request a replacement c…","x-pn-source":"platform/pn/students.py accounts()","description":"POST /api/students/school/rosters/{rid}/accounts Atomic import of up to 60 students with pupil_id and username . Existing pending accounts can request a replacement code by pupil ID alone. Teachers provision as minors. Directors may confirm adulthood with minor:false on creation and may link an exis","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-credential-response":true,"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"minor":{"type":"boolean"},"pupil_id":{"type":"string","minLength":1,"maxLength":80},"student_id":{"type":"string","minLength":1,"maxLength":80},"students":{},"username":{"type":"string","minLength":3,"maxLength":80}},"required":["pupil_id"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"student.already_linked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/school/rosters/{rid}/assessment":{"put":{"operationId":"put_students_school_rosters_by_rid_assessment","tags":["Stage 2 · Student accounts"],"summary":"Roster owner. {term,assessment,published,comments?:{pupil_id:text}} . Toggles release of this school year's assessmen…","x-pn-source":"platform/pn/students.py assessment()","description":"PUT /api/students/school/rosters/{rid}/assessment Roster owner. {term,assessment,published,comments?:{pupil_id:text}} . Toggles release of this school year's assessment and optionally updates comments. Unpublishing hides marks and comments together.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assessment":{"type":"integer","minimum":1,"maximum":40},"comments":{},"published":{"type":"boolean"},"term":{"type":"integer","minimum":1,"maximum":3}},"required":["assessment","published","term"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/school/rosters/{rid}/guardian":{"put":{"operationId":"put_students_school_rosters_by_rid_guardian","tags":["Stage 2 · Student accounts"],"summary":"Director verifies and links an active same-school parent account. Body {pupil_id,parent_username,verification_ref} .","x-pn-source":"platform/pn/students.py link_guardian()","description":"PUT /api/students/school/rosters/{rid}/guardian Director verifies and links an active same-school parent account. Body {pupil_id,parent_username,verification_ref} .","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["school.roster"],"x-pn-roles":["director"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"parent_username":{"type":"string","minLength":1,"maxLength":80},"pupil_id":{"type":"string","minLength":1,"maxLength":80},"verification_ref":{"type":"string","minLength":3,"maxLength":120}},"required":["parent_username","pupil_id","verification_ref"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/school/rosters/{rid}/homework":{"post":{"operationId":"post_students_school_rosters_by_rid_homework","tags":["Stage 2 · Student accounts"],"summary":"Roster owner. {title,due,attachments?:string[],voice_url?,voice_type?,voice_data?} . Attachments are text or HTTPS li…","x-pn-source":"platform/pn/students.py homework()","description":"POST /api/students/school/rosters/{rid}/homework Roster owner. {title,due,attachments?:string[],voice_url?,voice_type?,voice_data?} . Attachments are text or HTTPS links. Recording data is base64 audio and is limited to 54,000 encoded characters within the request body limit.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"attachments":{},"due":{"type":"string","format":"date"},"title":{"type":"string","minLength":1,"maxLength":200},"voice_data":{"type":"string","minLength":1,"maxLength":54000},"voice_type":{"type":"string","minLength":1,"maxLength":24,"enum":["audio/webm","audio/mp4","audio/ogg","audio/mpeg"]},"voice_url":{"type":"string","minLength":1,"maxLength":1500}},"required":["due","title"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/school/rosters/{rid}/homework/{hid}/views":{"get":{"operationId":"get_students_school_rosters_by_rid_homework_by_hid_views","tags":["Stage 2 · Student accounts"],"summary":"Roster owner. Returns who opened the assignment and the first view time.","x-pn-source":"platform/pn/students.py viewers()","description":"GET /api/students/school/rosters/{rid}/homework/{hid}/views Roster owner. Returns who opened the assignment and the first view time.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"hid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/school/{sid}/announcements":{"post":{"operationId":"post_students_school_by_sid_announcements","tags":["Stage 2 · Student accounts"],"summary":"Director publishes {title,body} to the school.","x-pn-source":"platform/pn/students.py announce()","description":"POST /api/students/school/{sid}/announcements Director publishes {title,body} to the school.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["student.announce"],"x-pn-roles":["director"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4000},"title":{"type":"string","minLength":1,"maxLength":200}},"required":["body","title"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/status":{"get":{"operationId":"get_students_status","tags":["Stage 2 · Student accounts"],"summary":"Public feature discovery. Returns {enabled:true} .","x-pn-source":"platform/pn/students.py status()","description":"GET /api/students/status Public feature discovery. Returns {enabled:true} .","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"security":[{},{"session":[]}]}},"/api/students/threads":{"get":{"operationId":"get_students_threads","tags":["Stage 2 · Student accounts"],"summary":"Student's own threads in active classes.","x-pn-source":"platform/pn/students.py threads()","description":"GET /api/students/threads Student's own threads in active classes.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["student.read"],"x-pn-roles":["student"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_students_threads","tags":["Stage 2 · Student accounts"],"summary":"{roster_id,body} . The roster identifies the teacher and the session identifies the student.","x-pn-source":"platform/pn/students.py new_thread()","description":"POST /api/students/threads {roster_id,body} . The roster identifies the teacher and the session identifies the student.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["student.read"],"x-pn-roles":["student"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":2500},"roster_id":{"type":"string","minLength":1,"maxLength":80}},"required":["body","roster_id"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/threads/{tid}/close":{"put":{"operationId":"put_students_threads_by_tid_close","tags":["Stage 2 · Student accounts"],"summary":"Teacher closes their thread. Later replies return 409.","x-pn-source":"platform/pn/students.py close()","description":"PUT /api/students/threads/{tid}/close Teacher closes their thread. Later replies return 409.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"tid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/students/threads/{tid}/messages":{"post":{"operationId":"post_students_threads_by_tid_messages","tags":["Stage 2 · Student accounts"],"summary":"{body} . The two authorized parties can reply to an open thread. Text, up to 2,500 characters.","x-pn-source":"platform/pn/students.py message()","description":"POST /api/students/threads/{tid}/messages {body} . The two authorized parties can reply to an open thread. Text, up to 2,500 characters.","x-pn-doc":{"file":"platform/docs/API.md","section":"Stage 2 · Student accounts"},"x-pn-permissions":["student.read"],"x-pn-roles":["student"],"x-pn-gate":["feature_students"],"x-pn-no-etag":true,"parameters":[{"name":"tid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":2500}},"required":["body"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.feature_disabled, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"student.thread_closed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/support-plans":{"get":{"operationId":"get_support_plans","tags":["Support plans and pupil-level ML"],"summary":"GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD}","x-pn-source":"platform/pn/support.py sp_list()","description":"GET POST /api/support-plans · GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD} ·","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.plan.read","support.aggregate.read"],"x-pn-roles":["director","inspector","regional_admin","support_staff","teacher"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_support_plans","tags":["Support plans and pupil-level ML"],"summary":"GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD}","x-pn-source":"platform/pn/support.py sp_create()","description":"GET POST /api/support-plans · GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD} ·","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.plan.write"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adaptations":{},"class_id":{"type":"string","minLength":1,"maxLength":16},"consent_date":{"type":"string","format":"date"},"consent_ref":{"type":"string","minLength":1,"maxLength":80},"goals":{},"level":{"type":"integer","minimum":1,"maximum":6},"official_ref":{"type":"string","minLength":1,"maxLength":120},"pupil_code":{"type":"string","minLength":1,"maxLength":12}},"required":["class_id","consent_date","consent_ref","level","official_ref","pupil_code"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/support-plans/{pid}":{"get":{"operationId":"get_support_plans_by_pid","tags":["Support plans and pupil-level ML"],"summary":"GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD}","x-pn-source":"platform/pn/support.py sp_get()","description":"GET POST /api/support-plans · GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD} ·","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.plan.read"],"x-pn-roles":["support_staff","teacher"],"x-pn-no-etag":true,"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"patch":{"operationId":"patch_support_plans_by_pid","tags":["Support plans and pupil-level ML"],"summary":"GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD}","x-pn-source":"platform/pn/support.py sp_patch()","description":"GET POST /api/support-plans · GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD} ·","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.plan.write"],"x-pn-roles":["teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adaptations":{},"goals":{}},"required":["adaptations"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"precondition.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"delete":{"operationId":"delete_support_plans_by_pid","tags":["Support plans and pupil-level ML"],"summary":"GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD}","x-pn-source":"platform/pn/support.py sp_close()","description":"GET POST /api/support-plans · GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD} ·","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.plan.write"],"x-pn-roles":["teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/support-plans/{pid}/analysis":{"get":{"operationId":"get_support_plans_by_pid_analysis","tags":["Support plans and pupil-level ML"],"summary":"GET /api/support-plans/{id}/analysis · POST DELETE …/analysis/try-approvals[/{id}]","x-pn-source":"platform/pn/support.py ml_get()","description":"POST /api/support-plans/{id}/staff · GET /api/support-plans/{id}/analysis · POST DELETE …/analysis/try-approvals[/{id}] ·","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.plan.read"],"x-pn-roles":["support_staff","teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/support-plans/{pid}/analysis/review-requests":{"post":{"operationId":"post_support_plans_by_pid_analysis_review_requests","tags":["Support plans and pupil-level ML"],"summary":"GET /api/aggregates/support-adaptations?scope= · POST /api/admin/ml/jobs · GET /api/admin/ml/models .","x-pn-source":"platform/pn/support.py ml_review()","description":"POST …/analysis/review-requests · GET /api/aggregates/support-adaptations?scope= · POST /api/admin/ml/jobs · GET /api/admin/ml/models .","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.review.request"],"x-pn-roles":["support_staff","teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"goal_id":{"type":"string","minLength":1,"maxLength":40}},"required":["goal_id"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/support-plans/{pid}/analysis/try-approvals":{"post":{"operationId":"post_support_plans_by_pid_analysis_try_approvals","tags":["Support plans and pupil-level ML"],"summary":"GET /api/support-plans/{id}/analysis · POST DELETE …/analysis/try-approvals[/{id}]","x-pn-source":"platform/pn/support.py ml_try()","description":"POST /api/support-plans/{id}/staff · GET /api/support-plans/{id}/analysis · POST DELETE …/analysis/try-approvals[/{id}] ·","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.try.approve"],"x-pn-roles":["teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adaptation_id":{"type":"string","minLength":1,"maxLength":20},"team_agreed":{},"week":{"type":"string","format":"date"}},"required":["adaptation_id","week"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ml.not_current_suggestion, ml.needs_team_agreement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/support-plans/{pid}/analysis/try-approvals/{aid}":{"delete":{"operationId":"delete_support_plans_by_pid_analysis_try_approvals_by_aid","tags":["Support plans and pupil-level ML"],"summary":"GET /api/support-plans/{id}/analysis · POST DELETE …/analysis/try-approvals[/{id}]","x-pn-source":"platform/pn/support.py ml_try_cancel()","description":"POST /api/support-plans/{id}/staff · GET /api/support-plans/{id}/analysis · POST DELETE …/analysis/try-approvals[/{id}] ·","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.try.approve"],"x-pn-roles":["teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"aid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/support-plans/{pid}/days/{day}":{"put":{"operationId":"put_support_plans_by_pid_days_by_day","tags":["Support plans and pupil-level ML"],"summary":"GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD}","x-pn-source":"platform/pn/support.py sp_day()","description":"GET POST /api/support-plans · GET PATCH DELETE /api/support-plans/{id} · PUT /api/support-plans/{id}/days/{YYYY-MM-DD} ·","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.plan.write"],"x-pn-roles":["teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"day","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"a":{},"g":{},"w":{}}}}}},"responses":{"204":{"description":"No content"},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/support-plans/{pid}/observations/{day}":{"get":{"operationId":"get_support_plans_by_pid_observations_by_day","tags":["Support plans and pupil-level ML"],"summary":"Plan reader within scope. Returns observations tied to the current criteria of open goals on that date.","x-pn-source":"platform/pn/support.py sp_observations()","description":"GET /api/support-plans/{pid}/observations/{day} Plan reader within scope. Returns observations tied to the current criteria of open goals on that date.","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.plan.read"],"x-pn-roles":["support_staff","teacher"],"x-pn-no-etag":true,"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"day","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"put":{"operationId":"put_support_plans_by_pid_observations_by_day","tags":["Support plans and pupil-level ML"],"summary":"Plan owner with support.plan.write . Requires the current plan If-Match and the expected prior result. Writes or clea…","x-pn-source":"platform/pn/support.py sp_observe()","description":"PUT /api/support-plans/{pid}/observations/{day} Plan owner with support.plan.write . Requires the current plan If-Match and the expected prior result. Writes or clears a single observation and returns 204 .","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.plan.write"],"x-pn-roles":["teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"name":"day","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"adaptation":{},"expected":{},"goal_id":{},"result":{},"session_id":{}}}}}},"responses":{"204":{"description":"No content"},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"support.observation_changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"precondition.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/support-plans/{pid}/staff":{"post":{"operationId":"post_support_plans_by_pid_staff","tags":["Support plans and pupil-level ML"],"summary":"GET /api/support-plans/{id}/analysis · POST DELETE …/analysis/try-approvals[/{id}]","x-pn-source":"platform/pn/support.py sp_staff()","description":"POST /api/support-plans/{id}/staff · GET /api/support-plans/{id}/analysis · POST DELETE …/analysis/try-approvals[/{id}] ·","x-pn-doc":{"file":"platform/docs/API.md","section":"12. Support plans and pupil-level ML (phase 2: closed)"},"x-pn-permissions":["support.plan.write"],"x-pn-roles":["teacher"],"parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assignment_ref":{"type":"string","minLength":1,"maxLength":80},"user_id":{"type":"string","minLength":1,"maxLength":80}},"required":["assignment_ref","user_id"]}}}},"responses":{"204":{"description":"No content"},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.scope_mismatch, access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}},"/api/sync":{"get":{"operationId":"get_sync","tags":["Teacher workspace and sync"],"summary":"(teacher, own)","x-pn-source":"platform/pn/routes.py sync_pull()","description":"GET /api/sync?since=<cursor>&device=<dev>&limit=1..500 (teacher, own)","x-pn-doc":{"file":"platform/docs/API.md","section":"11. Teacher workspace and sync (22 Nov 2026, phase 1)"},"x-pn-permissions":["sync.read"],"x-pn-roles":["teacher"],"parameters":[{"name":"device","in":"query","required":false,"schema":{"type":"string"}},{"name":"since","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"400":{"description":"validation.failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}},"post":{"operationId":"post_sync","tags":["Teacher workspace and sync"],"summary":"(teacher, own log)","x-pn-source":"platform/pn/routes.py sync_push()","description":"POST /api/sync (teacher, own log)","x-pn-doc":{"file":"platform/docs/API.md","section":"11. Teacher workspace and sync (22 Nov 2026, phase 1)"},"x-pn-permissions":["sync.write"],"x-pn-roles":["teacher"],"parameters":[{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"dev":{},"ev":{}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Object"}}}},"401":{"description":"auth.required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"access.denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}}}}},"components":{"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"pn_session","description":"HttpOnly, Secure, SameSite=Strict session cookie (login, 2FA, OIDC). Writes also need X-CSRF-Token."},"metricsToken":{"type":"http","scheme":"bearer","description":"PN_METRICS_TOKEN for a Prometheus scraper; /api/metrics only."}},"parameters":{"CSRF":{"name":"X-CSRF-Token","in":"header","required":true,"schema":{"type":"string"},"description":"From GET /api/auth/session (before login) or the login response (after)."},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"},"description":"Same key + same body within 24 h → the stored response is replayed."}},"schemas":{"Object":{"type":"object","description":"JSON object; shape documented in API.md (x-pn-doc)."},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"message_ar":{"type":"string"},"message_fr":{"type":"string"},"request_id":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}}}}}}},"responses":{"RateLimited":{"description":"rate.limited (Retry-After)","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Busy":{"description":"server.busy (load shedding, PN_MAX_INFLIGHT) or server.unavailable (database down); Retry-After","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"x-pn-roles":{"teacher":{"ar":"معلّم","fr":"Enseignant·e","scope":"school"},"director":{"ar":"مدير","fr":"Directeur·rice","scope":"school"},"inspector":{"ar":"متفقّد","fr":"Inspecteur·rice","scope":"region"},"regional_admin":{"ar":"مندوبية","fr":"Administration régionale (CRE)","scope":"region"},"platform_operator":{"ar":"مشغّل المنصّة","fr":"Opérateur de la plateforme (technique)","scope":"national"},"student":{"ar":"تلميذ/تلميذة","fr":"Élève","scope":"self"},"parent":{"ar":"وليّ","fr":"Parent","scope":"school"},"support_staff":{"ar":"مرافق(ة) الدعم","fr":"Personnel d'accompagnement","scope":"school"},"national_viewer":{"ar":"اطّلاع على المؤشّرات المجمّعة","fr":"CNTE : consultation (lecture seule)","scope":"national"},"engineer_viewer":{"ar":"مهندس(ة): اطّلاع تقني","fr":"Ingénieur·e : console technique (lecture seule)","scope":"national"}},"x-pn-coverage":{"operations":301,"paths":247,"documented_in_api_md":287,"undocumented":["DELETE /api/schools/{sid}/office/documents/{did}","GET /api/inclusive/home-steps/{token}","GET /api/inclusive/lesson-planning/{cls}","GET /api/ops/live/print","GET /api/ops/paper-metrics","GET /api/schools/{sid}/office/documents","GET /api/schools/{sid}/office/documents/{did}","PATCH /api/schools/{sid}/office/documents/{did}","POST /api/inclusive/home-steps","POST /api/paper-activity","POST /api/print-agent/claim","POST /api/print-agent/report","POST /api/print-packs/ready","POST /api/schools/{sid}/office/documents"],"with_permission":189,"public":20}}