{"openapi":"3.0.3","info":{"title":"ContextKing API","version":"1.0.0","description":"Fetch a saved Context by id. Contexts are immutable once saved. No authentication."},"servers":[{"url":"https://context-king.ajleonardi.com"}],"paths":{"/api/contexts/{id}":{"get":{"operationId":"getContext","summary":"Get a context by id (latest version unless ?version is given)","parameters":[{"name":"id","in":"path","required":true,"description":"Context id (shared by all versions of the context)","schema":{"type":"string"}},{"name":"version","in":"query","required":false,"description":"Version number to fetch. Omit to get the latest version.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"The requested context","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Context"}}}},"400":{"description":"Invalid version parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No context with that id, or no such version","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Context":{"type":"object","required":["id","version","latestVersion","name","description","createdAt","blocks"],"properties":{"id":{"type":"string","example":"x7Kp2mQa9bTe"},"version":{"type":"integer","example":2,"description":"Version returned"},"latestVersion":{"type":"integer","example":3,"description":"Newest version of this context"},"name":{"type":"string","example":"Project brief"},"description":{"type":"string","example":"Background for the Q4 launch"},"createdAt":{"type":"string","format":"date-time"},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/Block"}}}},"Block":{"type":"object","required":["label","content"],"properties":{"label":{"type":"string","example":"Goals"},"content":{"type":"string","description":"Markdown","example":"- Ship the **prototype**"}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}}}}