{"openapi":"3.1.0","info":{"title":"Keytomic Docs","description":"Development documentation","version":"1.0.0"},"servers":[{"url":"/"}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/health":{"get":{"operationId":"getHealth","summary":"Health check","responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"ok"},"timestamp":{"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)))$"}},"required":["status","timestamp"],"additionalProperties":false}}}}}}},"/v1/blogs":{"get":{"operationId":"listBlogs","summary":"List blogs","description":"Lists published blogs newest first: by publishedAt descending, then by id descending. This order is fixed for v1, and nextCursor continues it.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Blogs page","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"excerpt":{"type":["string","null"]},"coverImageUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"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)))$"},"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)))$"}},"required":["id","slug","title","excerpt","coverImageUrl","publishedAt","updatedAt"],"additionalProperties":false}},"pageInfo":{"type":"object","properties":{"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false}},"required":["data","pageInfo"],"additionalProperties":false}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Workspace setup is incomplete","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}},"parameters":[{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"slug","schema":{"type":"string","minLength":1}}]}},"/v1/blogs/by-slug":{"get":{"operationId":"getBlogBySlug","summary":"Get blog by slug","description":"Gets one published blog with its HTML by its slug, in one call. The slug goes in the query because it can contain slashes.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Blog detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"excerpt":{"type":["string","null"]},"coverImageUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"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)))$"},"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)))$"},"html":{"type":"string","minLength":1},"seo":{"type":"object","properties":{"metaTitle":{"type":["string","null"]},"metaDescription":{"type":["string","null"]},"canonicalUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]}},"required":["metaTitle","metaDescription","canonicalUrl"],"additionalProperties":false}},"required":["id","slug","title","excerpt","coverImageUrl","publishedAt","updatedAt","html","seo"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid slug","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Workspace setup is incomplete","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Blog not found in scoped project","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}},"parameters":[{"in":"query","name":"slug","schema":{"type":"string","minLength":1},"required":true}]}},"/v1/blogs/{id}":{"get":{"operationId":"getBlogById","summary":"Get blog by id","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Blog detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"excerpt":{"type":["string","null"]},"coverImageUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"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)))$"},"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)))$"},"html":{"type":"string","minLength":1},"seo":{"type":"object","properties":{"metaTitle":{"type":["string","null"]},"metaDescription":{"type":["string","null"]},"canonicalUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]}},"required":["metaTitle","metaDescription","canonicalUrl"],"additionalProperties":false}},"required":["id","slug","title","excerpt","coverImageUrl","publishedAt","updatedAt","html","seo"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Invalid blog id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Workspace setup is incomplete","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Blog not found in scoped project","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}}}}