{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Totemia Public Content","version":"1.0.0","description":"Current public records only. Anonymous reads confer no write authority. Fetch a manifest and every pinned part for long documents. Compare retained public Markdown to inspect changes. No private revision history."},"servers":[{"url":"https://totemiaempire.com"}],"security":[],"x-public-only":true,"externalDocs":{"url":"https://totemiaempire.com/developers/api"},"paths":{"/api/public/content":{"get":{"operationId":"listPublicContent","summary":"List public content","parameters":[{"name":"collection","in":"query","required":false,"schema":{"default":"laws","type":"string","enum":["laws","imperial-orders","bills","articles","pages","organizations","regions","events"]}},{"name":"cursor","in":"query","required":false,"schema":{"description":"Opaque continuation value from next. Do not construct it.","type":"string","maxLength":512,"pattern":"^[a-zA-Z0-9_-]+$"}},{"name":"since","in":"query","required":false,"schema":{"description":"Inclusive modification time, not an enactment date. Reconcile full inventories for removals.","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":{"description":"Decimal integer from 1 to 100, default 50.","default":"50","type":"string","pattern":"^(?:[1-9]\\d?|100)$"}}],"responses":{"200":{"description":"Current metadata page. Follow next until null","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentIndex"}}}},"400":{"description":"Invalid, unknown or duplicated query parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Read only. Allow: GET, HEAD, OPTIONS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Honor Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Source unavailable. Honor Retry-After. Never interpret failure as withdrawal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"head":{"operationId":"headPublicContent","summary":"Public content headers","parameters":[{"name":"collection","in":"query","required":false,"schema":{"default":"laws","type":"string","enum":["laws","imperial-orders","bills","articles","pages","organizations","regions","events"]}},{"name":"cursor","in":"query","required":false,"schema":{"description":"Opaque continuation value from next. Do not construct it.","type":"string","maxLength":512,"pattern":"^[a-zA-Z0-9_-]+$"}},{"name":"since","in":"query","required":false,"schema":{"description":"Inclusive modification time, not an enactment date. Reconcile full inventories for removals.","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":{"description":"Decimal integer from 1 to 100, default 50.","default":"50","type":"string","pattern":"^(?:[1-9]\\d?|100)$"}}],"responses":{"200":{"description":"Current metadata page. Follow next until null"},"400":{"description":"Invalid, unknown or duplicated query parameter"},"405":{"description":"Read only. Allow: GET, HEAD, OPTIONS"},"429":{"description":"Rate limited. Honor Retry-After"},"503":{"description":"Source unavailable. Honor Retry-After. Never interpret failure as withdrawal"}}},"options":{"summary":"Anonymous read preflight","responses":{"204":{"description":"GET and HEAD only. No credentials"}},"operationId":"publicContentIndexPreflight"}},"/api/public/content/document":{"get":{"operationId":"readPublicDocument","summary":"Read or download a public document","parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","maxLength":300,"description":"Canonical public page path.","examples":["/about/laws/civil-code"]}},{"name":"format","in":"query","required":false,"schema":{"default":"json","type":"string","enum":["json","md"]}},{"name":"view","in":"query","required":false,"schema":{"default":"full","description":"Manifest is JSON only and cannot be combined with part.","type":"string","enum":["full","manifest"]}},{"name":"part","in":"query","required":false,"schema":{"description":"Exact UTF-8 fragment number. Requires revision.","type":"string","pattern":"^[1-9]\\d{0,5}$"}},{"name":"revision","in":"query","required":false,"schema":{"description":"Snapshot returned by a previous manifest. Changed snapshots return 409.","type":"string","pattern":"^[a-f0-9]{64}$"}},{"name":"If-None-Match","in":"header","required":false,"schema":{"type":"string"},"description":"Visibility is checked before 304"}],"responses":{"200":{"description":"Current public snapshot. Only full source is complete","headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"ETag":{"schema":{"type":"string"},"description":"Validator for this exact representation"},"X-Content-Revision":{"schema":{"type":"string"},"description":"SHA-256 of current reading snapshot"},"X-Content-Complete":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}},"text/markdown":{"schema":{"type":"string"}}}},"304":{"description":"Current public representation unchanged","headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"ETag":{"schema":{"type":"string"},"description":"Validator for this exact representation"},"X-Content-Revision":{"schema":{"type":"string"},"description":"SHA-256 of current reading snapshot"},"X-Content-Complete":{"schema":{"type":"string","enum":["true","false"]}}}},"400":{"description":"Invalid, unknown or duplicated query parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Missing, withdrawn or private. Does not reveal existence","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Read only. Allow: GET, HEAD, OPTIONS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Pinned snapshot changed. Restart from a new manifest","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited. Honor Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Source unavailable. Honor Retry-After. Never interpret failure as withdrawal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"head":{"operationId":"headPublicDocument","summary":"Public document headers","parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","maxLength":300,"description":"Canonical public page path.","examples":["/about/laws/civil-code"]}},{"name":"format","in":"query","required":false,"schema":{"default":"json","type":"string","enum":["json","md"]}},{"name":"view","in":"query","required":false,"schema":{"default":"full","description":"Manifest is JSON only and cannot be combined with part.","type":"string","enum":["full","manifest"]}},{"name":"part","in":"query","required":false,"schema":{"description":"Exact UTF-8 fragment number. Requires revision.","type":"string","pattern":"^[1-9]\\d{0,5}$"}},{"name":"revision","in":"query","required":false,"schema":{"description":"Snapshot returned by a previous manifest. Changed snapshots return 409.","type":"string","pattern":"^[a-f0-9]{64}$"}},{"name":"If-None-Match","in":"header","required":false,"schema":{"type":"string"},"description":"Visibility is checked before 304"}],"responses":{"200":{"description":"Current public snapshot. Only full source is complete","headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"ETag":{"schema":{"type":"string"},"description":"Validator for this exact representation"},"X-Content-Revision":{"schema":{"type":"string"},"description":"SHA-256 of current reading snapshot"},"X-Content-Complete":{"schema":{"type":"string","enum":["true","false"]}}}},"304":{"description":"Current public representation unchanged","headers":{"Cache-Control":{"schema":{"type":"string"},"description":"no-store"},"ETag":{"schema":{"type":"string"},"description":"Validator for this exact representation"},"X-Content-Revision":{"schema":{"type":"string"},"description":"SHA-256 of current reading snapshot"},"X-Content-Complete":{"schema":{"type":"string","enum":["true","false"]}}}},"400":{"description":"Invalid, unknown or duplicated query parameter"},"404":{"description":"Missing, withdrawn or private. Does not reveal existence"},"405":{"description":"Read only. Allow: GET, HEAD, OPTIONS"},"409":{"description":"Pinned snapshot changed. Restart from a new manifest"},"429":{"description":"Rate limited. Honor Retry-After"},"503":{"description":"Source unavailable. Honor Retry-After. Never interpret failure as withdrawal"}}},"options":{"summary":"Anonymous read preflight","responses":{"204":{"description":"GET and HEAD only. No credentials"}},"operationId":"publicDocumentPreflight"}}},"components":{"schemas":{"ContentIndex":{"type":"object","properties":{"kind":{"type":"string","const":"TotemiaPublicContentIndex"},"schemaVersion":{"type":"number","const":1},"collection":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"path":{"type":"string"},"title":{"type":"string"},"updatedAt":{"type":["string","null"]},"sourceComplete":{"type":"boolean"},"documentUrl":{"type":"string"},"markdownUrl":{"type":"string"}},"required":["kind","path","title","documentUrl","markdownUrl"],"additionalProperties":false}},"next":{"type":["string","null"]},"semantics":{"type":"string"}},"required":["kind","schemaVersion","collection","items","next","semantics"],"additionalProperties":false},"Document":{"type":"object","properties":{"kind":{"type":"string","const":"TotemiaPublicDocument"},"schemaVersion":{"type":"number","const":1},"title":{"type":"string"},"type":{"type":"string"},"canonicalUrl":{"type":"string","format":"uri"},"updatedAt":{"type":["string","null"]},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$"},"complete":{"type":"boolean"},"sourceComplete":{"type":"boolean"},"part":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"partCount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"semantics":{"type":"array","items":{"type":"string"}},"markdown":{"type":"string"},"parts":{"type":"array","items":{"type":"object","properties":{"number":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991},"startByte":{"type":"integer","minimum":0,"maximum":9007199254740991},"endByteExclusive":{"type":"integer","minimum":0,"maximum":9007199254740991},"url":{"type":"string"},"headingContextAtStart":{"type":"array","items":{"type":"object","properties":{"level":{"type":"integer","minimum":1,"maximum":6},"title":{"type":"string"}},"required":["level","title"],"additionalProperties":false}}},"required":["number","bytes","startByte","endByteExclusive","url","headingContextAtStart"],"additionalProperties":false}}},"required":["kind","schemaVersion","title","type","canonicalUrl","updatedAt","revision","complete","sourceComplete","part","partCount","semantics","parts"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["error"],"additionalProperties":false}}}}