{"openapi":"3.1.1","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Jami3D API","version":"1","summary":"Viewer sessions, embeds, live AI, the server API and webhooks of Jami3D.","description":"Version 1 of the API is additive only, forever: fields and values are added, never renamed, narrowed or removed, and every SDK of the last 24 months keeps working. Read answers tolerantly — ignore fields and values you do not know — and branch on the absence of a field, never on a version.\n\nErrors come in one envelope, `{ error, message, details? }`, whose `error` is one of the codes below (`x-jami3d-error-codes`); new codes are only ever added.\n\nYour backend calls the Server API with a secret key. The Live Room player in the embed makes the session calls itself, with the viewer token the mint answers."},"servers":[{"url":"https://api.jami.live","description":"The server API (secret keys)."},{"url":"https://embed.jami.live","description":"Embeds: the Live Room's calls and the card."},{"url":"https://jami.live","description":"jami.live's own pages."}],"tags":[{"name":"Server API","description":"What your backend calls with a secret key (`Authorization: Bearer sk_live_…`): secure-embed grants, your projects, usage, learners' results and reports. Never from a browser: no CORS, never cached."},{"name":"Embeds","description":"Public reads a page makes before anything plays: a project's card (the SDK's facade), oEmbed, and the keys viewer tokens are signed with."},{"name":"Viewer sessions","description":"The Live Room player's own calls, with the viewer token of `POST /v1/sessions`. The player in the embed makes them for you; they are documented because `/v1` is a frozen contract."},{"name":"Conversation","description":"Live AI: a question or an AI Line answered as an event stream, its cancel, the shared transcript, and the session-bound media links the events hand out."},{"name":"Voice","description":"Push-to-talk: the first Talk press, which joins the session's voice room, and the HTTPS fallback that transcribes a recorded question."},{"name":"Webhooks","description":"Events delivered to your endpoints: a signed JSON POST, retried at +1 min, +5 min, +30 min, +2 h, +6 h, +12 h, +24 h, +24 h, then dead. An endpoint failing for 3 days running is disabled and its owner told."}],"paths":{"/v1/sessions":{"post":{"operationId":"mint","summary":"Start a viewer session","tags":["Viewer sessions"],"description":"Rate limited per client address (30 a minute, a burst of 10 more). A signed-in jami.live caller plays as themselves.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"listing":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$","description":"What a request may name instead of a project id: a marketplace listing's slug."},"release":{"default":"latest","anyOf":[{"type":"string","const":"latest"},{"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)$"}]},"publishableKey":{"type":"string","minLength":1,"maxLength":200},"viewerToken":{"type":"string","minLength":1,"maxLength":4096},"shareToken":{"type":"string","minLength":16,"maxLength":128},"locale":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"The viewer's language (live AI replies follow it); absent: the release's content language."},"parentOrigin":{"type":"string","maxLength":2048,"pattern":"^https?:\\/\\/[^\\s/?#]+$"},"resumeSessionId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."}},"description":"`POST /v1/sessions` — start (or resume) a viewer session.\n\nExactly one of `projectId` and `listing` names what to play. `release` is `latest` (the\nproject's live release) or a release id. A `shareToken` (a preview's share link) plays that\npreview without an account; a signed-in member plays the project's previews with their\nsession cookie. `publishableKey` / `viewerToken` are the embed and secure-embed credentials.\n`resumeSessionId` continues an earlier session's story when the same viewer comes back within\n24 hours to the same release. `parentOrigin` is informational: it never decides who pays."}}}},"responses":{"201":{"description":"Start a viewer session","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"surface":{"type":"string","minLength":1,"description":"One of `V1_SURFACES`; a reader treats a value it does not know as `watch`."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"expiresAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"When the token expires: heartbeat before then."},"endsAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"No heartbeat extends the session past this: mint again (with `resumeSessionId`)."},"heartbeatMs":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"test":{"type":"boolean","description":"Minted from the Studio or with a test key: kept out of the creator's analytics."},"childDirected":{"type":"boolean","description":"The project is made for children: no persistent identifiers, stricter AI."},"locale":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"A UI or reply language: a BCP 47 tag (`en`, `pt-BR`, `zh-Hant-TW`)."},"resumedFrom":{"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)$","description":"A resumed session: the session it continues…"},"resume":{"type":"object","properties":{"head":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"position":{"type":"object","properties":{"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["sceneId","ms"],"description":"A position on the story axis without a visit: a scene and an authored time in it."}},"required":["head"],"description":"…and where its story stands — the furthest anchor recorded and the last known playback position."},"resumeOffer":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"head":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"position":{"type":"object","properties":{"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["sceneId","ms"],"description":"A position on the story axis without a visit: a scene and an authored time in it."},"seenAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"When that session was last seen."}},"required":["sessionId","head","seenAt"],"description":"Added within v1 (P8): a signed-in viewer's mint that named no session to resume, when they\nleft this release's story unfinished in another session within the resume window (on\nanother device, say) — the latest such session, and where its story stands. The session\nthis answer opened starts from the beginning; to continue the other one instead, ask the\nviewer, then mint again with `resumeSessionId` set to `sessionId`. Absent: nothing to offer\n(an anonymous viewer, a child-directed project, a server from before)."},"conversationRetentionDays":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Added within v1 (P8): how many days the words of this session's conversation are kept before\nthey are erased — the project's choice, one day for a child-directed project — which the\nLive Room's \"About this experience\" tells the viewer. Absent: a server from before (say no\nnumber then)."}},"required":["id","surface","epoch","expiresAt","endsAt","heartbeatMs","test","childDirected","locale"]},"token":{"type":"string","minLength":1},"release":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"A release id; a Studio draft's is the draft's own (`draft-{revision}`)."},"kind":{"type":"string","minLength":1,"description":"`publish`, `preview` or `draft`."},"number":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Absent for a draft."},"manifestUrl":{"type":"string","minLength":1,"description":"The release manifest (`@jami3d/protocol/release`): absolute, or root-relative (a draft; a\nprotected release served by the app's own media route). A protected release's carries the\nsession's asset token in its path, like `assets.base`."}},"required":["id","kind","manifestUrl"]},"assets":{"type":"object","properties":{"base":{"type":"string","minLength":1,"description":"Where the release's files are: a file's URL is `base` + its path (`singleFilePath` /\n`bundleFilePath` in `namespace` for content-addressed files, the manifest's paths for the\nrelease JSON). A protected release's `base` carries the session's asset token as a PATH\nsegment (`https://media.jami.live/t/{token}/`) — never a query string: use it as it is. A\nheartbeat may hand out a new one (`assets` of its answer)."},"token":{"type":"string","minLength":1,"description":"A protected release: the asset token its `base` carries, on its own (for a client that\ntracks when it changes). It expires — a heartbeat hands out a fresh `base` before then. Never\nappend it to a URL: `base` already carries it."},"namespace":{"type":"string","minLength":1,"description":"The namespace of the content-addressed paths: one of `V1_ASSET_NAMESPACES`. Absent (a\nserver from before protected releases, a Studio draft): `pub`. A reader that does not know\nthe value cannot address the files and turns the release away as built for a newer player."}},"required":["base"]},"ai":{"type":"object","properties":{"level":{"type":"string","enum":["off","text","voice"]},"reasons":{"type":"array","items":{"type":"string","minLength":1}},"scopes":{"type":"array","items":{"type":"string"}},"voiceReplies":{"type":"string","minLength":1,"maxLength":32,"description":"Added within v1: whether live replies are spoken here — the project's setting, one of\n`V1_VOICE_REPLIES` (open: a value a reader does not know reads as absent). Changing it\nmoves the AI watch's stamp. Absent: this answer does not say (a server from before, an answer\nthat reads the session alone — the events answer); keep what an earlier answer said, and\nwith none, ask for spoken replies as before (`output.audio` true when audio can play)."},"needsVerification":{"type":"boolean","description":"Text and voice need a human check first (`POST …/verify`); false when the mint was trusted."},"verification":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"description":"`turnstile`: render Cloudflare Turnstile with `siteKey`, post its token to `…/verify`."},"siteKey":{"type":"string","minLength":1}},"required":["kind","siteKey"],"description":"How a session's live AI must be unlocked, when it must."},"limits":{"type":"object","properties":{"turnsPerSession":{"type":"integer","minimum":0,"maximum":9007199254740991},"turnsPerViewerDay":{"type":"integer","minimum":0,"maximum":9007199254740991},"voiceSecondsPerViewerDay":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["turnsPerSession","turnsPerViewerDay","voiceSecondsPerViewerDay"],"description":"The effective per-viewer limits of live AI (the project's, tightened by an API key's)."},"stamp":{"type":"string","minLength":1,"maxLength":64,"description":"Added within v1 (P8): the AI watch's stamp this status was decided under — what the first\n`GET …/ai` sends as `since`. Absent (a server from before the watch): the first watch answer\ncarries the status."}},"required":["level","reasons","scopes","needsVerification","limits"],"description":"The mint answer's AI section: the status, the effective limits and how to unlock text and voice."},"branding":{"type":"object","properties":{"accent":{"type":"string","description":"The project's Live Room accent (`#rrggbb`); host options still win over it."},"badge":{"type":"boolean","description":"Show the \"Made with Jami3D\" badge (plans without removable branding)."}},"required":["badge"]},"protocol":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capabilities":{"type":"array","items":{"type":"string"}}},"required":["version","capabilities"]},"embed":{"type":"object","properties":{"conversationEvents":{"type":"boolean"}},"required":["conversationEvents"],"description":"An embed's session (`embed`, `secure_embed`) only: what the host page may be told.\n`conversationEvents` — the Live Room forwards the conversation's messages to the host\n(`aimessage`) — holds only when the project exposes them AND the publishable key (or the\ngrant) carries `conversation_events`."}},"required":["session","token","release","assets","ai","branding","protocol"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`key_invalid`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`origin_not_allowed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`release_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`retry_later`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/v1/sessions/{id}/heartbeat":{"post":{"operationId":"heartbeat","summary":"Keep a session alive","tags":["Viewer sessions"],"description":"Every 5 minutes; a fresh token when the old one has less than 10 minutes left. A session ends 8 hours after it began.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"position":{"type":"object","properties":{"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["sceneId","ms"],"description":"A position on the story axis without a visit: a scene and an authored time in it."}},"description":"`POST /v1/sessions/{id}/heartbeat` — every `session.heartbeatMs` (5 minutes) while the Live\nRoom is open. `position` is where playback is now (what \"continue watching\" resumes)."}}}},"responses":{"200":{"description":"Keep a session alive","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"description":"A fresh token, when the old one had less than 10 minutes left; keep the old one otherwise."},"expiresAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"endsAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"ai":{"type":"object","properties":{"level":{"type":"string","enum":["off","text","voice"]},"reasons":{"type":"array","items":{"type":"string","minLength":1}},"scopes":{"type":"array","items":{"type":"string"}},"voiceReplies":{"type":"string","minLength":1,"maxLength":32,"description":"Added within v1: whether live replies are spoken here — the project's setting, one of\n`V1_VOICE_REPLIES` (open: a value a reader does not know reads as absent). Changing it\nmoves the AI watch's stamp. Absent: this answer does not say (a server from before, an answer\nthat reads the session alone — the events answer); keep what an earlier answer said, and\nwith none, ask for spoken replies as before (`output.audio` true when audio can play)."}},"required":["level","reasons","scopes"],"description":"The session's live-AI status: the level and every reason that holds at it, and the scopes the token\ncarries. The UI hides voice at `text` and shows \"Live answers are paused\" at `off`."},"assets":{"type":"object","properties":{"token":{"type":"string","minLength":1},"base":{"type":"string","minLength":1},"namespace":{"type":"string","minLength":1}},"description":"Where the session's files are now (a release's session; `{}` for a Studio draft and from a\nserver before protected releases): `base` with its `namespace` and, for a protected release,\nthe `token` it carries — as the mint's `assets` say them. They change when the asset token is\nrefreshed (every few hours) and when the release's files move between the public CDN and the\nmedia host (the owner changed the project's embed policy or listing; the old place keeps\nserving until this answer said the new one). A client loads every file from now on from a\n`base` that differs from its own, keeps what it loaded, and keeps its own base when `base` is\nabsent."},"protocol":{"type":"object","properties":{"version":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capabilities":{"type":"array","items":{"type":"string"}}},"required":["version","capabilities"],"description":"Added within v1 (P17): the protocol as this server speaks it now — what a session minted on\nan older pod learns at its next heartbeat (a capability switched on since, `objectUpdates`).\nAbsent (a server from before): keep what the mint said."}},"required":["expiresAt","endsAt","epoch","ai","assets"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/sessions/{id}/verify":{"post":{"operationId":"verify","summary":"Verify the viewer (Turnstile)","tags":["Viewer sessions"],"description":"The human check that grants `text` and `voice` in a fresh token; five an hour per client address.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"turnstileToken":{"type":"string","minLength":1,"maxLength":2048}},"required":["turnstileToken"],"description":"`POST /v1/sessions/{id}/verify` — the Turnstile token the invisible widget produced after the\nfirst frame. Success grants the `text` and `voice` scopes in a fresh token."}}}},"responses":{"200":{"description":"Verify the viewer (Turnstile)","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1},"expiresAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"ai":{"type":"object","properties":{"level":{"type":"string","enum":["off","text","voice"]},"reasons":{"type":"array","items":{"type":"string","minLength":1}},"scopes":{"type":"array","items":{"type":"string"}},"voiceReplies":{"type":"string","minLength":1,"maxLength":32,"description":"Added within v1: whether live replies are spoken here — the project's setting, one of\n`V1_VOICE_REPLIES` (open: a value a reader does not know reads as absent). Changing it\nmoves the AI watch's stamp. Absent: this answer does not say (a server from before, an answer\nthat reads the session alone — the events answer); keep what an earlier answer said, and\nwith none, ask for spoken replies as before (`output.audio` true when audio can play)."}},"required":["level","reasons","scopes"],"description":"The session's live-AI status: the level and every reason that holds at it, and the scopes the token\ncarries. The UI hides voice at `text` and shows \"Live answers are paused\" at `off`."}},"required":["token","expiresAt","ai"]}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`verification_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`retry_later`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/sessions/{id}/ai":{"get":{"operationId":"aiWatch","summary":"Watch the session's live-AI level","tags":["Viewer sessions"],"description":"Added within v1 (P8), capability `ai.watch`: the session's live-AI status, asked while the\nLive Room is visible — the status itself only when it changed since the client's stamp.\n\nEvery `pollMs` (6 seconds), with the last `stamp` as `since`: a top-up, a kill switch or a spend cap shows within seconds instead of at the next heartbeat. Cheap when nothing changed: no status, no database read.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}},{"name":"since","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":64}}],"responses":{"200":{"description":"Watch the session's live-AI level","content":{"application/json":{"schema":{"type":"object","properties":{"stamp":{"type":"string","minLength":1,"maxLength":64,"description":"What decides the session's level beyond the viewer's own use — the switches, the project's\nsettings, the payer's credits and caps, the key's limits — condensed: the same stamp, the same\nlevel. Opaque: compare it, never read it."},"ai":{"type":"object","properties":{"level":{"type":"string","enum":["off","text","voice"]},"reasons":{"type":"array","items":{"type":"string","minLength":1}},"scopes":{"type":"array","items":{"type":"string"}},"voiceReplies":{"type":"string","minLength":1,"maxLength":32,"description":"Added within v1: whether live replies are spoken here — the project's setting, one of\n`V1_VOICE_REPLIES` (open: a value a reader does not know reads as absent). Changing it\nmoves the AI watch's stamp. Absent: this answer does not say (a server from before, an answer\nthat reads the session alone — the events answer); keep what an earlier answer said, and\nwith none, ask for spoken replies as before (`output.audio` true when audio can play)."}},"required":["level","reasons","scopes"],"description":"The session's live-AI status, decided now: present when `since` was absent or is not `stamp`;\nabsent when nothing that decides it changed (keep what you hold)."},"pollMs":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"When to ask again, ms, while the Live Room stays visible."}},"required":["stamp","pollMs"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/sessions/{id}/events":{"post":{"operationId":"events","summary":"Record the player's facts","tags":["Viewer sessions"],"description":"With `sync=1` the request's quiz answer is graded against the private quiz and the grade comes back in the answer.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}},{"name":"sync","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991},"facts":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":64},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."}},"required":["kind","anchor"],"additionalProperties":{}}}},"required":["epoch","seq","facts"],"description":"`POST /v1/sessions/{id}/events` — the player's outbox. The player numbers the facts it posts\n1, 2, 3, … for the whole session (`seq` is the number of the first fact of this request), so the\nserver recognises a retried request (acknowledged again, applied once) and a lost one (409\n`seq_gap` with the number it expects). Facts are in story order: each anchor at or after the\nprevious one and at or after the session's head, or the request is refused with 409\n`rewind_required` (a backward move must rewind first).\n\nWith `?sync=1` the request may carry ONE `quiz.answer` fact (its last, as a rule: the player\nflushes its outbox with the answer): the server grades it against the private quiz and answers\nwith the grade. Without `sync=1` a `quiz.answer` is refused (`sync_required`), and so is a\nsecond one in the same request."}}}},"responses":{"200":{"description":"Record the player's facts","content":{"application/json":{"schema":{"type":"object","properties":{"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"ackSeq":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Every fact numbered up to here is settled (journaled or refused): drop it from the outbox."},"headSeq":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The journal's last sequence number."},"refused":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The refused fact's number (the request's `seq` + its index)."},"code":{"type":"string","minLength":1},"message":{"type":"string"}},"required":["seq","code","message"]}},"resync":{"type":"boolean","description":"The player's state may differ from the server's: read `GET …/state` before going on."},"facts":{"type":"array","items":{},"description":"Facts the SERVER wrote because of this request (a graded answer's `quiz.submitted`), in journal order: apply them."},"grade":{"type":"object","properties":{"correct":{"type":"boolean"},"points":{"type":"number","minimum":0},"feedback":{"type":"string","description":"The feedback for this answer: the chosen choice's own, else the question's correct / incorrect."},"correctAnswer":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"choice"},"choiceId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","choiceId"]},{"type":"object","properties":{"kind":{"type":"string","const":"choices"},"choiceIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","choiceIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"text"},"accepted":{"type":"array","items":{"type":"string"}}},"required":["kind","accepted"]}],"description":"Present when the quiz's reveal policy shows it now."},"attemptsLeft":{"type":"integer","minimum":0,"maximum":9007199254740991},"quizScore":{"type":"number","minimum":0,"description":"The quiz's score after this answer."},"completed":{"type":"boolean","description":"Every question of the quiz is finished."}},"required":["correct","points","attemptsLeft","quizScore","completed"],"description":"`?sync=1`: the grade of the request's quiz answer (absent when it was refused)."},"ai":{"type":"object","properties":{"level":{"type":"string","enum":["off","text","voice"]},"reasons":{"type":"array","items":{"type":"string","minLength":1}},"scopes":{"type":"array","items":{"type":"string"}},"voiceReplies":{"type":"string","minLength":1,"maxLength":32,"description":"Added within v1: whether live replies are spoken here — the project's setting, one of\n`V1_VOICE_REPLIES` (open: a value a reader does not know reads as absent). Changing it\nmoves the AI watch's stamp. Absent: this answer does not say (a server from before, an answer\nthat reads the session alone — the events answer); keep what an earlier answer said, and\nwith none, ask for spoken replies as before (`output.audio` true when audio can play)."}},"required":["level","reasons","scopes"],"description":"The session's live-AI status: the level and every reason that holds at it, and the scopes the token\ncarries. The UI hides voice at `text` and shows \"Live answers are paused\" at `off`."}},"required":["epoch","ackSeq","headSeq","ai"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`stale_epoch`, `seq_gap`, `rewind_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`body_too_large`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"`unsupported_media_type`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/sessions/{id}/rewind":{"post":{"operationId":"rewind","summary":"Go back in the story","tags":["Viewer sessions"],"description":"A dry run counts what going back erases; a commit erases it and starts the next epoch (idempotent by `rewindId`).","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"to":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"dryRun":{"default":false,"type":"boolean"},"rewindId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."}},"required":["epoch","to"],"description":"`POST /v1/sessions/{id}/rewind` — a backward move (seek, Back, chapter, a confirmed navigation)\ntruncates the history at or after `to` DURABLY, before the player moves. `dryRun` only counts\nwhat would be erased (the confirm dialog's \"This erases 4 messages and 1 quiz answer\"). A\ncommit needs a `rewindId`: a retry with the same id answers what the first attempt did.\nFlush the outbox first — facts still in it carry the old epoch and will be refused."}}}},"responses":{"200":{"description":"Go back in the story","content":{"application/json":{"schema":{"type":"object","properties":{"dryRun":{"type":"boolean"},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A dry run: the session's epoch; a commit: the NEW epoch every later write carries."},"headSeq":{"type":"integer","minimum":0,"maximum":9007199254740991},"impact":{"type":"object","properties":{"events":{"type":"integer","minimum":0,"maximum":9007199254740991},"quizAnswers":{"type":"integer","minimum":0,"maximum":9007199254740991},"turns":{"type":"integer","minimum":0,"maximum":9007199254740991},"quizIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["events","quizAnswers","turns","quizIds"],"description":"What a rewind erases: interaction facts, quiz answers, viewer questions; the quizzes whose answers go."},"fact":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"scene.entered"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"beat.entered"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"vars":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":160},"additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","maxLength":200}]}}},"required":["kind","seq","epoch","anchor","beatId","vars"]},{"type":"object","properties":{"kind":{"type":"string","const":"beat.exited"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"reason":{"type":"string","enum":["continued","timer","satisfied","timeout","jump","seek","rewind","sceneExit"]}},"required":["kind","seq","epoch","anchor","beatId","reason"]},{"type":"object","properties":{"kind":{"type":"string","const":"beat.skipped"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","beatId"]},{"type":"object","properties":{"kind":{"type":"string","const":"seek.forward"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"from":{"type":"object","properties":{"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["sceneId","ms"],"description":"A position on the story axis without a visit: a scene and an authored time in it."}},"required":["kind","seq","epoch","anchor","from"]},{"type":"object","properties":{"kind":{"type":"string","const":"object.interacted"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"behaviorId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"region":{"type":"string","minLength":1,"maxLength":64},"change":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":64},"spread":{"type":"integer","minimum":0,"maximum":9007199254740991},"visible":{"type":"boolean"}},"description":"What changed about an object: a toggle's state, a book's spread, a visibility override."},"listenerId":{"type":"string","minLength":1,"maxLength":160,"description":"Added within v1 (P17): the graph listener that heard the input."},"input":{"type":"string","minLength":1,"maxLength":32,"description":"Added within v1 (P17): the input (`click`, `key`, …), an open vocabulary."},"local":{"minItems":3,"maxItems":3,"type":"array","items":{"type":"number"},"description":"Added within v1 (P17): where on the entity the input landed, in its local frame: x, y, z."}},"required":["kind","seq","epoch","anchor","entityId"]},{"type":"object","properties":{"kind":{"type":"string","const":"object.changed"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"change":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":64},"spread":{"type":"integer","minimum":0,"maximum":9007199254740991},"visible":{"type":"boolean"}},"description":"What changed about an object: a toggle's state, a book's spread, a visibility override."},"cause":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"rule"},"ruleId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","ruleId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"eventId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","eventId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"behavior"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"behaviorId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","entityId","behaviorId"]},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"turnId":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","turnId"]},{"type":"object","properties":{"kind":{"type":"string","const":"studio"}},"required":["kind"]}],"description":"Why story state changed: a rule, a timed event, a behaviour of its own accord, the AI — or the\nauthor, from the Studio preview's Session Inspector (`studio`: Set variable), which the server\nadmits on Studio (draft) sessions only."}},"required":["kind","seq","epoch","anchor","entityId","change","cause"]},{"type":"object","properties":{"kind":{"type":"string","const":"var.changed"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"variableId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"value":{"anyOf":[{"type":"boolean","description":"A story value: a boolean, a number, or a short text (a choice is its key)."},{"type":"number","description":"A story value: a boolean, a number, or a short text (a choice is its key)."},{"type":"string","maxLength":200,"description":"A story value: a boolean, a number, or a short text (a choice is its key)."}],"description":"A story value: a boolean, a number, or a short text (a choice is its key)."},"cause":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"rule"},"ruleId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","ruleId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"eventId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","eventId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"behavior"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"behaviorId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","entityId","behaviorId"]},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"turnId":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","turnId"]},{"type":"object","properties":{"kind":{"type":"string","const":"studio"}},"required":["kind"]}],"description":"Why story state changed: a rule, a timed event, a behaviour of its own accord, the AI — or the\nauthor, from the Studio preview's Session Inspector (`studio`: Set variable), which the server\nadmits on Studio (draft) sessions only."}},"required":["kind","seq","epoch","anchor","variableId","value","cause"]},{"type":"object","properties":{"kind":{"type":"string","const":"rule.fired"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"ruleId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","ruleId"]},{"type":"object","properties":{"kind":{"type":"string","const":"quiz.started"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","quizId"]},{"type":"object","properties":{"kind":{"type":"string","const":"quiz.skipped"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","quizId"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigation.declined"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","toBeatId"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigation.arrived"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"landing":{"type":"string","enum":["chapterStart","hold","origin"]}},"required":["kind","seq","epoch","anchor","landing"]},{"type":"object","properties":{"kind":{"type":"string","const":"viewer.context"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"values":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"}]}}},"required":["kind","seq","epoch","anchor","values"]},{"type":"object","properties":{"kind":{"type":"string","const":"session.completed"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."}},"required":["kind","seq","epoch","anchor"]},{"type":"object","properties":{"kind":{"type":"string","const":"quiz.submitted"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"questionId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"respondent":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"character"},"castId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","castId"]}],"description":"Who answers a quiz: the viewer, or the viewer playing a cast member (\"as Cat\")."},"response":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"choice"},"choiceId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","choiceId"]},{"type":"object","properties":{"kind":{"type":"string","const":"choices"},"choiceIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","choiceIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","maxLength":2000}},"required":["kind","text"]}],"description":"A response to one question: a choice (single, image choice), a set of choices (multi), true or\nfalse, or a typed answer. The server trims and bounds text itself (grading refuses an answer\nover 500 characters), so the wire allows some slack rather than failing a whole request."},"correct":{"type":"boolean"},"points":{"type":"number","minimum":0},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"final":{"type":"boolean","description":"Correct, or out of attempts: the question is finished."}},"required":["kind","seq","epoch","anchor","quizId","questionId","respondent","response","correct","points","attempt","final"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigation.requested"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"landing":{"type":"string","enum":["chapterStart","hold"]},"request":{"type":"string","maxLength":2000}},"required":["kind","seq","epoch","anchor","toBeatId","landing","request"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigation.confirmed"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"landing":{"type":"string","enum":["chapterStart","hold"]},"request":{"type":"string","maxLength":2000,"description":"The request the erased `navigation.requested` carried (it survives the truncation here)."}},"required":["kind","seq","epoch","anchor","toBeatId","landing"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigation.visitStarted"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"fromBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"returned":{"type":"boolean"}},"required":["kind","seq","epoch","anchor","visit"]},{"type":"object","properties":{"kind":{"type":"string","const":"conversation.turn"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"turnId":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","seq","epoch","anchor","beatId","turnId"]},{"type":"object","properties":{"kind":{"type":"string","const":"session.rewound"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"to":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."}},"required":["kind","seq","epoch","anchor","to"]},{"type":"object","properties":{"kind":{"type":"string","const":"object.updated"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"params":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":48},"additionalProperties":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","maxLength":200}]},{"maxItems":1024,"type":"array","items":{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","maxLength":200}]}}]}},"states":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":48},"additionalProperties":{"type":"string","minLength":1,"maxLength":48}},"cause":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"rule"},"ruleId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","ruleId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"eventId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","eventId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"behavior"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"behaviorId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","entityId","behaviorId"]},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"turnId":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","turnId"]},{"type":"object","properties":{"kind":{"type":"string","const":"studio"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"input"},"listenerId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"graph"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"host"}},"required":["kind"]}],"description":"Why an object's Interaction Graph changed: a fact's causes, or a\nviewer's input (the listener that heard it), the graph on its own (a transition ending, a tween\nlanding, a timer), the host page through the SDK."}},"required":["kind","seq","epoch","anchor","entityId","cause"]}],"description":"A commit: the `session.rewound` fact that ends the old epoch (apply it, then refold)."},"facts":{"minItems":1,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"scene.entered"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"beat.entered"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"vars":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":160},"additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","maxLength":200}]}}},"required":["kind","seq","epoch","anchor","beatId","vars"]},{"type":"object","properties":{"kind":{"type":"string","const":"beat.exited"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"reason":{"type":"string","enum":["continued","timer","satisfied","timeout","jump","seek","rewind","sceneExit"]}},"required":["kind","seq","epoch","anchor","beatId","reason"]},{"type":"object","properties":{"kind":{"type":"string","const":"beat.skipped"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","beatId"]},{"type":"object","properties":{"kind":{"type":"string","const":"seek.forward"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"from":{"type":"object","properties":{"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["sceneId","ms"],"description":"A position on the story axis without a visit: a scene and an authored time in it."}},"required":["kind","seq","epoch","anchor","from"]},{"type":"object","properties":{"kind":{"type":"string","const":"object.interacted"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"behaviorId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"region":{"type":"string","minLength":1,"maxLength":64},"change":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":64},"spread":{"type":"integer","minimum":0,"maximum":9007199254740991},"visible":{"type":"boolean"}},"description":"What changed about an object: a toggle's state, a book's spread, a visibility override."},"listenerId":{"type":"string","minLength":1,"maxLength":160,"description":"Added within v1 (P17): the graph listener that heard the input."},"input":{"type":"string","minLength":1,"maxLength":32,"description":"Added within v1 (P17): the input (`click`, `key`, …), an open vocabulary."},"local":{"minItems":3,"maxItems":3,"type":"array","items":{"type":"number"},"description":"Added within v1 (P17): where on the entity the input landed, in its local frame: x, y, z."}},"required":["kind","seq","epoch","anchor","entityId"]},{"type":"object","properties":{"kind":{"type":"string","const":"object.changed"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"change":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":64},"spread":{"type":"integer","minimum":0,"maximum":9007199254740991},"visible":{"type":"boolean"}},"description":"What changed about an object: a toggle's state, a book's spread, a visibility override."},"cause":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"rule"},"ruleId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","ruleId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"eventId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","eventId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"behavior"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"behaviorId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","entityId","behaviorId"]},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"turnId":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","turnId"]},{"type":"object","properties":{"kind":{"type":"string","const":"studio"}},"required":["kind"]}],"description":"Why story state changed: a rule, a timed event, a behaviour of its own accord, the AI — or the\nauthor, from the Studio preview's Session Inspector (`studio`: Set variable), which the server\nadmits on Studio (draft) sessions only."}},"required":["kind","seq","epoch","anchor","entityId","change","cause"]},{"type":"object","properties":{"kind":{"type":"string","const":"var.changed"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"variableId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"value":{"anyOf":[{"type":"boolean","description":"A story value: a boolean, a number, or a short text (a choice is its key)."},{"type":"number","description":"A story value: a boolean, a number, or a short text (a choice is its key)."},{"type":"string","maxLength":200,"description":"A story value: a boolean, a number, or a short text (a choice is its key)."}],"description":"A story value: a boolean, a number, or a short text (a choice is its key)."},"cause":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"rule"},"ruleId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","ruleId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"eventId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","eventId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"behavior"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"behaviorId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","entityId","behaviorId"]},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"turnId":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","turnId"]},{"type":"object","properties":{"kind":{"type":"string","const":"studio"}},"required":["kind"]}],"description":"Why story state changed: a rule, a timed event, a behaviour of its own accord, the AI — or the\nauthor, from the Studio preview's Session Inspector (`studio`: Set variable), which the server\nadmits on Studio (draft) sessions only."}},"required":["kind","seq","epoch","anchor","variableId","value","cause"]},{"type":"object","properties":{"kind":{"type":"string","const":"rule.fired"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"ruleId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","ruleId"]},{"type":"object","properties":{"kind":{"type":"string","const":"quiz.started"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","quizId"]},{"type":"object","properties":{"kind":{"type":"string","const":"quiz.skipped"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","quizId"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigation.declined"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","seq","epoch","anchor","toBeatId"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigation.arrived"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"landing":{"type":"string","enum":["chapterStart","hold","origin"]}},"required":["kind","seq","epoch","anchor","landing"]},{"type":"object","properties":{"kind":{"type":"string","const":"viewer.context"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"values":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"}]}}},"required":["kind","seq","epoch","anchor","values"]},{"type":"object","properties":{"kind":{"type":"string","const":"session.completed"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."}},"required":["kind","seq","epoch","anchor"]},{"type":"object","properties":{"kind":{"type":"string","const":"quiz.submitted"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"questionId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"respondent":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"character"},"castId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","castId"]}],"description":"Who answers a quiz: the viewer, or the viewer playing a cast member (\"as Cat\")."},"response":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"choice"},"choiceId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","choiceId"]},{"type":"object","properties":{"kind":{"type":"string","const":"choices"},"choiceIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","choiceIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","maxLength":2000}},"required":["kind","text"]}],"description":"A response to one question: a choice (single, image choice), a set of choices (multi), true or\nfalse, or a typed answer. The server trims and bounds text itself (grading refuses an answer\nover 500 characters), so the wire allows some slack rather than failing a whole request."},"correct":{"type":"boolean"},"points":{"type":"number","minimum":0},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"final":{"type":"boolean","description":"Correct, or out of attempts: the question is finished."}},"required":["kind","seq","epoch","anchor","quizId","questionId","respondent","response","correct","points","attempt","final"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigation.requested"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"landing":{"type":"string","enum":["chapterStart","hold"]},"request":{"type":"string","maxLength":2000}},"required":["kind","seq","epoch","anchor","toBeatId","landing","request"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigation.confirmed"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"landing":{"type":"string","enum":["chapterStart","hold"]},"request":{"type":"string","maxLength":2000,"description":"The request the erased `navigation.requested` carried (it survives the truncation here)."}},"required":["kind","seq","epoch","anchor","toBeatId","landing"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigation.visitStarted"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"fromBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"returned":{"type":"boolean"}},"required":["kind","seq","epoch","anchor","visit"]},{"type":"object","properties":{"kind":{"type":"string","const":"conversation.turn"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"turnId":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","seq","epoch","anchor","beatId","turnId"]},{"type":"object","properties":{"kind":{"type":"string","const":"session.rewound"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"to":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."}},"required":["kind","seq","epoch","anchor","to"]},{"type":"object","properties":{"kind":{"type":"string","const":"object.updated"},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The journal's order: strictly increasing, assigned by the server."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"pinned":{"type":"boolean","description":"Kept by the AI log's window trims (navigation markers); a rewind still truncates it."},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"params":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":48},"additionalProperties":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","maxLength":200}]},{"maxItems":1024,"type":"array","items":{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","maxLength":200}]}}]}},"states":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":48},"additionalProperties":{"type":"string","minLength":1,"maxLength":48}},"cause":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"rule"},"ruleId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","ruleId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"event"},"eventId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","eventId","sceneId"]},{"type":"object","properties":{"kind":{"type":"string","const":"behavior"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"behaviorId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","entityId","behaviorId"]},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"turnId":{"type":"string","minLength":1,"maxLength":160}},"required":["kind","turnId"]},{"type":"object","properties":{"kind":{"type":"string","const":"studio"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"input"},"listenerId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"graph"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"host"}},"required":["kind"]}],"description":"Why an object's Interaction Graph changed: a fact's causes, or a\nviewer's input (the listener that heard it), the graph on its own (a transition ending, a tween\nlanding, a timer), the host page through the SDK."}},"required":["kind","seq","epoch","anchor","entityId","cause"]}]},"description":"A commit (added within v1, P8): every fact it journaled, in order — `fact` first, then the\nnarrator's backward navigation the rewind confirmed (`navigation.confirmed`, pinned), when it\nconfirmed one. Apply them all, then refold: nothing else needs reading back. Absent (a dry\nrun, a server from before): apply `fact`; a confirmed navigation is only in `GET …/state`."}},"required":["dryRun","epoch","headSeq","impact"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`stale_epoch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/sessions/{id}/state":{"get":{"operationId":"state","summary":"Read the session's state","tags":["Viewer sessions"],"parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}},{"name":"sinceSeq","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"Read the session's state","content":{"application/json":{"schema":{"type":"object","properties":{"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"headSeq":{"type":"integer","minimum":0,"maximum":9007199254740991},"state":{"type":"object","properties":{"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"lastSeq":{"type":"integer","minimum":0,"maximum":9007199254740991},"head":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"The furthest story position recorded: the forward-only cursor."},"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"openBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"vars":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":160},"additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","maxLength":200}]}},"objects":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":160},"additionalProperties":{"type":"object","properties":{"clicks":{"type":"integer","minimum":0,"maximum":9007199254740991},"state":{"type":"string","description":"A toggle's state; an Interaction Graph's layer `main` (kept forever)."},"spread":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A book's spread (kept forever)."},"visible":{"type":"boolean"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","maxLength":200}]},{"maxItems":1024,"type":"array","items":{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string","maxLength":200}]}}]},"description":"Added within v1 (P17): an Interaction Graph's committed session params that changed."},"states":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Added within v1 (P17): an Interaction Graph's committed session layers' states, by layer."}},"required":["clicks"]}},"beats":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":160},"additionalProperties":{"type":"object","properties":{"entries":{"type":"integer","minimum":0,"maximum":9007199254740991},"visited":{"type":"boolean"},"completed":{"type":"boolean"},"skipped":{"type":"boolean"},"turns":{"type":"integer","minimum":0,"maximum":9007199254740991},"open":{"type":"boolean"},"lastExit":{"type":"string"}},"required":["entries","visited","completed","skipped","turns","open"]}},"quizzes":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":160},"additionalProperties":{"type":"object","properties":{"started":{"type":"boolean"},"skipped":{"type":"boolean"},"questions":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":160},"additionalProperties":{"type":"object","properties":{"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"answered":{"type":"boolean"},"correct":{"type":"boolean"},"finished":{"type":"boolean"},"points":{"type":"number","minimum":0},"response":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"choice"},"choiceId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","choiceId"]},{"type":"object","properties":{"kind":{"type":"string","const":"choices"},"choiceIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","choiceIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","maxLength":2000}},"required":["kind","text"]}],"description":"A response to one question: a choice (single, image choice), a set of choices (multi), true or\nfalse, or a typed answer. The server trims and bounds text itself (grading refuses an answer\nover 500 characters), so the wire allows some slack rather than failing a whole request."},"respondent":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"character"},"castId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","castId"]}],"description":"Who answers a quiz: the viewer, or the viewer playing a cast member (\"as Cat\")."}},"required":["attempts","answered","correct","finished","points"]}},"last":{"type":"object","properties":{"questionId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"response":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"choice"},"choiceId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","choiceId"]},{"type":"object","properties":{"kind":{"type":"string","const":"choices"},"choiceIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","choiceIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","maxLength":2000}},"required":["kind","text"]}],"description":"A response to one question: a choice (single, image choice), a set of choices (multi), true or\nfalse, or a typed answer. The server trims and bounds text itself (grading refuses an answer\nover 500 characters), so the wire allows some slack rather than failing a whole request."},"respondent":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"character"},"castId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","castId"]}],"description":"Who answers a quiz: the viewer, or the viewer playing a cast member (\"as Cat\")."},"correct":{"type":"boolean"},"points":{"type":"number","minimum":0},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["questionId","response","respondent","correct","points","attempt"]},"score":{"type":"number","minimum":0},"correctCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"boolean"}},"required":["started","skipped","questions","score","correctCount","completed"]}},"sceneEntries":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":160},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"firedOnce":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":160},"additionalProperties":{"type":"string"}},"turns":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"boolean"},"viewerContext":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"pendingNavigation":{"type":"object","properties":{"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"landing":{"type":"string","minLength":1},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."}},"required":["toBeatId","landing","anchor"]}},"required":["epoch","lastSeq","head","visit","vars","objects","beats","quizzes","sceneEntries","firedOnce","turns","completed","viewerContext"],"description":"The session's state as the server folded it (`@jami3d/interaction` `SessionState`, positions\nby scene id): the same function over the same journal gives the player the same state."},"facts":{"type":"array","items":{},"description":"A journal as a reader takes it: every fact it knows, in order; a fact of a kind it does not\nknow (a newer server's) is skipped rather than failing the whole answer."},"more":{"type":"boolean","description":"More kept facts follow the last one here: ask again with `sinceSeq` = its seq."}},"required":["epoch","headSeq","state","facts","more"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/sessions/{id}/result":{"get":{"operationId":"result","summary":"Read the session's result","tags":["Viewer sessions"],"description":"Needs the `results` scope. Other formats are the learner report: a page, a Word document or a workbook.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"schema":{"default":"json","type":"string","enum":["json","html","docx","xlsx"]}},{"name":"template","in":"query","required":false,"description":"A report template of the project (`html`, `docx`, `xlsx`); absent: the default layout.","schema":{"type":"string","minLength":1,"maxLength":160}}],"responses":{"200":{"description":"`GET /v1/sessions/{id}/result` (`format=json`).","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"projectId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"releaseId":{"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)$","description":"The release played (a draft session has none)."},"title":{"type":"string"},"startedAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"lastSeenAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","projectId","title","startedAt","lastSeenAt","durationMs"]},"result":{"type":"object","properties":{"viewer":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"anonymous"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"external"},"externalUserId":{"type":"string","minLength":1}},"required":["kind","externalUserId"]},{"type":"object","properties":{"kind":{"type":"string","const":"account"},"userId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."}},"required":["kind","userId"]}],"description":"Who a result is about: nobody by name, a secure embed's learner, a signed-in account."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"boolean"},"beats":{"type":"array","items":{"type":"object","properties":{"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"name":{"type":"string"},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"required":{"type":"boolean"},"status":{"type":"string","minLength":1,"description":"`completed`, `skipped`, `visited` or `notVisited`."},"turns":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["beatId","alias","name","sceneId","required","status","turns"]}},"quizzes":{"type":"array","items":{"type":"object","properties":{"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","minLength":1,"description":"`completed`, `inProgress`, `skipped` or `notStarted`."},"score":{"type":"number","minimum":0},"maxScore":{"type":"number","minimum":0},"percent":{"type":"number","minimum":0,"maximum":100,"description":"0–100, one decimal."},"passed":{"type":"boolean","description":"Against the quiz's pass mark, once the quiz is completed."},"correctCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"questions":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"key":{"type":"string"},"prompt":{"type":"string"},"answered":{"type":"boolean"},"correct":{"type":"boolean"},"points":{"type":"number","minimum":0},"maxPoints":{"type":"number","minimum":0},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"response":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"choice"},"choiceId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","choiceId"]},{"type":"object","properties":{"kind":{"type":"string","const":"choices"},"choiceIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","choiceIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","maxLength":2000}},"required":["kind","text"]}],"description":"A response to one question: a choice (single, image choice), a set of choices (multi), true or\nfalse, or a typed answer. The server trims and bounds text itself (grading refuses an answer\nover 500 characters), so the wire allows some slack rather than failing a whole request."},"responseText":{"type":"string","description":"The response in words: the chosen choices' text, true / false, the typed answer."},"respondent":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"character"},"castId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","castId"]}],"description":"Who answers a quiz: the viewer, or the viewer playing a cast member (\"as Cat\")."}},"required":["questionId","key","answered","correct","points","maxPoints","attempts"]}}},"required":["quizId","alias","status","score","maxScore","percent","correctCount","questions"]}},"variables":{"type":"array","items":{"type":"object","properties":{"variableId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"type":{"type":"string","minLength":1},"value":{"anyOf":[{"type":"boolean","description":"A story value: a boolean, a number, or a short text (a choice is its key)."},{"type":"number","description":"A story value: a boolean, a number, or a short text (a choice is its key)."},{"type":"string","maxLength":200,"description":"A story value: a boolean, a number, or a short text (a choice is its key)."}],"description":"A story value: a boolean, a number, or a short text (a choice is its key)."}},"required":["variableId","alias","type","value"]}},"items":{"type":"array","items":{"type":"object","properties":{"resultId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","minLength":1,"description":"`quiz`, `score` or `flag`."},"value":{"anyOf":[{"type":"number"},{"type":"boolean"}]}},"required":["resultId","alias","label","kind","value"]}},"totals":{"type":"object","properties":{"score":{"type":"number","minimum":0},"maxScore":{"type":"number","minimum":0},"percent":{"type":"number","minimum":0,"maximum":100},"passed":{"type":"boolean"},"correctCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"questionCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"answeredCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"beatsCompleted":{"type":"integer","minimum":0,"maximum":9007199254740991},"beatsTotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"completion":{"type":"number","minimum":0,"maximum":1,"description":"Completed Beats ÷ all Beats (1 when there are none)."}},"required":["score","maxScore","percent","correctCount","questionCount","answeredCount","beatsCompleted","beatsTotal","completion"]}},"required":["viewer","epoch","completed","beats","quizzes","variables","items","totals"]}},"required":["session","result"],"description":"`GET /v1/sessions/{id}/result` (`format=json`)."}},"text/html":{"schema":{"description":"`format=html`"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"description":"`format=docx`"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"description":"`format=xlsx`"}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`scope_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/sessions/{id}/telemetry":{"post":{"operationId":"telemetry","summary":"Send content-free telemetry","tags":["Viewer sessions"],"description":"The viewer token rides in the body (`token`): `navigator.sendBeacon` sets no headers, and may send the JSON as `text/plain`. Unknown or malformed events are dropped, never stored.\n\nThe viewer token travels in the request body (`token`), not in a header.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":4096},"events":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"maxLength":64}},"required":["type"],"additionalProperties":{}}}},"required":["token","events"],"description":"The request: the viewer token and up to 50 events, each validated on its own (an event of an\nunknown type, or a malformed one, is dropped and counted)."}},"text/plain":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":4096},"events":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"maxLength":64}},"required":["type"],"additionalProperties":{}}}},"required":["token","events"],"description":"The request: the viewer token and up to 50 events, each validated on its own (an event of an\nunknown type, or a malformed one, is dropped and counted)."}}}},"responses":{"202":{"description":"202: what was kept. A beacon never reads it; a `fetch` with `keepalive` may.","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991},"dropped":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["accepted","dropped"],"description":"202: what was kept. A beacon never reads it; a `fetch` with `keepalive` may."}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`body_too_large`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"`unsupported_media_type`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/v1/sessions/{id}/debug-log":{"post":{"operationId":"debugLog","summary":"Report the browser's lines of a debug capture","tags":["Viewer sessions"],"description":"The browser's lines of a staff debug capture: kept only while the session, its project or its\nsigned-in viewer is being captured.\n\nOffered when the mint announces the `debug-log` capability. Every answer says whether the session is being captured (`capturing`); while it is not, every line is dropped and the browser stops reporting. Send no lines to ask. Lines are redacted before they are stored: no query strings, no tokens.\n\nThe viewer token travels in the request body (`token`), not in a header.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":4096},"lines":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":32}},"required":["kind"],"additionalProperties":{}}}},"required":["token","lines"],"description":"The request: the viewer token and up to 50 lines, each validated on its own. No lines at all\nasks only whether the session is being captured."}},"text/plain":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":4096},"lines":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":32}},"required":["kind"],"additionalProperties":{}}}},"required":["token","lines"],"description":"The request: the viewer token and up to 50 lines, each validated on its own. No lines at all\nasks only whether the session is being captured."}}}},"responses":{"202":{"description":"202: what was kept, and whether the session is being captured now.","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Lines kept for the capture."},"dropped":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Lines refused: malformed, of an unknown kind, or sent while nothing is captured."},"capturing":{"type":"boolean","description":"A capture covers this session now: keep reporting. False: stop until asked again."}},"required":["accepted","dropped","capturing"],"description":"202: what was kept, and whether the session is being captured now."}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`scope_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`body_too_large`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"`unsupported_media_type`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/v1/sessions/{id}/reports":{"post":{"operationId":"reports","summary":"Report a problem with the experience","tags":["Viewer sessions"],"description":"The Live Room's notice (DSA Art. 16); a token past its expiry still reports, for a day.\n\nAt most five reports a session an hour.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","enum":["inappropriate","ai_misbehaviour","copyright","broken","other"]},"details":{"type":"string","minLength":1,"maxLength":2000,"description":"What the viewer adds in their own words."}},"required":["reason"]}}}},"responses":{"201":{"description":"`201`: the confirmation of receipt.","content":{"application/json":{"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)$","description":"The notice's reference."},"receivedAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."}},"required":["id","receivedAt"],"description":"`201`: the confirmation of receipt."}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/projects/{id}/card":{"get":{"operationId":"card","summary":"Read a project's card","tags":["Embeds"],"description":"Public and cached a minute. With `publishableKey` it is also the origin check the SDK makes before mounting the iframe; with `cardToken` it describes a private or secure-only project (and is never cached).","parameters":[{"name":"id","in":"path","required":true,"description":"The project's id.","schema":{"type":"string"}},{"name":"cardToken","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":4096}},{"name":"publishableKey","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"locale","in":"query","required":false,"description":"A UI or reply language: a BCP 47 tag (`en`, `pt-BR`, `zh-Hant-TW`).","schema":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$"}}],"responses":{"200":{"description":"`GET /v1/projects/{id}/card` — EmbedMeta v1: the title, the creator, the poster (renditions,\nblurhash and dominant colour for the placeholder), the length, and the EU AI Act Art. 50\ndisclosure the facade shows before anything plays — and, added within v1 (P9), the poster's\n`<picture>` sources, the hover preview, who a viewer may talk to and the chapters with their\nthumbnails. Fields added later are optional: a reader branches on their absence.","content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"projectId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"releaseId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"title":{"type":"string"},"creator":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"contentLanguage":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"A UI or reply language: a BCP 47 tag (`en`, `pt-BR`, `zh-Hant-TW`)."},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The timeline scenes' authored length; interactive scenes add none."},"scenes":{"type":"integer","minimum":0,"maximum":9007199254740991},"interactive":{"type":"boolean","description":"Viewers act in it: Beats, or an interactive scene."},"poster":{"type":"object","properties":{"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"blurhash":{"type":"string","minLength":1},"color":{"type":"string","minLength":1,"description":"`#rrggbb`."},"variants":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"description":"`image/avif`, `image/webp` or `image/jpeg`."},"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"url":{"type":"string","minLength":1}},"required":["type","width","height","url"]}},"sources":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"description":"`image/avif`, `image/webp` or `image/jpeg`; a reader skips a type it does not know."},"srcset":{"type":"string","minLength":1}},"required":["type","srcset"]},"description":"The renditions as `<picture>` sources, lightest format first (P9)."},"fallbackUrl":{"type":"string","minLength":1,"description":"One rendition every browser reads (a JPEG), for the `<img>` (P9)."}},"required":["width","height","blurhash","color","variants"]},"preview":{"type":"object","properties":{"url":{"type":"string","minLength":1},"type":{"type":"string","minLength":1,"description":"`video/mp4`."},"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"durationMs":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["url","type","width","height","durationMs","bytes"],"description":"The hover preview (P9): a few silent seconds of the experience, small enough to play on\nhover (a 640 × 360, 24 fps H.264 MP4 under 1.5 MB). Absent until one is rendered."},"ai":{"type":"object","properties":{"aiCharacters":{"type":"boolean"},"narratorAi":{"type":"boolean"},"syntheticVoice":{"type":"boolean"},"liveAi":{"type":"boolean"},"characters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"description":"Who a viewer may talk to — the AI characters (and speaking props) that answer, by name, in\nthe release's cast order; empty when the experience has no live conversation (P9)."},"voice":{"type":"boolean","description":"A viewer may also talk to them by voice (P9)."},"notice":{"type":"string","minLength":1,"description":"The disclosure in words, as the facade says it before anything plays (\"Made with AI: AI\ncharacters and synthetic voices.\"), in the UI language nearest to the request's `locale`\n(P8). Absent when nothing is AI — and from a server before it: a reader then words the\nflags itself."},"unknown":{"type":"boolean","description":"The release's stored disclosure could not be read: the flags keep what could, and\n`notice` is the generic AI notice — the card fails closed, never \"no AI\" (P8). Absent: the\nflags are exact."}},"required":["aiCharacters","narratorAi","syntheticVoice","liveAi"],"description":"EU AI Act Art. 50: who is AI and what is synthetic. Never hidden by a host option."},"chapters":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"description":"`scene` or `beat`; a reader skips a kind it does not know."},"id":{"type":"string","minLength":1,"description":"The scene's id, or the Beat's."},"sceneId":{"type":"string","minLength":1,"description":"The scene the chapter is in."},"title":{"type":"string","description":"The scene's name, or the Beat's."},"alias":{"type":"string","minLength":1,"description":"A Beat's alias: what `goToBeat` and a watch link's `?beat=` take. Absent for a scene."},"tags":{"type":"array","items":{"type":"string","minLength":1},"description":"A Beat's chapter tags."},"startMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Where the chapter starts in its scene, in authored milliseconds."},"thumbnail":{"type":"object","properties":{"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"blurhash":{"type":"string","minLength":1},"color":{"type":"string","minLength":1,"description":"`#rrggbb`."},"sources":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"description":"`image/avif`, `image/webp` or `image/jpeg`; a reader skips a type it does not know."},"srcset":{"type":"string","minLength":1}},"required":["type","srcset"]}},"fallbackUrl":{"type":"string","minLength":1}},"required":["width","height","blurhash","color","sources","fallbackUrl"],"description":"A 16:9 frame of the chapter (480 × 270 and narrower); absent until one is rendered."}},"required":["kind","id","sceneId","title","startMs"]},"description":"The chapters in play order: each scene, then its named or tagged Beats (P9)."},"aspect":{"type":"string","minLength":1,"description":"The frame the experience is authored for (`16:9`, `9:16`, `1:1`, `4:3`) (P9)."},"embedUrl":{"type":"string","minLength":1,"description":"The embed document (`https://embed.jami.live/p/{projectId}`)."}},"required":["v","projectId","releaseId","title","creator","contentLanguage","durationMs","scenes","interactive","ai","embedUrl"],"description":"`GET /v1/projects/{id}/card` — EmbedMeta v1: the title, the creator, the poster (renditions,\nblurhash and dominant colour for the placeholder), the length, and the EU AI Act Art. 50\ndisclosure the facade shows before anything plays — and, added within v1 (P9), the poster's\n`<picture>` sources, the hover preview, who a viewer may talk to and the chapters with their\nthumbnails. Fields added later are optional: a reader branches on their absence."}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`key_invalid`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`origin_not_allowed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`release_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/v1/listings/{slug}/card":{"get":{"operationId":"listingCard","summary":"Read a listing's card","tags":["Embeds"],"description":"Added within v1 (P8): the card of a marketplace listing, named by its slug (an earlier slug\ntoo) — the SDK's `listing` option, which learns the project its embed document plays\n(`projectId`) from it. The same card as the project's, reached the way `/w/{slug}` reaches the\nlisting: an unlisted listing opens to its slug; a private, removed or unpublished one is the\n404 of a slug that never existed.\n\nThe project card of a marketplace listing, for `createPlayer({ listing })`: its `projectId` names the embed document. An unlisted listing answers to its slug; a private, removed or unpublished one is the same 404 as a slug that never existed. Public and cached a minute; the credentials work as on the project's card.","parameters":[{"name":"slug","in":"path","required":true,"description":"The listing's slug, as in `https://jami.live/w/{slug}` (an earlier slug of a renamed listing works too).","schema":{"type":"string"}},{"name":"cardToken","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":4096}},{"name":"publishableKey","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"locale","in":"query","required":false,"description":"A UI or reply language: a BCP 47 tag (`en`, `pt-BR`, `zh-Hant-TW`).","schema":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$"}}],"responses":{"200":{"description":"`GET /v1/projects/{id}/card` — EmbedMeta v1: the title, the creator, the poster (renditions,\nblurhash and dominant colour for the placeholder), the length, and the EU AI Act Art. 50\ndisclosure the facade shows before anything plays — and, added within v1 (P9), the poster's\n`<picture>` sources, the hover preview, who a viewer may talk to and the chapters with their\nthumbnails. Fields added later are optional: a reader branches on their absence.","content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"projectId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"releaseId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"title":{"type":"string"},"creator":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"contentLanguage":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"A UI or reply language: a BCP 47 tag (`en`, `pt-BR`, `zh-Hant-TW`)."},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The timeline scenes' authored length; interactive scenes add none."},"scenes":{"type":"integer","minimum":0,"maximum":9007199254740991},"interactive":{"type":"boolean","description":"Viewers act in it: Beats, or an interactive scene."},"poster":{"type":"object","properties":{"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"blurhash":{"type":"string","minLength":1},"color":{"type":"string","minLength":1,"description":"`#rrggbb`."},"variants":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"description":"`image/avif`, `image/webp` or `image/jpeg`."},"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"url":{"type":"string","minLength":1}},"required":["type","width","height","url"]}},"sources":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"description":"`image/avif`, `image/webp` or `image/jpeg`; a reader skips a type it does not know."},"srcset":{"type":"string","minLength":1}},"required":["type","srcset"]},"description":"The renditions as `<picture>` sources, lightest format first (P9)."},"fallbackUrl":{"type":"string","minLength":1,"description":"One rendition every browser reads (a JPEG), for the `<img>` (P9)."}},"required":["width","height","blurhash","color","variants"]},"preview":{"type":"object","properties":{"url":{"type":"string","minLength":1},"type":{"type":"string","minLength":1,"description":"`video/mp4`."},"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"durationMs":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"bytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["url","type","width","height","durationMs","bytes"],"description":"The hover preview (P9): a few silent seconds of the experience, small enough to play on\nhover (a 640 × 360, 24 fps H.264 MP4 under 1.5 MB). Absent until one is rendered."},"ai":{"type":"object","properties":{"aiCharacters":{"type":"boolean"},"narratorAi":{"type":"boolean"},"syntheticVoice":{"type":"boolean"},"liveAi":{"type":"boolean"},"characters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"description":"Who a viewer may talk to — the AI characters (and speaking props) that answer, by name, in\nthe release's cast order; empty when the experience has no live conversation (P9)."},"voice":{"type":"boolean","description":"A viewer may also talk to them by voice (P9)."},"notice":{"type":"string","minLength":1,"description":"The disclosure in words, as the facade says it before anything plays (\"Made with AI: AI\ncharacters and synthetic voices.\"), in the UI language nearest to the request's `locale`\n(P8). Absent when nothing is AI — and from a server before it: a reader then words the\nflags itself."},"unknown":{"type":"boolean","description":"The release's stored disclosure could not be read: the flags keep what could, and\n`notice` is the generic AI notice — the card fails closed, never \"no AI\" (P8). Absent: the\nflags are exact."}},"required":["aiCharacters","narratorAi","syntheticVoice","liveAi"],"description":"EU AI Act Art. 50: who is AI and what is synthetic. Never hidden by a host option."},"chapters":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"description":"`scene` or `beat`; a reader skips a kind it does not know."},"id":{"type":"string","minLength":1,"description":"The scene's id, or the Beat's."},"sceneId":{"type":"string","minLength":1,"description":"The scene the chapter is in."},"title":{"type":"string","description":"The scene's name, or the Beat's."},"alias":{"type":"string","minLength":1,"description":"A Beat's alias: what `goToBeat` and a watch link's `?beat=` take. Absent for a scene."},"tags":{"type":"array","items":{"type":"string","minLength":1},"description":"A Beat's chapter tags."},"startMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Where the chapter starts in its scene, in authored milliseconds."},"thumbnail":{"type":"object","properties":{"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"blurhash":{"type":"string","minLength":1},"color":{"type":"string","minLength":1,"description":"`#rrggbb`."},"sources":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"description":"`image/avif`, `image/webp` or `image/jpeg`; a reader skips a type it does not know."},"srcset":{"type":"string","minLength":1}},"required":["type","srcset"]}},"fallbackUrl":{"type":"string","minLength":1}},"required":["width","height","blurhash","color","sources","fallbackUrl"],"description":"A 16:9 frame of the chapter (480 × 270 and narrower); absent until one is rendered."}},"required":["kind","id","sceneId","title","startMs"]},"description":"The chapters in play order: each scene, then its named or tagged Beats (P9)."},"aspect":{"type":"string","minLength":1,"description":"The frame the experience is authored for (`16:9`, `9:16`, `1:1`, `4:3`) (P9)."},"embedUrl":{"type":"string","minLength":1,"description":"The embed document (`https://embed.jami.live/p/{projectId}`)."}},"required":["v","projectId","releaseId","title","creator","contentLanguage","durationMs","scenes","interactive","ai","embedUrl"],"description":"`GET /v1/projects/{id}/card` — EmbedMeta v1: the title, the creator, the poster (renditions,\nblurhash and dominant colour for the placeholder), the length, and the EU AI Act Art. 50\ndisclosure the facade shows before anything plays — and, added within v1 (P9), the poster's\n`<picture>` sources, the hover preview, who a viewer may talk to and the chapters with their\nthumbnails. Fields added later are optional: a reader branches on their absence."}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`key_invalid`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`origin_not_allowed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`release_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/v1/oembed":{"get":{"operationId":"oembed","summary":"oEmbed","tags":["Embeds"],"description":"oEmbed 1.0 for an experience's embed or watch address: a `rich` answer with an iframe of the embed document. JSON only.","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"maxwidth","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":10000}},{"name":"maxheight","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":10000}},{"name":"format","in":"query","required":false,"schema":{"default":"json","type":"string","enum":["json","xml"]}}],"responses":{"200":{"description":"A `rich` oEmbed answer: an iframe of the embed document.","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","const":"1.0"},"type":{"type":"string","const":"rich"},"provider_name":{"type":"string"},"provider_url":{"type":"string"},"title":{"type":"string"},"author_name":{"type":"string"},"html":{"type":"string","minLength":1},"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"thumbnail_url":{"type":"string"},"thumbnail_width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"thumbnail_height":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"cache_age":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["version","type","provider_name","provider_url","title","html","width","height"],"description":"A `rich` oEmbed answer: an iframe of the embed document."}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"501":{"description":"`format_unsupported`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/.well-known/jwks.json":{"get":{"operationId":"jwks","summary":"The viewer-token signing keys","tags":["Embeds"],"description":"Cached five minutes. A new key is published a rotation ahead of signing with it.","responses":{"200":{"description":"`GET /.well-known/jwks.json`: the keys viewer tokens verify against (the signing key and its predecessor).","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"minItems":1,"type":"array","items":{"type":"object","properties":{"kty":{"type":"string","const":"EC"},"crv":{"type":"string","const":"P-256"},"x":{"type":"string","minLength":1},"y":{"type":"string","minLength":1},"kid":{"type":"string","minLength":1},"alg":{"type":"string","const":"ES256"},"use":{"type":"string","const":"sig"}},"required":["kty","crv","x","y","kid","alg","use"]}}},"required":["keys"],"description":"`GET /.well-known/jwks.json`: the keys viewer tokens verify against (the signing key and its predecessor)."}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/v1/sessions/{id}/turns":{"post":{"operationId":"turns","summary":"Run a turn (event stream)","tags":["Conversation"],"description":"A fetch POST answered with Server-Sent-Events framing: each event is an `event: <type>` line and a `data: <json>` line, and a comment line (`: hb`) comes every 15 s. Errors before the stream opens are `/v1` errors; a refusal is the `turn.refused` event, not an error. Closing the request cancels the turn.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"},"clientTurnId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"position":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"view":{"type":"object","properties":{"focus":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$","description":"A speaker's or an object's alias, as the documents spell it (`teacher_mouse`, `cat_book`)."},"lookingAt":{"maxItems":16,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$"}}},"description":"What the viewer sees, by alias only — the focused object, the ones in view — validated by the\nserver against what is perceivable at the turn's position. Never free text."},"locale":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"The reply language; absent: the session's."},"output":{"type":"object","properties":{"audio":{"type":"boolean"}},"required":["audio"],"description":"Absent: `{ audio: true }`."},"addressee":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$","description":"The speaker asked: the narrator's or a speaking character's or prop's alias."},"text":{"type":"string","minLength":1,"maxLength":500},"source":{"type":"string","enum":["viewer_text","viewer_voice"],"description":"Absent: `viewer_text`."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"The Beat it is asked at (an interactive scene's synthetic Beat is `scene:{sceneId}`)."}},"required":["kind","clientTurnId","epoch","position","addressee","text","beatId"],"description":"A typed (or locally transcribed) question to ONE addressee at an open Beat."},{"type":"object","properties":{"kind":{"type":"string","const":"viewer_audio"},"clientTurnId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"position":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"view":{"type":"object","properties":{"focus":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$","description":"A speaker's or an object's alias, as the documents spell it (`teacher_mouse`, `cat_book`)."},"lookingAt":{"maxItems":16,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$"}}},"description":"What the viewer sees, by alias only — the focused object, the ones in view — validated by the\nserver against what is perceivable at the turn's position. Never free text."},"locale":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"The reply language; absent: the session's."},"output":{"type":"object","properties":{"audio":{"type":"boolean"}},"required":["audio"],"description":"Absent: `{ audio: true }`."},"addressee":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$","description":"A speaker's or an object's alias, as the documents spell it (`teacher_mouse`, `cat_book`)."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"uploadRef":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","clientTurnId","epoch","position","addressee","beatId","uploadRef"],"description":"A recorded push-to-talk clip for networks that block WebRTC: uploaded first (≤ 8 MB), named\nhere by its upload reference, transcribed by the server, then answered like a typed question."},{"type":"object","properties":{"kind":{"type":"string","const":"ai_line"},"clientTurnId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"position":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"view":{"type":"object","properties":{"focus":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$","description":"A speaker's or an object's alias, as the documents spell it (`teacher_mouse`, `cat_book`)."},"lookingAt":{"maxItems":16,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$"}}},"description":"What the viewer sees, by alias only — the focused object, the ones in view — validated by the\nserver against what is perceivable at the turn's position. Never free text."},"locale":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"The reply language; absent: the session's."},"output":{"type":"object","properties":{"audio":{"type":"boolean"}},"required":["audio"],"description":"Absent: `{ audio: true }`."},"lineId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","clientTurnId","epoch","position","lineId"],"description":"An AI Line the story reached (a clip's start, or a rule's `startAiLine`): the client names the\nline by its id and nothing else — its directive and fallback are the server's."},{"type":"object","properties":{"kind":{"type":"string","const":"arrival"},"clientTurnId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"position":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"view":{"type":"object","properties":{"focus":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$","description":"A speaker's or an object's alias, as the documents spell it (`teacher_mouse`, `cat_book`)."},"lookingAt":{"maxItems":16,"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$"}}},"description":"What the viewer sees, by alias only — the focused object, the ones in view — validated by the\nserver against what is perceivable at the turn's position. Never free text."},"locale":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"The reply language; absent: the session's."},"output":{"type":"object","properties":{"audio":{"type":"boolean"}},"required":["audio"],"description":"Absent: `{ audio: true }`."}},"required":["kind","clientTurnId","epoch","position"],"description":"The narrator's answer on arrival: once the client's `navigation.arrived` of an AI navigation was\naccepted, it asks for the narrator to answer the request that took the viewer there — once per\nnavigation; `position` is where the viewer arrived. Refused (`beat_closed`) when no such\nrequest is waiting: none was made, it was answered already, or an Undo took the viewer back."}],"description":"`POST /v1/sessions/{id}/turns`."}}}},"responses":{"200":{"description":"A stream of events: an `event: <type>` line and a `data: <json>` line per event, a blank line after each, and a comment line every 15 s.","content":{"text/event-stream":{"schema":{"type":"string"},"x-jami3d-events":{"framing":"server-sent-events","data":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"turn.accepted"},"turnId":{"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)$"},"clientTurnId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"kind":{"type":"string","enum":["viewer","viewer_audio","ai_line","arrival"]},"speaker":{"type":"string","minLength":1,"maxLength":200,"description":"The speaker key of who answers."},"lineId":{"type":"string","minLength":1,"maxLength":160,"description":"`ai_line`: the line."}},"required":["type","turnId","clientTurnId","kind","speaker"],"description":"The turn is the server's now: its id, and who speaks."},{"type":"object","properties":{"type":{"type":"string","const":"speaker.state"},"turnId":{"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)$"},"speaker":{"type":"string","minLength":1,"maxLength":200},"state":{"type":"string","enum":["thinking","speaking","idle"]}},"required":["type","turnId","speaker","state"]},{"type":"object","properties":{"type":{"type":"string","const":"effect"},"turnId":{"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)$"},"speechId":{"type":"string","minLength":1,"maxLength":160},"effect":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"gesture"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"motionId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"intensity":{"type":"number","minimum":0,"maximum":1},"pinRoot":{"type":"boolean","description":"Live gestures never move a character: root motion discarded."},"expression":{"type":"object","properties":{"expression":{"type":"string","minLength":1,"maxLength":64},"intensity":{"type":"number","minimum":0,"maximum":1}},"required":["expression","intensity"]}},"required":["kind","entityId","motionId","intensity","pinRoot"]},{"type":"object","properties":{"kind":{"type":"string","const":"expression"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"expression":{"type":"string","minLength":1,"maxLength":64},"intensity":{"type":"number","minimum":0,"maximum":1}},"required":["kind","entityId","expression","intensity"]},{"type":"object","properties":{"kind":{"type":"string","const":"look_at"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"target":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"entity"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","entityId"]}]}},"required":["kind","entityId","target"]},{"type":"object","properties":{"kind":{"type":"string","const":"navigate"},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"landing":{"type":"string","enum":["chapterStart","hold"]}},"required":["kind","toBeatId","landing"]},{"type":"object","properties":{"kind":{"type":"string","const":"show_place"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"The AI-showable viewpoint of the current scene."}},"required":["kind","entityId"]},{"type":"object","properties":{"kind":{"type":"string","const":"object"},"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"behaviorId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"action":{"type":"string","minLength":1,"maxLength":64},"change":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":64},"spread":{"type":"integer","minimum":0,"maximum":9007199254740991},"visible":{"type":"boolean"}},"description":"What changed about an object: a toggle's state, a book's spread, a visibility override."}},"required":["kind","entityId","action","change"]}]}},"required":["type","turnId","speechId","effect"]},{"type":"object","properties":{"type":{"type":"string","const":"text.delta"},"turnId":{"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)$"},"speechId":{"type":"string","minLength":1,"maxLength":160},"text":{"type":"string","maxLength":4000}},"required":["type","turnId","speechId","text"],"description":"Streamed reply text (the transcript's interim line)."},{"type":"object","properties":{"type":{"type":"string","const":"audio.format"},"turnId":{"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)$"},"speechId":{"type":"string","minLength":1,"maxLength":160},"encoding":{"type":"string","const":"pcm_s16le"},"sampleRate":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"channels":{"type":"integer","minimum":1,"maximum":2}},"required":["type","turnId","speechId","encoding","sampleRate","channels"],"description":"How the `audio.chunk`s of a speech are encoded: little-endian 16-bit PCM."},{"type":"object","properties":{"type":{"type":"string","const":"audio.chunk"},"turnId":{"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)$"},"speechId":{"type":"string","minLength":1,"maxLength":160},"seq":{"type":"integer","minimum":0,"maximum":9007199254740991},"data":{"type":"string","maxLength":1048576}},"required":["type","turnId","speechId","seq","data"],"description":"About 100 ms of streamed speech, base64, numbered from 0 per speech."},{"type":"object","properties":{"type":{"type":"string","const":"audio.url"},"turnId":{"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)$"},"speechId":{"type":"string","minLength":1,"maxLength":160},"audio":{"type":"object","properties":{"renditions":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"codec":{"type":"string","enum":["opus","aac"]},"url":{"type":"string","minLength":1,"maxLength":2048},"offsetMs":{"type":"number","minimum":0},"primingMs":{"type":"number","minimum":0}},"required":["codec","url","offsetMs"]}},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["renditions","durationMs"],"description":"A whole speech file: its renditions and how long it plays."},"alignment":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["url"],"description":"Where a speech file's alignment sidecar is: the same kind of link as its audio."}},"required":["type","turnId","speechId","audio"],"description":"A whole prepared speech (an AI Line made ahead) instead of streamed chunks."},{"type":"object","properties":{"type":{"type":"string","const":"alignment"},"turnId":{"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)$"},"speechId":{"type":"string","minLength":1,"maxLength":160},"alignment":{"type":"object","properties":{"words":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"startMs":{"type":"number","minimum":0},"endMs":{"type":"number","minimum":0}},"required":["text","startMs","endMs"]}},"visemes":{"type":"array","items":{"type":"object","properties":{"viseme":{"type":"string","minLength":1,"maxLength":8},"startMs":{"type":"number","minimum":0},"endMs":{"type":"number","minimum":0},"weight":{"type":"number"}},"required":["viseme","startMs","endMs"]}},"visemeSource":{"type":"string","minLength":1,"maxLength":32},"captions":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"startMs":{"type":"number","minimum":0},"endMs":{"type":"number","minimum":0}},"required":["text","startMs","endMs"]}},"generator":{"type":"object","properties":{"synthetic":{"type":"boolean","const":true},"by":{"type":"string","minLength":1,"maxLength":64},"provider":{"type":"string","minLength":1,"maxLength":64},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["synthetic","by","provider","model"],"description":"The machine-readable mark of synthetic speech: the speech is AI-generated (`synthetic: true`), made by\n`by` (`jami3d`) with a provider's TTS model. Pre-generated speech carries it in its sidecar and\nits container; live speech carries it on its alignment (added within v1, P8)."}},"required":["words","visemes","visemeSource"],"description":"Word and viseme timings of streamed speech, in ms from the start of its audio (the alignment\nsidecar's shape). `visemeSource`: `phonemes`, `graphemes` or `acoustic` (an open vocabulary).\n\nA streamed speech may send several `alignment` events while it is synthesised: each carries the\ntimings of the speech FROM ITS START through what has been synthesised so far, so the latest\none replaces those before it; the last, sent just before `speech.end`, covers the whole speech\nand adds its captions. Each carries the synthetic mark of the voice that speaks it\n(`generator`, added within v1: absent from a server before it)."}},"required":["type","turnId","speechId","alignment"]},{"type":"object","properties":{"type":{"type":"string","const":"speech.end"},"turnId":{"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)$"},"speechId":{"type":"string","minLength":1,"maxLength":160}},"required":["type","turnId","speechId"]},{"type":"object","properties":{"type":{"type":"string","const":"line.fallback"},"turnId":{"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)$"},"lineId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"speechId":{"type":"string","minLength":1,"maxLength":160,"description":"Groups the effects, audio and alignment of one utterance."},"speaker":{"type":"string","minLength":1,"maxLength":200,"description":"The speaker key: `narrator`, `cast:{castId}` or `prop:{entityId}`."},"text":{"type":"string","maxLength":4000},"audio":{"type":"object","properties":{"renditions":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"codec":{"type":"string","enum":["opus","aac"]},"url":{"type":"string","minLength":1,"maxLength":2048},"offsetMs":{"type":"number","minimum":0},"primingMs":{"type":"number","minimum":0}},"required":["codec","url","offsetMs"]}},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["renditions","durationMs"],"description":"A whole speech file: its renditions and how long it plays."},"alignment":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["url"],"description":"Where a speech file's alignment sidecar is: the same kind of link as its audio."}},"required":["type","turnId","lineId","speechId","speaker","text"],"description":"An AI Line answered with its pre-generated fallback: the variant the server selected for the\nsession (one per combination of its tokens' values — \"Cat, you chose B; the right answer was\nC\"), spoken and captioned like a scripted line. Nothing about it is billed."},{"type":"object","properties":{"type":{"type":"string","const":"turn.refused"},"turnId":{"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)$"},"clientTurnId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"reason":{"type":"string","minLength":1,"maxLength":64},"canned":{"type":"object","properties":{"speechId":{"type":"string","minLength":1,"maxLength":160,"description":"Groups the effects, audio and alignment of one utterance."},"speaker":{"type":"string","minLength":1,"maxLength":200,"description":"The speaker key: `narrator`, `cast:{castId}` or `prop:{entityId}`."},"text":{"type":"string","maxLength":4000},"audio":{"type":"object","properties":{"renditions":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"object","properties":{"codec":{"type":"string","enum":["opus","aac"]},"url":{"type":"string","minLength":1,"maxLength":2048},"offsetMs":{"type":"number","minimum":0},"primingMs":{"type":"number","minimum":0}},"required":["codec","url","offsetMs"]}},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["renditions","durationMs"],"description":"A whole speech file: its renditions and how long it plays."},"alignment":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["url"],"description":"Where a speech file's alignment sidecar is: the same kind of link as its audio."}},"required":["speechId","speaker","text"]},"ai":{"type":"object","properties":{"level":{"type":"string","enum":["off","text","voice"]},"reasons":{"type":"array","items":{"type":"string","minLength":1}},"scopes":{"type":"array","items":{"type":"string"}},"voiceReplies":{"type":"string","minLength":1,"maxLength":32,"description":"Added within v1: whether live replies are spoken here — the project's setting, one of\n`V1_VOICE_REPLIES` (open: a value a reader does not know reads as absent). Changing it\nmoves the AI watch's stamp. Absent: this answer does not say (a server from before, an answer\nthat reads the session alone — the events answer); keep what an earlier answer said, and\nwith none, ask for spoken replies as before (`output.audio` true when audio can play)."}},"required":["level","reasons","scopes"],"description":"The session's live-AI status: the level and every reason that holds at it, and the scopes the token\ncarries. The UI hides voice at `text` and shows \"Live answers are paused\" at `off`."}},"required":["type","turnId","clientTurnId","reason"],"description":"The turn was refused — not an error: the stream ends here, playback goes on. `reason` is one\nof `TURN_REFUSED_REASONS` (`@jami3d/protocol/errors`, an open vocabulary a reader must not fail\non); `canned`, the speaker's pre-generated line for it; `ai`, the session's AI status that\ndecided it."},{"type":"object","properties":{"type":{"type":"string","const":"turn.final"},"turnId":{"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)$"},"usage":{"type":"object","properties":{"promptTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"cachedTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"completionTokens":{"type":"integer","minimum":0,"maximum":9007199254740991},"rounds":{"type":"integer","minimum":0,"maximum":9007199254740991},"firstTextMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."},"tools":{"maxItems":16,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"outcome":{"type":"string","minLength":1,"maxLength":32}},"required":["name","outcome"]}},"creditsMilli":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["promptTokens","cachedTokens","completionTokens","rounds"],"description":"What a turn's provider calls came to — on Studio draft sessions only, for the AI panel's Test\nchat: the tokens of every round (cached ones included in `promptTokens`), how many rounds ran,\nthe time to the first words, the tool calls with what became of each (`applied`, `coerced`,\n`refused`; open), and the credits the turn was priced at."}},"required":["type","turnId"],"description":"The turn is complete: everything it said has been sent, and what it cost is recorded. `usage`:\nStudio draft sessions only."},{"type":"object","properties":{"type":{"type":"string","const":"error"},"turnId":{"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)$","description":"The server's id of the turn: on every event (`DELETE …/turns/{turnId}` cancels it)."},"code":{"type":"string","minLength":1,"maxLength":64},"message":{"type":"string","maxLength":2000}},"required":["type","code","message"],"description":"The turn failed after the stream began; `code` is a `/v1` error code."},{"type":"object","properties":{"type":{"type":"string","const":"facts"},"turnId":{"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)$"},"facts":{"type":"array","items":{},"description":"A journal as a reader takes it: every fact it knows, in order; a fact of a kind it does not\nknow (a newer server's) is skipped rather than failing the whole answer."}},"required":["type","turnId","facts"],"description":"The server facts the turn journaled — `conversation.turn` (a question accepted at a Beat),\n`object.changed` with an `ai` cause, `navigation.requested` — sent BEFORE the effects that show\nthem, so the player folds them like an events answer's facts instead of re-reading its state.\nRead tolerantly: a fact of a kind the reader does not know is skipped."}]}}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`scope_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`stale_epoch`, `rewind_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/media/{token}/{path}":{"get":{"operationId":"media","summary":"Open a session's private media","tags":["Conversation"],"description":"The token is part of the path: the link itself is the credential.","parameters":[{"name":"token","in":"path","required":true,"description":"The link's signature, as a turn event handed it out.","schema":{"type":"string"}},{"name":"path","in":"path","required":true,"description":"The file, after the token (it may contain slashes).","schema":{"type":"string"}}],"responses":{"302":{"description":"A redirect to a short-lived download of the file. An unknown, tampered, expired or foreign link and an ended session are all the same 404.","headers":{"Location":{"description":"Where the file is.","schema":{"type":"string"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/v1/sessions/{id}/turns/{turnId}":{"delete":{"operationId":"cancel","summary":"Cancel a turn","tags":["Conversation"],"parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}},{"name":"turnId","in":"path","required":true,"description":"The turn's id (`turnId` of its events).","schema":{"type":"string"}}],"responses":{"204":{"description":"No content: whether the turn still ran, had ended or never existed."},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/sessions/{id}/conversation":{"get":{"operationId":"conversation","summary":"Read the shared transcript","tags":["Conversation"],"parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}},{"name":"afterSeq","in":"query","required":false,"description":"The entries after this one (exclusive): the last `seq` of the previous page.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500}}],"responses":{"200":{"description":"The transcript since the conversation's window start, a page at a time.","content":{"application/json":{"schema":{"type":"object","properties":{"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The session's epoch: a rewind since erased what came after where it went back to."},"entries":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The log's order; the next page starts after the last one."},"kind":{"type":"string","minLength":1,"maxLength":32,"description":"`utterance`, `event` or `directive_result` (an open vocabulary)."},"source":{"type":"string","minLength":1,"maxLength":32,"description":"Where it came from: `viewer_text`, `viewer_voice`, `scripted`, `ai_line`, `live_reply`,\n`player`, `server` (an open vocabulary)."},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"The Beat it happened at (an interactive scene's synthetic Beat is `scene:{sceneId}`)."},"speaker":{"type":"string","minLength":1,"maxLength":200,"description":"Who said it: `viewer`, `narrator`, `cast:{castId}` or `prop:{entityId}`."},"addressee":{"type":"string","minLength":1,"maxLength":200,"description":"Who it was said to: a speaker key, or `all`."},"text":{"type":"string","maxLength":4000},"lang":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"A UI or reply language: a BCP 47 tag (`en`, `pt-BR`, `zh-Hant-TW`)."},"turnId":{"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)$","description":"The server's turn that wrote it."},"clientTurnId":{"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)$","description":"The client's id of the turn: on the viewer's question, and on an AI Line's words."},"event":{"type":"string","minLength":1,"maxLength":32,"description":"An event's kind: `quiz_result`, `object_state`, `navigation`, `marker` (an open vocabulary)."},"quiz":{"type":"object","properties":{"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"questionId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"respondent":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"character"},"castId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","castId"]}],"description":"Who answers a quiz: the viewer, or the viewer playing a cast member (\"as Cat\")."},"answerText":{"type":"string","maxLength":4000,"description":"The answer in words."},"correct":{"type":"boolean"}},"required":["quizId","questionId","respondent","answerText","correct"],"description":"A `quiz_result` event."},"marker":{"type":"string","minLength":1,"maxLength":32,"description":"A `marker` event: `scene_entered`, `beat_reached`, `beat_skipped`, `skipped_range`, … (open)."},"navigation":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":32},"toBeatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["event"],"description":"A `navigation` event: `requested`, `confirmed`, `declined`, `arrived`, `visit_started` (open)."},"object":{"type":"object","properties":{"entityId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"change":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":64},"spread":{"type":"integer","minimum":0,"maximum":9007199254740991},"visible":{"type":"boolean"}},"description":"What changed about an object: a toggle's state, a book's spread, a visibility override."},"by":{"type":"string","minLength":1,"maxLength":16}},"required":["entityId","change","by"],"description":"An `object_state` event: the object, what changed, and who changed it (`viewer`, `story`, `ai`)."},"line":{"type":"object","properties":{"lineId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"fallback":{"type":"boolean"}},"required":["lineId","fallback"],"description":"A `directive_result`: the AI Line, and whether its pre-generated fallback spoke."}},"required":["seq","kind","source","anchor"]}},"more":{"type":"boolean","description":"More entries follow: ask again with `afterSeq` = the last entry's `seq`."}},"required":["epoch","entries","more"],"description":"The transcript since the conversation's window start, a page at a time."}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/sessions/{id}/ai-lines/{lineId}/prepare":{"post":{"operationId":"prepare","summary":"Prepare an AI Line ahead","tags":["Conversation"],"description":"Fire and forget, about 12 s before the line: at most twice per line per epoch, never while live AI is off.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}},{"name":"lineId","in":"path","required":true,"description":"The AI Line's id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"position":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"Where the story is now."},"locale":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"The reply language the line will be taken in; absent: the session's."},"output":{"type":"object","properties":{"audio":{"type":"boolean"}},"required":["audio"],"description":"Absent: `{ audio: true }` — its speech is made ahead too."}},"required":["epoch","position"],"description":"`POST /v1/sessions/{id}/ai-lines/{lineId}/prepare`: the line is about 12 s ahead with no\nblocking Beat before it — the server generates its words and speech now, so its turn at the\nclip start answers at once. Fire and forget; at most twice per line per epoch is honoured."}}}},"responses":{"202":{"description":"Prepare an AI Line ahead","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":32}},"required":["state"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`stale_epoch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/viewer-tokens":{"post":{"operationId":"viewerTokens","summary":"Issue a secure-embed grant","tags":["Server API"],"description":"Needs the key's `sessions` capability and a plan with secure embeds. A child-directed project also needs the key's consent attestation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"externalUserId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\p{Cc}]+$","description":"The integrator's own id for the learner: printable text, no control characters."},"ttlSec":{"default":600,"type":"integer","minimum":60,"maximum":3600},"caps":{"maxItems":16,"type":"array","items":{"type":"string","enum":["playback","text_ai","voice_ai","conversation_events"]}}},"required":["projectId","externalUserId"]}}}},"responses":{"201":{"description":"Issue a secure-embed grant","content":{"application/json":{"schema":{"type":"object","properties":{"viewerToken":{"type":"string","minLength":1,"description":"The single-use grant: `createPlayer({viewerToken})`, exchanged at `POST /v1/sessions`."},"expiresAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"Exchange it before this; a used or expired grant answers 401 `key_invalid`."},"cardToken":{"type":"string","minLength":1,"description":"`createPlayer({cardToken})`: lets the facade read the project's card."},"cardTokenExpiresAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"capabilities":{"type":"array","items":{"type":"string"},"description":"What the session will be allowed (the request's `caps`, playback always)."}},"required":["viewerToken","expiresAt","cardToken","cardTokenExpiresAt","capabilities"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`key_invalid`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`scope_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"secretKey":[]}]}},"/v1/projects":{"get":{"operationId":"projects","summary":"List your projects","tags":["Server API"],"description":"Needs the `projects` capability. A project-scoped key sees its projects only.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"The last project id of the previous page (`nextCursor`).","schema":{"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)$"}}],"responses":{"200":{"description":"List your projects","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"title":{"type":"string"},"contentLanguage":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"A UI or reply language: a BCP 47 tag (`en`, `pt-BR`, `zh-Hant-TW`)."},"status":{"type":"string","minLength":1,"description":"`active` or `archived`."},"live":{"anyOf":[{"type":"object","properties":{"releaseId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"number":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},{"type":"null","description":"An ISO 8601 instant."}],"description":"An ISO 8601 instant."}},"required":["releaseId","number","publishedAt"],"description":"The release a new viewer gets; null before the first publish."},{"type":"null","description":"The release a new viewer gets; null before the first publish."}],"description":"The release a new viewer gets; null before the first publish."},"embed":{"type":"object","properties":{"policy":{"type":"string","minLength":1,"description":"`open` (keys and keyless embeds) or `secure_only` (viewer-token grants only)."},"allowKeyless":{"type":"boolean","description":"Anyone may frame it without a key (the owner pays)."},"url":{"type":"string","minLength":1,"description":"The embed document: `https://embed.jami.live/p/{id}`."}},"required":["policy","allowKeyless","url"]},"listing":{"anyOf":[{"type":"object","properties":{"slug":{"type":"string","minLength":1},"visibility":{"type":"string","minLength":1,"description":"`public`, `unlisted` or `private`."},"allowEmbed":{"type":"boolean","description":"Other accounts may embed it with their own keys."},"url":{"type":"string","minLength":1}},"required":["slug","visibility","allowEmbed","url"],"description":"Its marketplace listing, when it has one."},{"type":"null","description":"Its marketplace listing, when it has one."}],"description":"Its marketplace listing, when it has one."},"createdAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"updatedAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."}},"required":["id","title","contentLanguage","status","live","embed","listing","createdAt","updatedAt"]}},"nextCursor":{"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)$","description":"Present when there are more: pass it as `cursor`."}},"required":["projects"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`key_invalid`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`scope_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"secretKey":[]}]}},"/v1/usage":{"get":{"operationId":"usage","summary":"Read your usage","tags":["Server API"],"description":"Needs the `usage` capability. Amounts are integer millicredits from the hourly rollup.","parameters":[{"name":"from","in":"query","required":false,"description":"First UTC day (`YYYY-MM-DD`); absent: 29 days before `to`.","schema":{"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])))$"}},{"name":"to","in":"query","required":false,"description":"Last UTC day, inclusive; absent: today.","schema":{"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])))$"}},{"name":"groupBy","in":"query","required":false,"schema":{"default":"day","type":"string","enum":["day","project","key","surface","service"]}}],"responses":{"200":{"description":"Read your usage","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"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])))$"},"to":{"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])))$"},"groupBy":{"type":"string","minLength":1},"totals":{"type":"object","properties":{"events":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Paid calls (LLM, TTS, ASR, RTC, egress)."},"creditsMilli":{"type":"integer","minimum":0,"maximum":9007199254740991},"billableCreditsMilli":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The part charged to the account (test-key sessions are recorded but not billed)."}},"required":["events","creditsMilli","billableCreditsMilli"],"description":"Amounts in integer MILLIcredits (1 credit = 1,000), exact over any range."},"groups":{"type":"array","items":{"type":"object","properties":{"events":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Paid calls (LLM, TTS, ASR, RTC, egress)."},"creditsMilli":{"type":"integer","minimum":0,"maximum":9007199254740991},"billableCreditsMilli":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The part charged to the account (test-key sessions are recorded but not billed)."},"key":{"anyOf":[{"type":"string","description":"The day, project id, key id, surface or service; null: no project / no key."},{"type":"null","description":"The day, project id, key id, surface or service; null: no project / no key."}],"description":"The day, project id, key id, surface or service; null: no project / no key."}},"required":["events","creditsMilli","billableCreditsMilli","key"]}},"balance":{"type":"object","properties":{"periodStart":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"periodEnd":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"allowanceMilli":{"type":"integer","minimum":0,"maximum":9007199254740991},"usedMilli":{"type":"integer","minimum":0,"maximum":9007199254740991},"availableMilli":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["periodStart","periodEnd","allowanceMilli","usedMilli","availableMilli"],"description":"The account's credits this period (an unscoped key only)."},"countedUntil":{"anyOf":[{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"Usage is folded hourly: everything before this instant is counted."},{"type":"null","description":"Usage is folded hourly: everything before this instant is counted."}],"description":"Usage is folded hourly: everything before this instant is counted."}},"required":["from","to","groupBy","totals","groups","countedUntil"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`key_invalid`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`scope_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"secretKey":[]}]}},"/v1/results":{"get":{"operationId":"results","summary":"List learners' results","tags":["Server API"],"description":"Needs the `results` capability: the results of the sessions minted with your account's keys, newest change first.","parameters":[{"name":"projectId","in":"query","required":false,"description":"A server-minted id (sessions, projects, releases, users): a UUID.","schema":{"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":"externalUserId","in":"query","required":false,"description":"The integrator's own id for the learner: printable text, no control characters.","schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\p{Cc}]+$"}},{"name":"from","in":"query","required":false,"description":"Results that changed at or after this instant.","schema":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"to","in":"query","required":false,"description":"Results that changed before this instant.","schema":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"The previous page's `nextCursor`.","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"List learners' results","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"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)$","description":"The story's latest session: the report is `GET /v1/results/{sessionId}/report`."},"projectId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"releaseId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"surface":{"type":"string","minLength":1,"description":"`embed` or `secure_embed`."},"keyId":{"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)$","description":"The key the session was minted with."},"test":{"type":"boolean","description":"Minted with a test key."},"viewer":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"anonymous"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"external"},"externalUserId":{"type":"string","minLength":1}},"required":["kind","externalUserId"]},{"type":"object","properties":{"kind":{"type":"string","const":"account"},"userId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."}},"required":["kind","userId"]}],"description":"The learner: the integrator's own id for a secure embed's learner, else nobody by name."},"startedAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"updatedAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"completedAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"When the story was completed; absent while it is not."},"completed":{"type":"boolean"},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Grows with every rewind; a result is read as of its epoch."},"score":{"type":"number","minimum":0},"maxScore":{"type":"number","minimum":0},"percent":{"type":"number","minimum":0,"maximum":100,"description":"0–100, one decimal."},"passed":{"type":"boolean","description":"Every quiz completed and passed; absent while a quiz is not completed."},"answeredCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"questionCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["sessionId","projectId","surface","keyId","test","viewer","startedAt","updatedAt","completed","epoch","score","maxScore","percent","answeredCount","questionCount"]}},"nextCursor":{"type":"string","minLength":1,"description":"Present when there are more: pass it as `cursor`."}},"required":["results"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`key_invalid`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`scope_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"secretKey":[]}]}},"/v1/results/{id}/report":{"get":{"operationId":"resultReport","summary":"Download a learner's report","tags":["Server API"],"description":"Needs the `results` capability. A session your account's keys did not mint answers 404.","parameters":[{"name":"id","in":"path","required":true,"description":"The result's `sessionId`.","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"schema":{"default":"json","type":"string","enum":["json","html","csv","docx","xlsx"]}},{"name":"template","in":"query","required":false,"description":"One of the project's report templates; absent: the default layout.","schema":{"type":"string","minLength":1,"maxLength":160}},{"name":"locale","in":"query","required":false,"description":"The report's language; absent: the session's.","schema":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$"}}],"responses":{"200":{"description":"`format=json`: the session and its result as the viewer's own `GET …/result` gives them, and —\nonly when the project lets reports carry the conversation, never for a project made for\nchildren, and only while its retention keeps it — the conversation.","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"projectId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"releaseId":{"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)$","description":"The release played (a draft session has none)."},"title":{"type":"string"},"startedAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"lastSeenAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","projectId","title","startedAt","lastSeenAt","durationMs"]},"result":{"type":"object","properties":{"viewer":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"anonymous"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"external"},"externalUserId":{"type":"string","minLength":1}},"required":["kind","externalUserId"]},{"type":"object","properties":{"kind":{"type":"string","const":"account"},"userId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."}},"required":["kind","userId"]}],"description":"Who a result is about: nobody by name, a secure embed's learner, a signed-in account."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"boolean"},"beats":{"type":"array","items":{"type":"object","properties":{"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"name":{"type":"string"},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"required":{"type":"boolean"},"status":{"type":"string","minLength":1,"description":"`completed`, `skipped`, `visited` or `notVisited`."},"turns":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["beatId","alias","name","sceneId","required","status","turns"]}},"quizzes":{"type":"array","items":{"type":"object","properties":{"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","minLength":1,"description":"`completed`, `inProgress`, `skipped` or `notStarted`."},"score":{"type":"number","minimum":0},"maxScore":{"type":"number","minimum":0},"percent":{"type":"number","minimum":0,"maximum":100,"description":"0–100, one decimal."},"passed":{"type":"boolean","description":"Against the quiz's pass mark, once the quiz is completed."},"correctCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"questions":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"key":{"type":"string"},"prompt":{"type":"string"},"answered":{"type":"boolean"},"correct":{"type":"boolean"},"points":{"type":"number","minimum":0},"maxPoints":{"type":"number","minimum":0},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"response":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"choice"},"choiceId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","choiceId"]},{"type":"object","properties":{"kind":{"type":"string","const":"choices"},"choiceIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","choiceIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","maxLength":2000}},"required":["kind","text"]}],"description":"A response to one question: a choice (single, image choice), a set of choices (multi), true or\nfalse, or a typed answer. The server trims and bounds text itself (grading refuses an answer\nover 500 characters), so the wire allows some slack rather than failing a whole request."},"responseText":{"type":"string","description":"The response in words: the chosen choices' text, true / false, the typed answer."},"respondent":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"character"},"castId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","castId"]}],"description":"Who answers a quiz: the viewer, or the viewer playing a cast member (\"as Cat\")."}},"required":["questionId","key","answered","correct","points","maxPoints","attempts"]}}},"required":["quizId","alias","status","score","maxScore","percent","correctCount","questions"]}},"variables":{"type":"array","items":{"type":"object","properties":{"variableId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"type":{"type":"string","minLength":1},"value":{"anyOf":[{"type":"boolean","description":"A story value: a boolean, a number, or a short text (a choice is its key)."},{"type":"number","description":"A story value: a boolean, a number, or a short text (a choice is its key)."},{"type":"string","maxLength":200,"description":"A story value: a boolean, a number, or a short text (a choice is its key)."}],"description":"A story value: a boolean, a number, or a short text (a choice is its key)."}},"required":["variableId","alias","type","value"]}},"items":{"type":"array","items":{"type":"object","properties":{"resultId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","minLength":1,"description":"`quiz`, `score` or `flag`."},"value":{"anyOf":[{"type":"number"},{"type":"boolean"}]}},"required":["resultId","alias","label","kind","value"]}},"totals":{"type":"object","properties":{"score":{"type":"number","minimum":0},"maxScore":{"type":"number","minimum":0},"percent":{"type":"number","minimum":0,"maximum":100},"passed":{"type":"boolean"},"correctCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"questionCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"answeredCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"beatsCompleted":{"type":"integer","minimum":0,"maximum":9007199254740991},"beatsTotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"completion":{"type":"number","minimum":0,"maximum":1,"description":"Completed Beats ÷ all Beats (1 when there are none)."}},"required":["score","maxScore","percent","correctCount","questionCount","answeredCount","beatsCompleted","beatsTotal","completion"]}},"required":["viewer","epoch","completed","beats","quizzes","variables","items","totals"]},"transcript":{"type":"array","items":{"type":"object","properties":{"speaker":{"type":"string","minLength":1,"description":"`viewer`, `narrator`, `cast:{castId}` or `prop:{entityId}`."},"speakerName":{"type":"string"},"addressee":{"type":"string","minLength":1,"description":"Who it was said to (the same keys, or `all`)."},"text":{"type":"string"},"at":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."}},"required":["speaker","speakerName","text","at"]}}},"required":["session","result"],"description":"`format=json`: the session and its result as the viewer's own `GET …/result` gives them, and —\nonly when the project lets reports carry the conversation, never for a project made for\nchildren, and only while its retention keeps it — the conversation."}},"text/html":{"schema":{"description":"`format=html`"}},"text/csv":{"schema":{"description":"`format=csv`"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"description":"`format=docx`"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"description":"`format=xlsx`"}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`key_invalid`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`scope_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"secretKey":[]}]}},"/v1/sessions/{id}/voice":{"post":{"operationId":"voice","summary":"Start voice (the first Talk press)","tags":["Voice"],"parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"addressee":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,47}$","description":"A speaker's or an object's alias, as the documents spell it (`teacher_mouse`, `cat_book`)."},"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"position":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"WHERE in the story something happened: `visit` starts at 1\nand grows only under `navigationHistory: keep`; `sceneId` names a scene of the session's\nrelease (the server maps it to the scene's index and compares anchors lexicographically as\n`(visit, sceneIndex, ms)`); `ms` is authored scene time — a fact recorded during a hold carries\nthe hold's time."},"locale":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$","description":"A UI or reply language: a BCP 47 tag (`en`, `pt-BR`, `zh-Hant-TW`)."}},"required":["addressee","beatId","epoch","position"],"description":"The first Talk press: who the viewer wants to talk to, at which Beat, where in the story and in\nwhich epoch (409 `stale_epoch` after a rewind, like a turn), and the language they speak\n(absent: the session's)."}}}},"responses":{"200":{"description":"Start voice (the first Talk press)","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","minLength":1,"maxLength":32,"description":"One of `V1_VOICE_STATES`."},"reason":{"type":"string","minLength":1,"maxLength":64,"description":"`refused`: one of `V1_VOICE_REFUSED_REASONS`."},"ai":{"type":"object","properties":{"level":{"type":"string","enum":["off","text","voice"]},"reasons":{"type":"array","items":{"type":"string","minLength":1}},"scopes":{"type":"array","items":{"type":"string"}},"voiceReplies":{"type":"string","minLength":1,"maxLength":32,"description":"Added within v1: whether live replies are spoken here — the project's setting, one of\n`V1_VOICE_REPLIES` (open: a value a reader does not know reads as absent). Changing it\nmoves the AI watch's stamp. Absent: this answer does not say (a server from before, an answer\nthat reads the session alone — the events answer); keep what an earlier answer said, and\nwith none, ask for spoken replies as before (`output.audio` true when audio can play)."}},"required":["level","reasons","scopes"],"description":"The session's live-AI status now (the UI hides Talk below `voice`)."},"voice":{"type":"object","properties":{"secondsLeft":{"type":"integer","minimum":0,"maximum":9007199254740991},"pressMaxMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["secondsLeft","pressMaxMs"],"description":"What the viewer may still say: seconds of voice left today (presses count their pressed time,\nclips their length) and the longest press the agent takes now (the smaller of\n`V1_VOICE_LIMITS` `pressMaxMs` and what is left)."},"connection":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"description":"The LiveKit server, `wss://…` (`ws://` in development)."},"token":{"type":"string","minLength":1,"maxLength":4096,"description":"The participant token: join before `expiresAt`; it publishes a microphone and data only."},"room":{"type":"string","minLength":1,"maxLength":200,"description":"`v1VoiceRoomName`."},"identity":{"type":"string","minLength":1,"maxLength":200,"description":"`v1VoiceViewerIdentity`."},"expiresAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."}},"required":["url","token","room","identity","expiresAt"],"description":"`ready`: the room to join."},"dispatch":{"type":"string","minLength":1,"maxLength":32,"description":"`ready`: whether the agent was dispatched now (`dispatched`) or already serves the room (`joined`); open."}},"required":["state","ai","voice"]}}}},"400":{"description":"`invalid_input`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`scope_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`stale_epoch`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`retry_later`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/sessions/{id}/voice/clips":{"post":{"operationId":"clips","summary":"Transcribe a recorded question","tags":["Voice"],"description":"The fallback for networks that block WebRTC. The audio is transcribed at once and never stored; at most 8 MB.","parameters":[{"name":"id","in":"path","required":true,"description":"The viewer session's id (`session.id` in the mint answer).","schema":{"type":"string"}},{"name":"locale","in":"query","required":false,"description":"A UI or reply language: a BCP 47 tag (`en`, `pt-BR`, `zh-Hant-TW`).","schema":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$"}}],"requestBody":{"required":true,"content":{"audio/*":{}}},"responses":{"200":{"description":"The clip, transcribed. `uploadRef` names the transcript for ONE `viewer_audio` turn within a\nfew minutes; it is absent when nothing was heard (`transcript` empty: \"I didn't catch that\").\nThe clip's length counts against the viewer's voice seconds either way.","content":{"application/json":{"schema":{"type":"object","properties":{"uploadRef":{"type":"string","minLength":1,"maxLength":200},"transcript":{"type":"string","maxLength":500},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."},"voice":{"type":"object","properties":{"secondsLeft":{"type":"integer","minimum":0,"maximum":9007199254740991},"pressMaxMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["secondsLeft","pressMaxMs"],"description":"What the viewer may still say: seconds of voice left today (presses count their pressed time,\nclips their length) and the longest press the agent takes now (the smaller of\n`V1_VOICE_LIMITS` `pressMaxMs` and what is left)."}},"required":["transcript","durationMs","voice"],"description":"The clip, transcribed. `uploadRef` names the transcript for ONE `viewer_audio` turn within a\nfew minutes; it is absent when nothing was heard (`transcript` empty: \"I didn't catch that\").\nThe clip's length counts against the viewer's voice seconds either way."}}}},"401":{"description":"`invalid_token`, `session_expired`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`scope_required`, `ai_unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`body_too_large`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"`unsupported_media_type`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`retry_later`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"viewerToken":[]}]}},"/v1/media/t/{token}/{path}":{"get":{"operationId":"protectedMedia","summary":"Open a protected release's file","tags":["Viewer sessions"],"description":"Only for a protected release (a secure-only or privately listed project) whose media host is this server: use `assets.base` as the mint gives it — it already carries the token. A heartbeat hands out a fresh base before the token expires.\n\nThe token is part of the path: the link itself is the credential.","parameters":[{"name":"token","in":"path","required":true,"description":"The session's asset token, as `assets.base` of the mint (or a heartbeat) carries it.","schema":{"type":"string"}},{"name":"path","in":"path","required":true,"description":"The file, after the token: the release JSON or a content-addressed file (it may contain slashes).","schema":{"type":"string"}}],"responses":{"302":{"description":"A redirect to a short-lived download of the file, never cached. An unknown, tampered or expired token and a path the token does not open are the same 404.","headers":{"Location":{"description":"Where the file is.","schema":{"type":"string"}}}},"404":{"description":"`not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Any other failure (`internal_error`), in the same envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}}},"webhooks":{"release.published":{"post":{"operationId":"webhook release.published","summary":"A release of your project went live","description":"Sent to the project's owner when one of its releases goes live for the first time.","tags":["Webhooks"],"parameters":[{"name":"Jami-Signature","in":"header","required":true,"description":"`t={unix seconds},v1={hex HMAC-SHA256 of t + \".\" + the body}`, keyed by the endpoint's secret; two `v1` entries while a rotated secret is in its grace. Refuse a `t` more than 300 s from your clock.","schema":{"type":"string"}},{"name":"Jami-Event-Id","in":"header","required":true,"description":"The event's id: the same on every attempt and redelivery. Deduplicate on it.","schema":{"type":"string"}},{"name":"Jami-Event-Type","in":"header","required":true,"description":"The event's `type`.","schema":{"type":"string"}},{"name":"Jami-Delivery-Attempt","in":"header","required":true,"description":"Which attempt this is: 1, then 2, 3… for the retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"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)$","description":"The event's id: the same on every attempt and redelivery (`Jami-Event-Id`)."},"type":{"type":"string","const":"release.published"},"version":{"type":"number","const":1},"createdAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"data":{"type":"object","properties":{"project":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"title":{"type":"string"}},"required":["id","title"]},"release":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"number":{"type":"integer","minimum":1,"maximum":9007199254740991},"publishedAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."}},"required":["id","number","publishedAt"]},"previousReleaseId":{"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)$","description":"The release that was live before it; absent for the project's first."}},"required":["project","release"]}},"required":["id","type","version","createdAt","data"]}}}},"responses":{"2XX":{"description":"Delivered. Anything else, a redirect or no answer within 10 s is retried at +1 min, +5 min, +30 min, +2 h, +6 h, +12 h, +24 h, +24 h; then the delivery is dead."}}}},"session.completed":{"post":{"operationId":"webhook session.completed","summary":"A viewer finished the story","description":"Sent to the account that minted the session: the owner of the publishable or secret key, or the project's owner for its own pages and keyless embeds.","tags":["Webhooks"],"parameters":[{"name":"Jami-Signature","in":"header","required":true,"description":"`t={unix seconds},v1={hex HMAC-SHA256 of t + \".\" + the body}`, keyed by the endpoint's secret; two `v1` entries while a rotated secret is in its grace. Refuse a `t` more than 300 s from your clock.","schema":{"type":"string"}},{"name":"Jami-Event-Id","in":"header","required":true,"description":"The event's id: the same on every attempt and redelivery. Deduplicate on it.","schema":{"type":"string"}},{"name":"Jami-Event-Type","in":"header","required":true,"description":"The event's `type`.","schema":{"type":"string"}},{"name":"Jami-Delivery-Attempt","in":"header","required":true,"description":"Which attempt this is: 1, then 2, 3… for the retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"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)$","description":"The event's id: the same on every attempt and redelivery (`Jami-Event-Id`)."},"type":{"type":"string","const":"session.completed"},"version":{"type":"number","const":1},"createdAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"data":{"type":"object","properties":{"session":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"projectId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"releaseId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"surface":{"type":"string","minLength":1,"description":"Where it was minted: a value of `V1_SURFACES`, read open (the vocabulary grows)."},"test":{"type":"boolean","description":"Minted with a test key: keep it out of real records."},"apiKeyId":{"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)$","description":"The key it was minted with; absent for the project owner's own pages and keyless embeds."},"externalUserId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\p{Cc}]+$","description":"A secure embed's learner, as the integrator named them (`POST /v1/viewer-tokens`)."}},"required":["id","projectId","releaseId","surface","test"],"description":"The viewer session an event is about."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"completedAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"startedAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"When the story began (a viewing resumed within 24 h counts from its first session)."},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."},"beatsVisited":{"type":"array","items":{"type":"object","properties":{"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"name":{"type":"string"},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"required":{"type":"boolean"},"status":{"type":"string","minLength":1,"description":"`completed`, `skipped`, `visited` or `notVisited`."},"turns":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["beatId","alias","name","sceneId","required","status","turns"]},"description":"The Beats the viewer reached — visited, completed or skipped — in story order."},"result":{"type":"object","properties":{"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"completed":{"type":"boolean"},"beats":{"type":"array","items":{"type":"object","properties":{"beatId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"name":{"type":"string"},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"required":{"type":"boolean"},"status":{"type":"string","minLength":1,"description":"`completed`, `skipped`, `visited` or `notVisited`."},"turns":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["beatId","alias","name","sceneId","required","status","turns"]}},"quizzes":{"type":"array","items":{"type":"object","properties":{"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","minLength":1,"description":"`completed`, `inProgress`, `skipped` or `notStarted`."},"score":{"type":"number","minimum":0},"maxScore":{"type":"number","minimum":0},"percent":{"type":"number","minimum":0,"maximum":100,"description":"0–100, one decimal."},"passed":{"type":"boolean","description":"Against the quiz's pass mark, once the quiz is completed."},"correctCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"questions":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"key":{"type":"string"},"prompt":{"type":"string"},"answered":{"type":"boolean"},"correct":{"type":"boolean"},"points":{"type":"number","minimum":0},"maxPoints":{"type":"number","minimum":0},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991},"response":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"choice"},"choiceId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","choiceId"]},{"type":"object","properties":{"kind":{"type":"string","const":"choices"},"choiceIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","choiceIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","maxLength":2000}},"required":["kind","text"]}],"description":"A response to one question: a choice (single, image choice), a set of choices (multi), true or\nfalse, or a typed answer. The server trims and bounds text itself (grading refuses an answer\nover 500 characters), so the wire allows some slack rather than failing a whole request."},"responseText":{"type":"string","description":"The response in words: the chosen choices' text, true / false, the typed answer."},"respondent":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"character"},"castId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","castId"]}],"description":"Who answers a quiz: the viewer, or the viewer playing a cast member (\"as Cat\")."}},"required":["questionId","key","answered","correct","points","maxPoints","attempts"]}}},"required":["quizId","alias","status","score","maxScore","percent","correctCount","questions"]}},"variables":{"type":"array","items":{"type":"object","properties":{"variableId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"type":{"type":"string","minLength":1},"value":{"anyOf":[{"type":"boolean","description":"A story value: a boolean, a number, or a short text (a choice is its key)."},{"type":"number","description":"A story value: a boolean, a number, or a short text (a choice is its key)."},{"type":"string","maxLength":200,"description":"A story value: a boolean, a number, or a short text (a choice is its key)."}],"description":"A story value: a boolean, a number, or a short text (a choice is its key)."}},"required":["variableId","alias","type","value"]}},"items":{"type":"array","items":{"type":"object","properties":{"resultId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","minLength":1,"description":"`quiz`, `score` or `flag`."},"value":{"anyOf":[{"type":"number"},{"type":"boolean"}]}},"required":["resultId","alias","label","kind","value"]}},"totals":{"type":"object","properties":{"score":{"type":"number","minimum":0},"maxScore":{"type":"number","minimum":0},"percent":{"type":"number","minimum":0,"maximum":100},"passed":{"type":"boolean"},"correctCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"questionCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"answeredCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"beatsCompleted":{"type":"integer","minimum":0,"maximum":9007199254740991},"beatsTotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"completion":{"type":"number","minimum":0,"maximum":1,"description":"Completed Beats ÷ all Beats (1 when there are none)."}},"required":["score","maxScore","percent","correctCount","questionCount","answeredCount","beatsCompleted","beatsTotal","completion"]}},"required":["epoch","completed","beats","quizzes","variables","items","totals"],"description":"The session's result as `GET /v1/sessions/{id}/result` gives it, who the viewer is aside."}},"required":["session","epoch","completedAt","startedAt","durationMs","beatsVisited","result"]}},"required":["id","type","version","createdAt","data"]}}}},"responses":{"2XX":{"description":"Delivered. Anything else, a redirect or no answer within 10 s is retried at +1 min, +5 min, +30 min, +2 h, +6 h, +12 h, +24 h, +24 h; then the delivery is dead."}}}},"result.quiz_answered":{"post":{"operationId":"webhook result.quiz_answered","summary":"A quiz answer was graded","description":"Sent to the account that minted the session: the owner of the publishable or secret key, or the project's owner for its own pages and keyless embeds.","tags":["Webhooks"],"parameters":[{"name":"Jami-Signature","in":"header","required":true,"description":"`t={unix seconds},v1={hex HMAC-SHA256 of t + \".\" + the body}`, keyed by the endpoint's secret; two `v1` entries while a rotated secret is in its grace. Refuse a `t` more than 300 s from your clock.","schema":{"type":"string"}},{"name":"Jami-Event-Id","in":"header","required":true,"description":"The event's id: the same on every attempt and redelivery. Deduplicate on it.","schema":{"type":"string"}},{"name":"Jami-Event-Type","in":"header","required":true,"description":"The event's `type`.","schema":{"type":"string"}},{"name":"Jami-Delivery-Attempt","in":"header","required":true,"description":"Which attempt this is: 1, then 2, 3… for the retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"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)$","description":"The event's id: the same on every attempt and redelivery (`Jami-Event-Id`)."},"type":{"type":"string","const":"result.quiz_answered"},"version":{"type":"number","const":1},"createdAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"data":{"type":"object","properties":{"session":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"projectId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"releaseId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"surface":{"type":"string","minLength":1,"description":"Where it was minted: a value of `V1_SURFACES`, read open (the vocabulary grows)."},"test":{"type":"boolean","description":"Minted with a test key: keep it out of real records."},"apiKeyId":{"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)$","description":"The key it was minted with; absent for the project owner's own pages and keyless embeds."},"externalUserId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\p{Cc}]+$","description":"A secure embed's learner, as the integrator named them (`POST /v1/viewer-tokens`)."}},"required":["id","projectId","releaseId","surface","test"],"description":"The viewer session an event is about."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The session's epoch when it was answered (a rewind starts the next: see `result.retracted`)."},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The answer's place in the session's story journal: a later answer has a higher number."},"answeredAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"anchor":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"Where in the story it was answered."},"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"questionId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"respondent":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"viewer"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"character"},"castId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","castId"]}],"description":"Who answers a quiz: the viewer, or the viewer playing a cast member (\"as Cat\")."},"response":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"choice"},"choiceId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."}},"required":["kind","choiceId"]},{"type":"object","properties":{"kind":{"type":"string","const":"choices"},"choiceIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":160}}},"required":["kind","choiceIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"boolean"},"value":{"type":"boolean"}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"text"},"text":{"type":"string","maxLength":2000}},"required":["kind","text"]}],"description":"A response to one question: a choice (single, image choice), a set of choices (multi), true or\nfalse, or a typed answer. The server trims and bounds text itself (grading refuses an answer\nover 500 characters), so the wire allows some slack rather than failing a whole request."},"responseText":{"type":"string","description":"The response in words: the chosen choices' text, true / false, the typed answer."},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991},"final":{"type":"boolean","description":"No later attempt can change this question's outcome."},"correct":{"type":"boolean"},"points":{"type":"number","minimum":0},"quiz":{"type":"object","properties":{"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"alias":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","minLength":1,"description":"`completed`, `inProgress`, `skipped` or `notStarted`."},"score":{"type":"number","minimum":0},"maxScore":{"type":"number","minimum":0},"percent":{"type":"number","minimum":0,"maximum":100,"description":"0–100, one decimal."},"passed":{"type":"boolean","description":"Against the quiz's pass mark, once the quiz is completed."},"correctCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["quizId","alias","status","score","maxScore","percent","correctCount"],"description":"The quiz after this answer."},"totals":{"type":"object","properties":{"score":{"type":"number","minimum":0},"maxScore":{"type":"number","minimum":0},"percent":{"type":"number","minimum":0,"maximum":100},"passed":{"type":"boolean"},"correctCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"questionCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"answeredCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"beatsCompleted":{"type":"integer","minimum":0,"maximum":9007199254740991},"beatsTotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"completion":{"type":"number","minimum":0,"maximum":1,"description":"Completed Beats ÷ all Beats (1 when there are none)."}},"required":["score","maxScore","percent","correctCount","questionCount","answeredCount","beatsCompleted","beatsTotal","completion"],"description":"The whole session after this answer."}},"required":["session","epoch","seq","answeredAt","anchor","quizId","questionId","respondent","response","attempt","final","correct","points","quiz","totals"]}},"required":["id","type","version","createdAt","data"]}}}},"responses":{"2XX":{"description":"Delivered. Anything else, a redirect or no answer within 10 s is retried at +1 min, +5 min, +30 min, +2 h, +6 h, +12 h, +24 h, +24 h; then the delivery is dead."}}}},"result.retracted":{"post":{"operationId":"webhook result.retracted","summary":"A rewind erased answers","description":"Sent to the account that minted the session when a rewind erases answers it was told about.","tags":["Webhooks"],"parameters":[{"name":"Jami-Signature","in":"header","required":true,"description":"`t={unix seconds},v1={hex HMAC-SHA256 of t + \".\" + the body}`, keyed by the endpoint's secret; two `v1` entries while a rotated secret is in its grace. Refuse a `t` more than 300 s from your clock.","schema":{"type":"string"}},{"name":"Jami-Event-Id","in":"header","required":true,"description":"The event's id: the same on every attempt and redelivery. Deduplicate on it.","schema":{"type":"string"}},{"name":"Jami-Event-Type","in":"header","required":true,"description":"The event's `type`.","schema":{"type":"string"}},{"name":"Jami-Delivery-Attempt","in":"header","required":true,"description":"Which attempt this is: 1, then 2, 3… for the retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"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)$","description":"The event's id: the same on every attempt and redelivery (`Jami-Event-Id`)."},"type":{"type":"string","const":"result.retracted"},"version":{"type":"number","const":1},"createdAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"data":{"type":"object","properties":{"session":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"projectId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"releaseId":{"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)$","description":"A server-minted id (sessions, projects, releases, users): a UUID."},"surface":{"type":"string","minLength":1,"description":"Where it was minted: a value of `V1_SURFACES`, read open (the vocabulary grows)."},"test":{"type":"boolean","description":"Minted with a test key: keep it out of real records."},"apiKeyId":{"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)$","description":"The key it was minted with; absent for the project owner's own pages and keyless embeds."},"externalUserId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[^\\p{Cc}]+$","description":"A secure embed's learner, as the integrator named them (`POST /v1/viewer-tokens`)."}},"required":["id","projectId","releaseId","surface","test"],"description":"The viewer session an event is about."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The epoch the session goes on in: every answer listed was recorded in an earlier one."},"quizIds":{"minItems":1,"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"description":"The quizzes some of whose answers the rewind erased."},"answers":{"minItems":1,"type":"array","items":{"type":"object","properties":{"quizId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"questionId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The erased answer's `seq`, `epoch` and `attempt`, as its `result.quiz_answered` carried them."},"epoch":{"type":"integer","minimum":0,"maximum":9007199254740991},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["quizId","questionId","seq","epoch","attempt"]},"description":"Each answer erased."},"to":{"type":"object","properties":{"visit":{"type":"integer","minimum":1,"maximum":9007199254740991},"sceneId":{"type":"string","minLength":1,"maxLength":160,"description":"An id from the project's documents: a scene, a Beat (an interactive scene's synthetic Beat is\n`scene:{sceneId}`), an entity, a behaviour, a rule, a variable, a quiz, a question, a choice."},"ms":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"A non-negative integer count or time in milliseconds."}},"required":["visit","sceneId","ms"],"description":"Where the story went back to: everything answered at or after it is gone."},"rewoundAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"totals":{"type":"object","properties":{"score":{"type":"number","minimum":0},"maxScore":{"type":"number","minimum":0},"percent":{"type":"number","minimum":0,"maximum":100},"passed":{"type":"boolean"},"correctCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"questionCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"answeredCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"beatsCompleted":{"type":"integer","minimum":0,"maximum":9007199254740991},"beatsTotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"completion":{"type":"number","minimum":0,"maximum":1,"description":"Completed Beats ÷ all Beats (1 when there are none)."}},"required":["score","maxScore","percent","correctCount","questionCount","answeredCount","beatsCompleted","beatsTotal","completion"],"description":"The session after the erase."}},"required":["session","epoch","quizIds","answers","to","rewoundAt","totals"]}},"required":["id","type","version","createdAt","data"]}}}},"responses":{"2XX":{"description":"Delivered. Anything else, a redirect or no answer within 10 s is retried at +1 min, +5 min, +30 min, +2 h, +6 h, +12 h, +24 h, +24 h; then the delivery is dead."}}}},"webhook.test":{"post":{"operationId":"webhook webhook.test","summary":"The dashboard's Send test","description":"Sent by Send test on the dashboard, whatever the endpoint subscribes to. Not subscribable: only Send test delivers it.","tags":["Webhooks"],"parameters":[{"name":"Jami-Signature","in":"header","required":true,"description":"`t={unix seconds},v1={hex HMAC-SHA256 of t + \".\" + the body}`, keyed by the endpoint's secret; two `v1` entries while a rotated secret is in its grace. Refuse a `t` more than 300 s from your clock.","schema":{"type":"string"}},{"name":"Jami-Event-Id","in":"header","required":true,"description":"The event's id: the same on every attempt and redelivery. Deduplicate on it.","schema":{"type":"string"}},{"name":"Jami-Event-Type","in":"header","required":true,"description":"The event's `type`.","schema":{"type":"string"}},{"name":"Jami-Delivery-Attempt","in":"header","required":true,"description":"Which attempt this is: 1, then 2, 3… for the retries.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"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)$","description":"The event's id: the same on every attempt and redelivery (`Jami-Event-Id`)."},"type":{"type":"string","const":"webhook.test"},"version":{"type":"number","const":1},"createdAt":{"type":"string","format":"date-time","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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"An ISO 8601 instant."},"data":{"type":"object","properties":{"endpointId":{"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)$","description":"The endpoint the test was sent to."},"message":{"type":"string"}},"required":["endpointId","message"]}},"required":["id","type","version","createdAt","data"]}}}},"responses":{"2XX":{"description":"Delivered. Anything else, a redirect or no answer within 10 s is retried at +1 min, +5 min, +30 min, +2 h, +6 h, +12 h, +24 h, +24 h; then the delivery is dead."}}}}},"components":{"securitySchemes":{"viewerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"The viewer token of `POST /v1/sessions` (ES256, verifiable with `/.well-known/jwks.json`): 15 minutes, renewed by the heartbeat."},"secretKey":{"type":"http","scheme":"bearer","description":"A secret key (`sk_live_…` or `sk_test_…`), from your backend only: it is shown once when you create it."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","minLength":1},"message":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["error","message"],"description":"`{ error, message, details? }` — the body of every `/v1` error response."}}},"x-jami3d-error-codes":[{"code":"quota_exceeded","status":null,"description":"Reserved for a quota refusal; no route answers it in this version."},{"code":"ai_unavailable","status":403,"description":"Live AI cannot serve this request now (`details.reason` says why); playback goes on without it."},{"code":"origin_not_allowed","status":403,"description":"The publishable key does not allow the calling page's origin (the request's `Origin`)."},{"code":"release_not_found","status":404,"description":"Nothing playable here: no live release, a deleted or denylisted project, or one that cannot be embedded this way."},{"code":"session_expired","status":401,"description":"The session ended (8 hours after it began, or its access was withdrawn): start a new one."},{"code":"rate_limited","status":429,"description":"Too many requests: wait the seconds `details.retryAfter` (and the `Retry-After` header) give."},{"code":"stale_epoch","status":409,"description":"A write carried an epoch older than the session's: a rewind happened since."},{"code":"seq_gap","status":409,"description":"Facts arrived with a gap in their sequence; the client resyncs before retrying."},{"code":"rewind_required","status":409,"description":"An append landed before the session's story cursor: rewind first."},{"code":"invalid_input","status":400,"description":"The request is not what the route takes; `details` names the fields."},{"code":"invalid_token","status":401,"description":"The viewer token is missing, malformed, or signed by a key this server does not trust."},{"code":"not_found","status":404,"description":"Nothing by that id for this caller — unknown, another session's, or a draft."},{"code":"scope_required","status":403,"description":"The viewer token lacks the scope this route needs."},{"code":"verification_failed","status":403,"description":"The human check (Turnstile) failed; playback goes on without live AI."},{"code":"key_invalid","status":401,"description":"The publishable key or viewer-token grant is unknown, revoked or expired."},{"code":"body_too_large","status":413,"description":"The request body is larger than the route accepts."},{"code":"unsupported_media_type","status":415,"description":"The request body is not JSON (telemetry also takes `text/plain` JSON)."},{"code":"format_unsupported","status":501,"description":"OEmbed asked for a format other than JSON."},{"code":"retry_later","status":503,"description":"Something the route needs is unavailable for a moment; retry with backoff."},{"code":"internal_error","status":500,"description":"An unexpected failure (logged on the server)."}],"x-jami3d-webhooks":{"addressRanges":[{"value":"unspecified","description":"0.0.0.0/8, `::`."},{"value":"loopback","description":"127.0.0.0/8, `::1`, and the `localhost` names."},{"value":"private","description":"10/8, 172.16/12, 192.168/16, `fec0::/10`, local-use NAT64 `64:ff9b:1::/48`."},{"value":"cgnat","description":"Carrier-grade NAT, 100.64.0.0/10."},{"value":"link_local","description":"169.254.0.0/16, `fe80::/10`."},{"value":"metadata","description":"Cloud metadata services: 169.254.169.254, 169.254.170.2, 168.63.129.16, 100.100.100.200, `fd00:ec2::254`."},{"value":"ula","description":"Unique local IPv6, `fc00::/7`."},{"value":"multicast","description":"224.0.0.0/4, `ff00::/8`."},{"value":"documentation","description":"192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24, `2001:db8::/32`, `3fff::/20`."},{"value":"benchmarking","description":"198.18.0.0/15."},{"value":"reserved","description":"Everything else that is no public unicast address: 240.0.0.0/4, 192.0.0.0/24, 6to4, Teredo, …"}],"urlProblems":[{"value":"empty","description":"Nothing was typed."},{"value":"too_long","description":"Longer than `V1_WEBHOOK_URL_MAX_LENGTH`."},{"value":"not_a_url","description":"Not an absolute `https://` URL with a host."},{"value":"https_required","description":"`http://`: deliveries go over TLS only."},{"value":"credentials","description":"A user name or password in the URL: authenticate with the signature instead."},{"value":"fragment","description":"A `#fragment`, which is never sent."},{"value":"blocked_address","description":"A host that is (or always resolves to) an address deliveries never reach."}],"verificationFailures":[{"value":"missing","description":"No `Jami-Signature` header."},{"value":"malformed","description":"A header that is not `t=…,v1=…`."},{"value":"timestamp","description":"`t` is further from the receiver's clock than the tolerance: a replay, or a clock adrift."},{"value":"mismatch","description":"No `v1` matches the body under this secret."}]}}