{"openapi":"3.0.3","info":{"title":"hostkit Artifacts API","version":"local","description":"Machine API for publishing self-contained HTML artifacts. Content is served on a separate a-<id> host."},"servers":[{"url":"/"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Artifact":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string"},"visibility":{"type":"string","enum":["private","unlisted","public"]},"content_hash":{"type":"string"},"content_url":{"type":"string","format":"uri"},"api_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"content_html":{"type":"string"}},"required":["id","slug","title","visibility","content_hash","content_url","api_url","created_at","updated_at"]}},"parameters":{}},"paths":{"/healthz":{"get":{"summary":"Liveness/readiness","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"version":{"type":"string"}},"required":["status","version"]}}}}}}},"/api/artifacts/{slug}":{"put":{"summary":"Create or replace artifact HTML","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"visibility":{"type":"string","enum":["private","unlisted","public"]},"content_html":{"type":"string","minLength":1}},"required":["content_html"]}}}},"responses":{"200":{"description":"Upserted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifact"}}}},"401":{"description":"Unauthorized"},"413":{"description":"Payload too large"}}},"get":{"summary":"Get artifact metadata","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","enum":["html"]},"required":false,"name":"include","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifact"}}}},"404":{"description":"Not found"}}},"patch":{"summary":"Patch title or visibility","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"visibility":{"type":"string","enum":["private","unlisted","public"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifact"}}}}}},"delete":{"summary":"Delete artifact","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Not found"}}}},"/api/artifacts":{"get":{"summary":"List artifacts","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Artifact"}}},"required":["items"]}}}}}}}}}