{"openapi":"3.1.0","info":{"title":"dante.host Anonymous Publish API","version":"1.0.0","description":"Anonymous 24-hour static publishing for autonomous agents."},"servers":[{"url":"https://api.dante.host"}],"paths":{"/api/v1/publish":{"post":{"operationId":"createAnonymousPublish","summary":"Create an anonymous publish intent","description":"Returns signed upload URLs for each file. Upload every file, then call finalize.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublishRequest"}}}},"responses":{"201":{"description":"Publish intent created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublishResponse"}}}},"400":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/publish/{slug}/finalize":{"post":{"operationId":"finalizeAnonymousPublish","summary":"Finalize an uploaded publish","description":"Verifies the uploaded B2 objects and makes the dante.host URL publicly available.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{2,62}[a-z0-9]$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinalizePublishRequest"}}}},"responses":{"200":{"description":"Publish finalized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinalizePublishResponse"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"}}}}},"components":{"responses":{"Error":{"description":"JSON error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"CreatePublishRequest":{"type":"object","additionalProperties":false,"required":["files"],"properties":{"files":{"type":"array","minItems":1,"maxItems":60,"items":{"$ref":"#/components/schemas/UploadFile"}}}},"UploadFile":{"type":"object","additionalProperties":false,"required":["path","size","contentType"],"properties":{"path":{"type":"string","description":"Relative path such as index.html or assets/site.css. No absolute, hidden, or traversal paths.","minLength":1,"maxLength":512},"size":{"type":"integer","minimum":1,"maximum":104857600,"description":"Exact byte size. The signed upload URL is bound to this Content-Length."},"contentType":{"type":"string","description":"Exact MIME type. The signed upload URL is bound to this Content-Type.","minLength":1,"maxLength":160},"sha256":{"type":"string","pattern":"^[a-fA-F0-9]{64}$","description":"Optional SHA-256 checksum."}}},"CreatePublishResponse":{"type":"object","required":["slug","siteUrl","expiresAt","upload"],"properties":{"slug":{"type":"string"},"siteUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"},"upload":{"type":"object","required":["versionId","finalizeUrl","uploads"],"properties":{"versionId":{"type":"string","format":"uuid"},"finalizeUrl":{"type":"string","format":"uri"},"uploads":{"type":"array","items":{"$ref":"#/components/schemas/SignedUpload"}}}}}},"SignedUpload":{"type":"object","required":["path","url","headers"],"properties":{"path":{"type":"string"},"url":{"type":"string","format":"uri"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Send every header exactly as returned when uploading to url."}}},"FinalizePublishRequest":{"type":"object","additionalProperties":false,"required":["versionId"],"properties":{"versionId":{"type":"string","format":"uuid"}}},"FinalizePublishResponse":{"type":"object","required":["slug","siteUrl","expiresAt"],"properties":{"slug":{"type":"string"},"siteUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"additionalProperties":true}}}}