{"openapi":"3.0.3","info":{"title":"Minami Gallery — Fuse draft imports","version":"1.1.0","description":"Create private gallery drafts from Fuse. Create a drafts:create key in Gallery → Manage logins → Fuse API. Call from the Fuse server; do not put the key in browser code. Imports never publish artwork."},"servers":[{"url":"https://688377.xyz/api/portfolio"}],"paths":{"/integrations/fuse/drafts":{"post":{"operationId":"importFuseDraft","summary":"Create a draft or update a linked session’s cover/pattern","security":[{"FuseKey":[]}],"description":"At most 20 MiB per image, 42 MiB total. PNG, JPEG, WebP and GIF are accepted by file signature. Optional grid uses exact MARD cells (version 1, palette mard, cols/rows 1–300, row-major cells, null for empty). Image-only imports require admin preparation. Retries with the same key and normalized content return the existing piece; reusing a key for different content returns 409. Idempotency is scoped to the API key. With source_session_id, cover and pattern are independently optional (at least one required); exports for the same session and API key update the same private draft. Only supplied image slots are replaced; Gallery metadata is preserved. Exact grids in session exports are pending candidates and must be saved by an admin. Replacing a pattern clears its prepared grid. Published or deleted linked artwork returns 409.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Stable ID for one export, reused on network retries. Use a new ID for a new export.","schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","maxLength":120},"cover":{"type":"string","format":"binary"},"pattern":{"type":"string","format":"binary"},"grid":{"type":"string","description":"JSON text, not a JSON file part. Example: {\"version\":1,\"palette\":\"mard\",\"cols\":2,\"rows\":1,\"cells\":[\"C02\",null]}"},"tags":{"type":"string","description":"JSON array of up to 30 tags, each at most 40 characters.","default":"[]"},"access_mode":{"type":"string","enum":["unlock","free"],"default":"unlock"},"source_session_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$","description":"Stable Fuse session ID, independent of node, export format, name and retry ID. Scoped to this API key."}},"anyOf":[{"required":["cover","pattern"]},{"required":["source_session_id","cover"]},{"required":["source_session_id","pattern"]}]}}}},"responses":{"200":{"description":"Linked draft updated or idempotent replay; replay does not mutate artwork.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResult"}}}},"201":{"description":"Draft created; published is always false.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResult"}}}},"400":{"description":"Invalid fields, image bytes, grid, or idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, revoked, or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Changed idempotent request, deleted artwork, or session-linked artwork is published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Upload too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Expected multipart/form-data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"FuseKey":{"type":"http","scheme":"bearer","description":"Scoped import key: creates private drafts and updates image slots of drafts linked to its own source_session_id. Cannot edit arbitrary artwork, publish, browse accounts or download artwork."}},"schemas":{"ImportResult":{"type":"object","properties":{"piece_id":{"type":"integer"},"cover_id":{"type":"integer","nullable":true},"design_id":{"type":"integer","nullable":true},"published":{"type":"boolean"},"grid_ready":{"type":"boolean"},"replayed":{"type":"boolean"},"prepare_url":{"type":"string","description":"Relative URL requiring an admin session."},"view_url":{"type":"string","description":"Relative URL requiring gallery access."}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}}}}