{"openapi":"3.0.3","info":{"title":"AILI public API","version":"1.0.0","description":"JSON access to the Alberta K-12 curriculum as indexed by AILI (AI Learning Interface): subjects, curricula, trees, nodes, resources, hybrid search and cited answers. Every response is an object with `data` and optional `meta`, or `error` with `code` and `message`. Open access, rate limited per IP; send an `X-API-Key` header to raise the limit.","contact":{"name":"AILI feedback","url":"/disclaimer#feedback"}},"servers":[{"url":"https://goa-cc-uat-aili-app-001.azurewebsites.net"}],"tags":[{"name":"curriculum","description":"Subjects, curricula, courses and the node tree."},{"name":"nodes","description":"Individual curriculum elements."},{"name":"search","description":"Search and answers."},{"name":"library","description":"Resources and stored documents."},{"name":"platform","description":"Status and cost."},{"name":"streaming","description":"Server-sent event endpoints used by the web app."},{"name":"export","description":"Bulk export of every table, paginated by key, so all held data can be pulled."}],"paths":{"/api/v1/subjects":{"get":{"tags":["curriculum"],"operationId":"listSubjects","summary":"List subject areas with curriculum, course and outcome counts.","parameters":[{"name":"include_archived","in":"query","schema":{"type":"boolean","default":false},"description":"Include curricula withdrawn upstream and kept for reference (fetch_status archived-p2). Hidden by default; archived rows carry archived: true and archived_reason."}],"responses":{"200":{"description":"Subject list."}}}},"/api/v1/subjects/{code}":{"get":{"tags":["curriculum"],"operationId":"getSubject","summary":"One subject area with its child subjects, curricula and courses.","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"},"description":"Subject area code, for example MAT."}],"responses":{"200":{"description":"Subject detail."},"404":{"description":"Unknown subject."}}}},"/api/v1/curricula":{"get":{"tags":["curriculum"],"operationId":"listCurricula","summary":"List curricula, optionally filtered by subject or framework.","parameters":[{"name":"subject","in":"query","schema":{"type":"string"},"description":"Subject area code."},{"name":"framework","in":"query","schema":{"type":"string","enum":["GFC","POS","LDC","EXT"]},"description":"Curriculum framework."},{"name":"include_archived","in":"query","schema":{"type":"boolean","default":false},"description":"Include curricula withdrawn upstream and kept for reference (fetch_status archived-p2). Hidden by default; archived rows carry archived: true and archived_reason."}],"responses":{"200":{"description":"Curriculum list."}}}},"/api/v1/curricula/{code}":{"get":{"tags":["curriculum"],"operationId":"getCurriculum","summary":"One curriculum with its courses and grades.","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Curriculum detail."},"404":{"description":"Unknown curriculum."}}}},"/api/v1/curricula/{code}/tree":{"get":{"tags":["curriculum"],"operationId":"getCurriculumTree","summary":"Flat node rows for the explorer, each with parent_id and children_count.","description":"Pruned to level_index <= 5 by default so the tree loads in one request; pass depth=all for every knowledge, understanding and skills leaf. Clients build Map<parent_id, children[]> and treat rows whose parent is missing as roots.","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}},{"name":"depth","in":"query","schema":{"type":"string"},"description":"Maximum level_index (1 to 12) or `all`. Default 5."},{"name":"course","in":"query","schema":{"type":"string"},"description":"Restrict to one course code."}],"responses":{"200":{"description":"Tree rows.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TreeNode"}},"meta":{"type":"object"}}}}}},"404":{"description":"Unknown curriculum."}}}},"/api/v1/courses":{"get":{"tags":["curriculum"],"operationId":"listCourses","summary":"List courses (catalogue records plus uncatalogued K to 6 course nodes), ordered by id and cursor paged.","parameters":[{"name":"subject","in":"query","schema":{"type":"string"}},{"name":"grade","in":"query","schema":{"type":"string"},"description":"Grade code, for example 5 or K."},{"name":"framework","in":"query","schema":{"type":"string"}},{"name":"curriculum","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":500,"maximum":1000}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Last id of the previous page; meta carries total and next_cursor."},{"name":"include_archived","in":"query","schema":{"type":"boolean","default":false},"description":"Include curricula withdrawn upstream and kept for reference (fetch_status archived-p2). Hidden by default; archived rows carry archived: true and archived_reason."}],"responses":{"200":{"description":"Course list with meta {count, total, limit, next_cursor}."}}}},"/api/v1/grades":{"get":{"tags":["curriculum"],"operationId":"listGrades","summary":"List grade codes.","responses":{"200":{"description":"Grade list."}}}},"/api/v1/nodes/{id}":{"get":{"tags":["nodes"],"operationId":"getNode","summary":"One curriculum node with its ancestors and AI enrichment.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Numeric id, or `curriculum_code|path`."}],"responses":{"200":{"description":"Node detail.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Node"}}}}}},"404":{"description":"Unknown node."}}}},"/api/v1/nodes/{id}/children":{"get":{"tags":["nodes"],"operationId":"getNodeChildren","summary":"Direct children of a node (used to load K/U/SP leaves on demand).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Child rows."}}}},"/api/v1/nodes/{id}/ancestors":{"get":{"tags":["nodes"],"operationId":"getNodeAncestors","summary":"Ancestors from the curriculum root down to the parent.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Ancestor rows."}}}},"/api/v1/nodes/{id}/resources":{"get":{"tags":["nodes"],"operationId":"getNodeResources","summary":"Resources linked to a node.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Resource rows."}}}},"/api/v1/code/{code}":{"get":{"tags":["nodes"],"operationId":"lookupCode","summary":"Exact lookup by curriculum, course or outcome code (for example MAT5-OI2-GQ1-LO1).","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}},{"name":"include_archived","in":"query","schema":{"type":"boolean","default":false},"description":"Include curricula withdrawn upstream and kept for reference (fetch_status archived-p2). Hidden by default; archived rows carry archived: true and archived_reason."}],"responses":{"200":{"description":"Matching nodes, curriculum and course."},"404":{"description":"Nothing carries that code."}}}},"/api/v1/search":{"get":{"tags":["search"],"operationId":"search","summary":"Hybrid search across curriculum nodes, PDF pages, resources and overviews.","description":"mode=hybrid fuses vector similarity and full-text search; lexical uses full-text only; vector uses embeddings only. When embeddings are not yet available the server falls back to lexical and says so in meta.mode.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2}},{"name":"lang","in":"query","schema":{"type":"string","enum":["en","fr"]}},{"name":"subject","in":"query","schema":{"type":"string"}},{"name":"course","in":"query","schema":{"type":"string"}},{"name":"grade","in":"query","schema":{"type":"string"}},{"name":"framework","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"type":"string"},"description":"Node type such as LO, OI, GQ, K, U, SP."},{"name":"kind","in":"query","schema":{"type":"string","enum":["node","pdf_page","resource","overview"]}},{"name":"curriculum","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"mode","in":"query","schema":{"type":"string","enum":["hybrid","lexical","vector"],"default":"hybrid"}},{"name":"include_archived","in":"query","schema":{"type":"boolean","default":false},"description":"Include curricula withdrawn upstream and kept for reference (fetch_status archived-p2). Hidden by default; archived rows carry archived: true and archived_reason."}],"responses":{"200":{"description":"Ranked results.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}},"meta":{"type":"object"}}}}}},"400":{"description":"q too short."}}}},"/api/v1/ask":{"post":{"tags":["search"],"operationId":"ask","summary":"Cited answer as one JSON document (not streamed).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"type":"string"},"lang":{"type":"string","enum":["en","fr"]},"filters":{"type":"object","properties":{"curriculum":{"type":"string"},"course":{"type":"string"},"grade":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Answer with sources, verification and trace id.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Answer"}}}}}},"400":{"description":"Missing question."},"503":{"description":"Answer pipeline not available."}}}},"/api/v1/find":{"post":{"tags":["search"],"operationId":"find","summary":"Staged selection without generation. Reads intent, resolves curriculum sets and proposes a selection (stages 0 to 2 of docs/SELECTION-PIPELINE.md).","description":"Cheap (about $0.002) and cached ten minutes by normalized query and filters. Returns 503 while the selection module is unavailable. `filters` can override parts of the intent (grades, subjects, audience, scope, deliverable).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["q"],"properties":{"q":{"type":"string","description":"Plain request, for example: Grade 3 math and English for my son."},"filters":{"type":"object","description":"Optional overrides: grades[], subjects[] (codes), courses[], topics[], audience, scope, deliverable."},"language":{"type":"string","enum":["en","fr"]},"deliverable":{"type":"string","description":"overview | lesson | quiz | homework | presentation | answer"}}}}}},"responses":{"200":{"description":"Intent, sets and proposed selection.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FindResult"},"meta":{"type":"object","properties":{"cached":{"type":"boolean"},"cost_usd":{"type":"number","nullable":true}}}}}}}},"400":{"description":"q missing."},"503":{"description":"Selection module not available yet."}}}},"/api/v1/courses/{code}/outcomes":{"get":{"tags":["curriculum"],"operationId":"getCourseOutcomes","summary":"Whole-course dataset in curriculum order, as JSON or an indented outline.","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"},"description":"Course code, for example MAT3 or ELA9."},{"name":"depth","in":"query","schema":{"type":"string","enum":["lo","kusp"],"default":"lo"},"description":"lo stops at learning outcomes; kusp includes knowledge, understanding, skills and procedures."},{"name":"format","in":"query","schema":{"type":"string","enum":["json","outline"],"default":"json"}},{"name":"download","in":"query","schema":{"type":"string","enum":["1"]},"description":"Send as an attachment (Content-Disposition)."}],"responses":{"200":{"description":"Course dataset. JSON carries `data.set`, `data.nodes` (flat, with parent_id) and `data.tree` (nested); outline is text/markdown.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"set":{"$ref":"#/components/schemas/CurriculumSet"},"depth":{"type":"string"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/OutlineNode"}},"tree":{"$ref":"#/components/schemas/OutlineNode"}}}}}},"text/markdown":{"schema":{"type":"string"}}}},"404":{"description":"Unknown course."}}}},"/api/v1/resources/{id}":{"get":{"tags":["library"],"operationId":"getResource","summary":"One resource with linked outcomes and stored assets.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Resource detail."},"404":{"description":"Unknown resource."}}}},"/api/v1/assets/{id}":{"get":{"tags":["library"],"operationId":"getAsset","summary":"Raw bytes of a stored asset (PDF, image) with ETag; add ?meta=1 for metadata only.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"meta","in":"query","schema":{"type":"string","enum":["1"]},"description":"Return metadata JSON instead of bytes."}],"responses":{"200":{"description":"Bytes or metadata."},"304":{"description":"Not modified."},"404":{"description":"Asset not stored."}}}},"/api/v1/assets/{id}/pages/{n}":{"get":{"tags":["library"],"operationId":"getAssetPage","summary":"Extracted text of one PDF page.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"n","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Page text."},"404":{"description":"Page not extracted."}}}},"/api/v1/status":{"get":{"tags":["platform"],"operationId":"getStatus","summary":"Corpus counts, last harvest and index run, job queue, embedding coverage, loaded modules.","responses":{"200":{"description":"Status.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Status"}}}}}}}}},"/api/v1/register":{"get":{"tags":["platform"],"operationId":"getRegister","summary":"Data register. What the API holds, computed live from the database and cached ten minutes.","responses":{"200":{"description":"Register.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Register"},"meta":{"type":"object"}}}}}}}}},"/api/v1/costs/summary":{"get":{"tags":["platform"],"operationId":"getCostSummary","summary":"Platform AI cost by day, purpose, model and artifact kind.","parameters":[{"name":"days","in":"query","schema":{"type":"integer","default":30,"maximum":365}}],"responses":{"200":{"description":"Cost summary."}}}},"/api/v1/costs/mine":{"get":{"tags":["platform"],"operationId":"getMyCosts","summary":"Cost attributed to the calling session or account.","parameters":[{"name":"days","in":"query","schema":{"type":"integer","default":90}}],"responses":{"200":{"description":"Personal usage."}}}},"/api/ask":{"get":{"tags":["streaming"],"operationId":"askStream","summary":"Server-sent events. Emits stage, sources, chunk, verification, done and error events.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}},{"name":"lang","in":"query","schema":{"type":"string","enum":["en","fr"]}},{"name":"curriculum","in":"query","schema":{"type":"string"}},{"name":"course","in":"query","schema":{"type":"string"}},{"name":"grade","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"text/event-stream."}}},"post":{"tags":["streaming"],"operationId":"askJson","summary":"Same pipeline as GET, returned as one JSON object (answer, sources, verification, traceId, costUsd).","responses":{"200":{"description":"Answer JSON."}}}},"/api/ask/trace/{id}":{"get":{"tags":["streaming"],"operationId":"getTrace","summary":"Stored trace for one answer (plan, angles, candidates, selected passages, verification, usage).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Trace."},"404":{"description":"Unknown trace."}}}},"/api/generate/tools":{"get":{"tags":["streaming"],"operationId":"listTools","summary":"Generation tools with parameter descriptions, default tier and image support.","responses":{"200":{"description":"Tool list."}}}},"/api/generate/start":{"post":{"tags":["streaming"],"operationId":"startGeneration","summary":"Server-sent events. Emits stage, rag, chunk, image, validation, done and error while an artifact is generated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind"],"properties":{"kind":{"type":"string"},"tier":{"type":"string","enum":["fast","main","premium"]},"params":{"type":"object"},"nodeIds":{"type":"array","items":{"type":"integer"}},"question":{"type":"string"},"language":{"type":"string"},"persona":{"type":"string"}}}}}},"responses":{"200":{"description":"text/event-stream."}}}},"/api/generate/{id}":{"get":{"tags":["streaming"],"operationId":"getArtifact","summary":"One generated artifact (markdown body, sources, assets, validation).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Artifact."},"404":{"description":"Unknown artifact."}}}},"/api/v1/export":{"get":{"tags":["export"],"operationId":"listExports","summary":"The exportable tables with their key, since column, filters and page size.","responses":{"200":{"description":"List of exports."}}}},"/api/v1/export/{table}":{"get":{"tags":["export"],"operationId":"exportTable","summary":"One page of a table. Page with cursor (the last row key) until next_cursor is null. Totals ignore the cursor; total_estimated is set when the count came from the planner.","parameters":[{"name":"table","in":"path","required":true,"schema":{"type":"string","enum":["curricula","catalogue_courses","subject_areas","grades","collections","nodes","enrichment","resources","node_resource_refs","assets","asset_refs","pdf_documents","pdf_pages","chunks","audit_results","change_log","pipeline_runs"]}},{"name":"limit","in":"query","schema":{"type":"integer","default":500,"maximum":1000},"description":"Up to 1000; 200 when with_embeddings=1."},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"The next_cursor value from the previous page: the last key for single-key tables, an encoded key tuple for pdf_pages, node_resource_refs and asset_refs."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed after this time (updated_at; last_seen_at for curricula, created_at for enrichment)."},{"name":"curriculum","in":"query","schema":{"type":"string"},"description":"nodes, chunks: curriculum code."},{"name":"course","in":"query","schema":{"type":"string"},"description":"nodes, chunks: course code."},{"name":"node_type","in":"query","schema":{"type":"string"},"description":"nodes."},{"name":"framework","in":"query","schema":{"type":"string"},"description":"curricula: GFC | POS | LDC | EXT."},{"name":"published","in":"query","schema":{"type":"boolean"},"description":"curricula: content_published."},{"name":"language","in":"query","schema":{"type":"string"},"description":"chunks: en | fr."},{"name":"source_kind","in":"query","schema":{"type":"string"},"description":"chunks."},{"name":"fetch_status","in":"query","schema":{"type":"string"},"description":"assets: downloaded | gated | external_large | external_link | external_unavailable."},{"name":"with_embeddings","in":"query","schema":{"type":"boolean"},"description":"chunks: include the embedding vector as an array of numbers (limit capped at 200)."}],"responses":{"200":{"description":"One page.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":true}},"meta":{"type":"object","properties":{"next_cursor":{"type":"string","nullable":true},"total":{"type":"integer"},"total_estimated":{"type":"boolean"},"limit":{"type":"integer"},"table":{"type":"string"}}}}}}}},"404":{"description":"Unknown table."},"429":{"description":"Rate limited."}}}}},"components":{"schemas":{"Intent":{"type":"object","description":"Stage 0 reading of the request.","properties":{"audience":{"type":"string","nullable":true,"description":"parent | teacher | student | developer | unknown"},"grades":{"type":"array","items":{"type":"string"}},"subjects":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"confidence":{"type":"number"}}}},"courses":{"type":"array","items":{"type":"string"}},"topics":{"type":"array","items":{"type":"string"}},"scope":{"type":"string","description":"whole-course | topic | outcome | question"},"deliverable":{"type":"string","description":"overview | lesson | quiz | homework | presentation | answer | unknown"},"language":{"type":"string"}}},"CurriculumSet":{"type":"object","description":"One resolved course (stage 1).","properties":{"course_code":{"type":"string","nullable":true},"curriculum_code":{"type":"string","nullable":true},"grade":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"framework":{"type":"string","nullable":true},"counts":{"type":"object","properties":{"organizing_ideas":{"type":"integer"},"guiding_questions":{"type":"integer"},"learning_outcomes":{"type":"integer"},"kusp":{"type":"integer"}}},"root_node_id":{"type":"integer","nullable":true},"tree_url":{"type":"string","nullable":true},"empty":{"type":"boolean","description":"True when the subject has no course for the grade."},"reason":{"type":"string","nullable":true}}},"Selection":{"type":"object","description":"Stage 2 proposal as returned by find(). Nodes live in `selected`, grouped by `set_index`; `budget` is the token limit for the deliverable.","properties":{"scope":{"type":"string","nullable":true},"deliverable":{"type":"string","nullable":true},"mode":{"type":"string","nullable":true,"description":"full | fragment | outcome | question"},"omitted_count":{"type":"integer","nullable":true},"tokens":{"type":"integer","nullable":true},"budget":{"type":"integer","nullable":true,"description":"Token budget for the deliverable."},"merged_from_sets":{"type":"integer","nullable":true},"by_set":{"type":"array","nullable":true,"items":{"type":"object","properties":{"set_index":{"type":"integer","nullable":true},"course_code":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"kept":{"type":"integer","nullable":true},"omitted":{"type":"integer","nullable":true},"tokens":{"type":"integer","nullable":true},"total_blocks":{"type":"integer","nullable":true}}}},"selected":{"type":"array","nullable":true,"items":{"type":"object","properties":{"node_id":{"type":"integer"},"node_code":{"type":"string","nullable":true},"node_type":{"type":"string","nullable":true},"level_index":{"type":"integer","nullable":true},"path":{"type":"string","nullable":true},"heading":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"set_index":{"type":"integer","nullable":true},"role":{"type":"string","nullable":true,"description":"header | anchor | child"},"url":{"type":"string","nullable":true},"included_children":{"type":"array","items":{"type":"object"},"nullable":true}}}},"resources":{"type":"array","items":{"type":"object"},"nullable":true},"usage":{"type":"object","nullable":true}}},"FindResult":{"type":"object","properties":{"intent":{"$ref":"#/components/schemas/Intent"},"sets":{"type":"array","items":{"$ref":"#/components/schemas/CurriculumSet"}},"selection":{"$ref":"#/components/schemas/Selection"}}},"Register":{"type":"object","description":"Counts of what is available through the API.","properties":{"computed_at":{"type":"string"},"curricula":{"type":"object","properties":{"total":{"type":"integer"},"published":{"type":"integer"},"by_framework":{"type":"array","items":{"type":"object"}}}},"courses":{"type":"object","properties":{"catalogue":{"type":"integer"},"course_nodes":{"type":"integer"}}},"elements":{"type":"object","properties":{"total":{"type":"integer"},"by_family":{"type":"object"},"by_type":{"type":"object"}}},"resources":{"type":"object","properties":{"total":{"type":"integer"},"open_access":{"type":"integer"}}},"documents":{"type":"object","properties":{"known":{"type":"integer"},"downloaded":{"type":"integer"},"pdfs":{"type":"integer"},"pdf_pages":{"type":"integer"}}},"chunks":{"type":"object","properties":{"total":{"type":"integer"},"embedded":{"type":"integer"},"enriched":{"type":"integer"},"by_language":{"type":"object"}}},"enrichment":{"type":"object"},"last_harvest":{"type":"object","nullable":true},"last_audit":{"type":"object","nullable":true},"content_licence":{"type":"object"}}},"OutlineNode":{"type":"object","properties":{"id":{"type":"integer"},"parent_id":{"type":"integer","nullable":true},"node_code":{"type":"string"},"node_type":{"type":"string"},"level_index":{"type":"integer"},"label":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"url":{"type":"string"},"children":{"type":"array","items":{"type":"object"},"description":"Present in `tree` only."}}},"TreeNode":{"type":"object","description":"One row of a curriculum tree.","properties":{"id":{"type":"integer"},"parent_id":{"type":"integer","nullable":true,"description":"Null for roots or when the parent was pruned."},"node_code":{"type":"string"},"node_type":{"type":"string","description":"COURSE, OI, GQ, LO, KUSP, K, U, SP, TOPIC, GENERAL_OUTCOME, SPECIFIC_OUTCOME, OVERVIEW and others."},"level_index":{"type":"integer","description":"Portable depth, 1 course to 7 K/U/SP leaf."},"label":{"type":"string","nullable":true,"description":"Title (English, French fallback)."},"heading":{"type":"string","nullable":true,"description":"First 160 characters of the content."},"breadcrumb":{"type":"string","description":"Ancestor labels joined by a right-pointing chevron."},"grade_codes":{"type":"array","items":{"type":"string"},"nullable":true},"course_code":{"type":"string","nullable":true},"children_count":{"type":"integer"},"has_content":{"type":"boolean"}}},"Node":{"type":"object","description":"A curriculum element with bilingual text.","properties":{"id":{"type":"integer"},"curriculum_code":{"type":"string"},"framework":{"type":"string"},"node_code":{"type":"string"},"node_type":{"type":"string"},"level_index":{"type":"integer"},"path":{"type":"string","description":"Ancestor codes joined by `>`."},"course_code":{"type":"string","nullable":true},"grade_codes":{"type":"array","items":{"type":"string"},"nullable":true},"title_en":{"type":"string","nullable":true},"title_fr":{"type":"string","nullable":true},"content_en":{"type":"string","nullable":true},"content_fr":{"type":"string","nullable":true},"content_en_md":{"type":"string","nullable":true,"description":"Normalised markdown."},"image_urls":{"type":"array","items":{"type":"string"},"nullable":true},"ancestors":{"type":"array","items":{"type":"object"}},"enrichment":{"type":"object","nullable":true,"description":"AI summary, plain-language gloss, keywords, topics."},"descendant_count":{"type":"integer"}}},"SearchResult":{"type":"object","properties":{"chunk_id":{"type":"integer","nullable":true},"node_id":{"type":"integer","nullable":true},"asset_id":{"type":"integer","nullable":true},"page_num":{"type":"integer","nullable":true},"kind":{"type":"string","description":"node, pdf_page, resource or overview."},"node_type":{"type":"string","nullable":true},"heading":{"type":"string","nullable":true},"breadcrumb":{"type":"string","nullable":true},"snippet":{"type":"string","nullable":true,"description":"Matching text with <mark> around hits."},"score":{"type":"number","nullable":true},"url":{"type":"string","nullable":true,"description":"In-app link (/explore/node/:id or /library/pdf/:id?page=n)."}}},"Answer":{"type":"object","properties":{"answer":{"type":"string","description":"Markdown with [S#] citations."},"sources":{"type":"array","items":{"type":"object"}},"verification":{"type":"array","items":{"type":"object"},"description":"Per-claim supported, partial or unsupported verdicts."},"traceId":{"type":"string","nullable":true},"costUsd":{"type":"number","nullable":true}}},"Status":{"type":"object","properties":{"counts":{"type":"object","description":"subjects, curricula, courses, nodes, outcomes, assets, pdf_pages, chunks, chunks_embedded, embedding_coverage_pct and more."},"last_harvest":{"type":"object","nullable":true},"last_index":{"type":"object","nullable":true},"index_jobs":{"type":"array","items":{"type":"object"}},"audits":{"type":"array","items":{"type":"object"}},"modules":{"type":"object","description":"Which optional modules are loaded."}}}}}}