{"openapi":"3.1.0","info":{"title":"Narrata API","version":"2026.11.29-6","summary":"Business story to linked relational datasets, with proof the story is in the data.","description":"Jobs that call an LLM (creating a session, approve, what-if, detective, artifact edits) use your own key, sent in the x-llm-* headers. Without them only recorded examples replay. Events stream as Server-Sent Events.","license":{"name":"Open source","url":"https://github.com/H7KZ/Narrata"}},"servers":[{"url":"/api","description":"This deployment"}],"tags":[{"name":"Sessions","description":"A story, its agents' artifacts and the datasets generated from it."},{"name":"Datasets","description":"Tables, evidence, dashboard, detective and exports of one dataset."},{"name":"Teaching","description":"Assignments over a dataset; students submit findings."},{"name":"Meta","description":"Health and the gallery."}],"paths":{"/health":{"get":{"tags":["Meta"],"summary":"Liveness","responses":{"200":{"description":"OK"}}}},"/gallery":{"get":{"tags":["Meta"],"summary":"Curated read-only example sessions","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"sessionId":{"type":"string"},"input":{"type":"object","properties":{"story":{"type":"string","minLength":1,"maxLength":4000},"company":{"type":"string","minLength":1,"maxLength":1000}},"required":["story","company"],"additionalProperties":false},"datasets":{"type":"integer","minimum":0,"maximum":9007199254740991},"title":{"type":"string"},"summary":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["slug","sessionId","input","datasets","title","summary","tags"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false}}}}}}},"/sessions":{"post":{"tags":["Sessions"],"summary":"Start a story (agents draft the model and timeline)","parameters":[{"name":"x-llm-provider","in":"header","schema":{"type":"string","enum":["anthropic","openai","google","groq","mistral","openrouter","openai-compatible"]}},{"name":"x-llm-model","in":"header","schema":{"type":"string","example":"claude-sonnet-5-5"}},{"name":"x-llm-key","in":"header","schema":{"type":"string"},"description":"Your provider key. Never stored in readable form."},{"name":"x-llm-base-url","in":"header","schema":{"type":"string","format":"uri"},"description":"openai-compatible only (https)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"story":{"type":"string","minLength":1,"maxLength":4000},"company":{"type":"string","minLength":1,"maxLength":1000}},"required":["story","company"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sessionId":{"type":"string"}},"required":["sessionId"],"additionalProperties":false}}}},"400":{"description":"Invalid input or BYOK headers","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Too many jobs or requests","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/sessions/{id}":{"get":{"tags":["Sessions"],"summary":"Session state","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["drafting","refining","awaiting_refinement","generating","detecting","ready","failed","cancelled","interrupted"]},"input":{"type":"object","properties":{"story":{"type":"string","minLength":1,"maxLength":4000},"company":{"type":"string","minLength":1,"maxLength":1000}},"required":["story","company"],"additionalProperties":false},"datasets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^(dat|d)[0-9]+$"},"parent":{"type":["string","null"]},"seed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"origin":{"type":"string","enum":["approve","what_if","edit_scenario"]},"question":{"type":"string"}},"required":["id","parent","seed","origin"],"additionalProperties":false}},"error":{"type":"string"},"gallery":{"type":"string"}},"required":["id","status","input","datasets"],"additionalProperties":false}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/sessions/{id}/commands":{"post":{"tags":["Sessions"],"summary":"Approve, edit, what-if, detect, resume or cancel","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"x-llm-provider","in":"header","schema":{"type":"string","enum":["anthropic","openai","google","groq","mistral","openrouter","openai-compatible"]}},{"name":"x-llm-model","in":"header","schema":{"type":"string","example":"claude-sonnet-5-5"}},{"name":"x-llm-key","in":"header","schema":{"type":"string"},"description":"Your provider key. Never stored in readable form."},{"name":"x-llm-base-url","in":"header","schema":{"type":"string","format":"uri"},"description":"openai-compatible only (https)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"approve"},"settings":{"type":"object","properties":{"seed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"scale":{"type":"number","minimum":0.1,"maximum":5},"noise":{"type":"object","properties":{"missing":{"type":"number","minimum":0,"maximum":50},"duplicates":{"type":"number","minimum":0,"maximum":50},"hourJitter":{"type":"boolean"}},"required":["missing","duplicates","hourJitter"]},"expectations":{"type":"array","items":{"type":"string"}},"period":{"type":"object","properties":{"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"end":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["start","end"]}}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"edit_artifact"},"name":{"type":"string","enum":["01_company","02_model","03_influences","04_story","05_scenario"]},"value":{}},"required":["type","name","value"]},{"type":"object","properties":{"type":{"type":"string","const":"what_if"},"question":{"type":"string","minLength":1,"maxLength":1000},"from":{"type":"string"}},"required":["type","question","from"]},{"type":"object","properties":{"type":{"type":"string","const":"edit_scenario"},"from":{"type":"string"},"scenario":{}},"required":["type","from","scenario"]},{"type":"object","properties":{"type":{"type":"string","const":"detect"},"datasetId":{"type":"string"}},"required":["type","datasetId"]},{"type":"object","properties":{"type":{"type":"string","const":"cancel"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"resume"}},"required":["type"]}]}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true},"seq":{"type":"number"}},"required":["ok","seq"],"additionalProperties":false}}}},"409":{"description":"A job is already running","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"Rejected before any job started ({path,message}[] in errors)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/sessions/{id}/events":{"get":{"tags":["Sessions"],"summary":"Server-Sent Events (Last-Event-ID or ?after= replays)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"after","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"text/event-stream of SessionEvent","content":{"text/event-stream":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"seq":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","const":"status"},"status":{"type":"string","enum":["drafting","refining","awaiting_refinement","generating","detecting","ready","failed","cancelled","interrupted"]}},"required":["seq","type","status"],"additionalProperties":false},{"type":"object","properties":{"seq":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","const":"cascade"},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"step.started"},"step":{"type":"string","enum":["01_company","02_model","03_influences","04_story","05_scenario"]}},"required":["type","step"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"step.done"},"step":{"type":"string","enum":["01_company","02_model","03_influences","04_story","05_scenario"]},"cached":{"type":"boolean"}},"required":["type","step","cached"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"loop.iteration"},"step":{"type":"string","enum":["01_company","02_model","03_influences","04_story","05_scenario"]},"n":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"ok":{"type":"boolean"},"feedback":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false},{"type":"string"}]}}},"required":["type","step","n","ok","feedback"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"log"},"message":{"type":"string"}},"required":["type","message"],"additionalProperties":false}]}},"required":["seq","type","event"],"additionalProperties":false},{"type":"object","properties":{"seq":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","const":"dataset.ready"},"datasetId":{"type":"string"}},"required":["seq","type","datasetId"],"additionalProperties":false},{"type":"object","properties":{"seq":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","const":"detective.done"},"datasetId":{"type":"string"}},"required":["seq","type","datasetId"],"additionalProperties":false},{"type":"object","properties":{"seq":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","const":"error"},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["seq","type","message"],"additionalProperties":false}]}}}}}}},"/sessions/{id}/datasets/{d}/tables":{"get":{"tags":["Datasets"],"summary":"Observed tables","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"d","in":"path","required":true,"schema":{"type":"string","example":"dat1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"rows":{"type":"integer","minimum":0,"maximum":9007199254740991},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"required":["name","rows","columns"],"additionalProperties":false}}},"required":["tables"],"additionalProperties":false}}}}}}},"/sessions/{id}/datasets/{d}/tables/{t}":{"get":{"tags":["Datasets"],"summary":"First rows of a table (limit 1–200)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"d","in":"path","required":true,"schema":{"type":"string","example":"dat1"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string"},"rows":{"type":"integer","minimum":0,"maximum":9007199254740991},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rowsShown":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["name","rows","columns","rowsShown"],"additionalProperties":false}}}}}}},"/sessions/{id}/datasets/{d}/evidence":{"get":{"tags":["Datasets"],"summary":"SQL hypotheses and standard series","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"d","in":"path","required":true,"schema":{"type":"string","example":"dat1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"expectations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"pass":{"type":"boolean"},"before":{"type":["number","null"]},"after":{"type":["number","null"]},"relChange":{"type":["number","null"]},"error":{"type":"string"}},"required":["id","pass","before","after","relChange"],"additionalProperties":false}},"series":{"type":"array","items":{"type":"object","properties":{"table":{"type":"string"},"dateColumn":{"type":"string"},"metric":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"value":{"type":"number"}},"required":["day","value"],"additionalProperties":false}}},"required":["table","dateColumn","metric","points"],"additionalProperties":false}}},"required":["expectations","series"],"additionalProperties":false}}}}}}},"/sessions/{id}/datasets/{d}/dashboard":{"get":{"tags":["Datasets"],"summary":"Automatic dashboard (A2UI subtree + data)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"d","in":"path","required":true,"schema":{"type":"string","example":"dat1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dashboard":{"type":"object","properties":{"components":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"dataModel":{"type":"object","properties":{"kpis":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number"},"format":{"type":"string","enum":["int","number"]}},"required":["label","value","format"],"additionalProperties":false}},"trends":{"type":"array","items":{"type":"object","properties":{"table":{"type":"string"},"dateColumn":{"type":"string"},"metric":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"week":{"type":"string"},"value":{"type":"number"}},"required":["week","value"],"additionalProperties":false}}},"required":["table","dateColumn","metric","points"],"additionalProperties":false}},"heatmap":{"anyOf":[{"type":"object","properties":{"table":{"type":"string"},"keyColumn":{"type":"string"},"metric":{"type":"string"},"cells":{"type":"array","items":{"type":"object","properties":{"row":{"type":"string"},"col":{"type":"string"},"value":{"type":"number"}},"required":["row","col","value"],"additionalProperties":false}}},"required":["table","keyColumn","metric","cells"],"additionalProperties":false},{"type":"null"}]},"breakdowns":{"type":"array","items":{"type":"object","properties":{"table":{"type":"string"},"column":{"type":"string"},"bars":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number"}},"required":["label","value"],"additionalProperties":false}}},"required":["table","column","bars"],"additionalProperties":false}}},"required":["kpis","trends","heatmap","breakdowns"],"additionalProperties":false}},"required":["components","dataModel"],"additionalProperties":false}},"required":["dashboard"],"additionalProperties":false}}}}}}},"/sessions/{id}/datasets/{d}/compare/{other}":{"get":{"tags":["Datasets"],"summary":"Metric differences against another dataset","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"d","in":"path","required":true,"schema":{"type":"string","example":"dat1"}},{"name":"other","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"diff":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string"},"a":{"type":["number","null"]},"b":{"type":["number","null"]},"delta":{"type":["number","null"]},"relChange":{"type":["number","null"]}},"required":["metric","a","b","delta","relChange"],"additionalProperties":false}}},"required":["diff"],"additionalProperties":false}}}}}}},"/sessions/{id}/datasets/{d}/detective":{"get":{"tags":["Datasets"],"summary":"Blind detective result (null until run)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"d","in":"path","required":true,"schema":{"type":"string","example":"dat1"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"result":{"anyOf":[{"type":"object","properties":{"report":{"type":"object","properties":{"narrative":{"type":"string"},"findings":{"type":"array","items":{"type":"object","properties":{"claim":{"type":"string"},"entities":{"type":"array","items":{"type":"string"}},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"end":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"supportingSql":{"type":"string"}},"required":["claim","entities","start","supportingSql"],"additionalProperties":false}}},"required":["narrative","findings"],"additionalProperties":false},"score":{"type":"object","properties":{"recall":{"type":"number","minimum":0,"maximum":1},"precision":{"type":"number","minimum":0,"maximum":1},"matched":{"type":"array","items":{"type":"object","properties":{"storyPointId":{"type":"string"},"findingIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["storyPointId","findingIndex"],"additionalProperties":false}}},"required":["recall","precision","matched"],"additionalProperties":false}},"required":["report","score"],"additionalProperties":false},{"type":"null"}]}},"required":["result"],"additionalProperties":false}}}}}}},"/sessions/{id}/datasets/{d}/export":{"get":{"tags":["Datasets"],"summary":"Download the observed tables","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"d","in":"path","required":true,"schema":{"type":"string","example":"dat1"}},{"name":"format","in":"query","schema":{"type":"string","enum":["xlsx","csv","parquet","duckdb"]}}],"responses":{"200":{"description":"File attachment"}}}},"/assignments":{"post":{"tags":["Teaching"],"summary":"Create an assignment (returns the secret manage token once)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sessionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"datasetId":{"type":"string","pattern":"^(dat|d)[0-9]+$"},"title":{"type":"string","minLength":1,"maxLength":160},"brief":{"type":"string","minLength":1,"maxLength":4000},"showScore":{"default":true,"type":"boolean"},"revealAt":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["sessionId","datasetId","title","brief"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"manageToken":{"type":"string"}},"required":["id","manageToken"],"additionalProperties":false}}}}}}},"/assignments/{id}":{"get":{"tags":["Teaching"],"summary":"Assignment as students see it","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"brief":{"type":"string"},"showScore":{"type":"boolean"},"revealed":{"type":"boolean"},"revealAt":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"story":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"entityIds":{"type":"array","items":{"type":"string"}},"segmentValues":{"type":"array","items":{"type":"string"}}},"required":["title","description","start","entityIds","segmentValues"],"additionalProperties":false}},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","title","brief","showScore","revealed","revealAt","story","createdAt"],"additionalProperties":false}}}}}},"delete":{"tags":["Teaching"],"summary":"Delete (lecturer)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"x-manage-token","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"403":{"description":"Wrong token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/assignments/{id}/submissions":{"post":{"tags":["Teaching"],"summary":"Submit findings (scored against the hidden story)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"findings":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"claim":{"type":"string","minLength":1,"maxLength":500},"entities":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"end":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["claim","start"]}}},"required":["name","findings"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"score":{"anyOf":[{"type":"object","properties":{"recall":{"type":"number","minimum":0,"maximum":1},"precision":{"type":"number","minimum":0,"maximum":1},"matched":{"type":"array","items":{"type":"object","properties":{"storyPointId":{"type":"string"},"findingIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["storyPointId","findingIndex"],"additionalProperties":false}}},"required":["recall","precision","matched"],"additionalProperties":false},{"type":"null"}]}},"required":["id","score"],"additionalProperties":false}}}},"409":{"description":"The story is revealed; submissions are closed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/assignments/{id}/manage":{"get":{"tags":["Teaching"],"summary":"Story and submissions (lecturer)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"x-manage-token","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"assignment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"brief":{"type":"string"},"showScore":{"type":"boolean"},"revealed":{"type":"boolean"},"revealAt":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"story":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"entityIds":{"type":"array","items":{"type":"string"}},"segmentValues":{"type":"array","items":{"type":"string"}}},"required":["title","description","start","entityIds","segmentValues"],"additionalProperties":false}},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","title","brief","showScore","revealed","revealAt","story","createdAt"],"additionalProperties":false},"story":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"entityIds":{"type":"array","items":{"type":"string"}},"segmentValues":{"type":"array","items":{"type":"string"}}},"required":["title","description","start","entityIds","segmentValues"],"additionalProperties":false}},"submissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"createdAt":{"type":"string"},"findings":{"type":"array","items":{"type":"object","properties":{"claim":{"type":"string","minLength":1,"maxLength":500},"entities":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"start":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"end":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"}},"required":["claim","entities","start"],"additionalProperties":false}},"score":{"type":"object","properties":{"recall":{"type":"number","minimum":0,"maximum":1},"precision":{"type":"number","minimum":0,"maximum":1},"matched":{"type":"array","items":{"type":"object","properties":{"storyPointId":{"type":"string"},"findingIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["storyPointId","findingIndex"],"additionalProperties":false}}},"required":["recall","precision","matched"],"additionalProperties":false}},"required":["id","name","createdAt","findings","score"],"additionalProperties":false}}},"required":["assignment","story","submissions"],"additionalProperties":false}}}},"403":{"description":"Wrong token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}