{"openapi":"3.1.0","info":{"title":"The Democratic Space Rangers Story API","version":"1.0.0","description":"Read and edit the shared story universe. Authenticate browser sessions through Centerpoint or agents with Authorization: Bearer <token>."},"servers":[{"url":"https://arcbuilder.space-rangers.net"}],"paths":{"/api/items":{"get":{"summary":"List story elements","parameters":[{"name":"type","in":"query","schema":{"enum":["season","episode","character","arc","beat","fact"]}}],"responses":{"200":{"description":"Story elements"}}},"post":{"summary":"Create a story element","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemInput"}}}},"responses":{"201":{"description":"Created"}}}},"/api/items/{id}":{"get":{"summary":"Get an element and its links","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Story element"}}},"patch":{"summary":"Update an element","parameters":[{"$ref":"#/components/parameters/Id"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemInput"}}}},"responses":{"200":{"description":"Updated"}}},"delete":{"summary":"Delete an element","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"204":{"description":"Deleted"}}}},"/api/links":{"get":{"summary":"List relationships","responses":{"200":{"description":"Relationships"}}},"post":{"summary":"Connect two story elements","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["source_id","target_id"],"properties":{"source_id":{"type":"string"},"target_id":{"type":"string"},"kind":{"type":"string"},"note":{"type":"string"}}}}}},"responses":{"201":{"description":"Created"}}}},"/api/search":{"get":{"summary":"Search titles, summaries and tags","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Matches"}}}},"/api/export":{"get":{"summary":"Export the full series knowledge graph","responses":{"200":{"description":"Complete export"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"Id":{"name":"id","in":"path","required":true,"schema":{"type":"string"}}},"schemas":{"ItemInput":{"type":"object","properties":{"type":{"enum":["season","episode","character","arc","beat","fact"]},"title":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string"},"color":{"type":"string"},"parent_id":{"type":["string","null"]},"start_pos":{"type":"number"},"end_pos":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"},"tags":{"type":"array","items":{"type":"string"}},"meta":{"type":"object"}}}}},"security":[{"bearerAuth":[]}]}
