{"openapi":"3.1.0","info":{"title":"spectra.fm API","description":"Async export API for spectra.fm. All endpoints are under /v1. Use objectKey + downloadUrl to retrieve export artifacts.","version":"1.0.0"},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key for authentication. Use X-API-Key or Authorization: Bearer <key>. Get yours at app.spectra.fm/settings/api-keys"}}},"paths":{"/v1/whoami":{"get":{"operationId":"getV1Whoami","tags":["Auth"],"description":"Validate API key and return key metadata","security":[{"apiKey":[]}],"responses":{"200":{"description":"API key is valid","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"service":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"enabled":{"type":"boolean"},"permissions":{"anyOf":[{"type":"object","properties":{},"additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"rateLimit":{"type":"object","properties":{"enabled":{"type":"boolean"},"max":{"anyOf":[{"type":"number"},{"type":"null"}]},"timeWindow":{"anyOf":[{"type":"number"},{"type":"null"}]},"remaining":{"anyOf":[{"type":"number"},{"type":"null"}]},"requestCount":{"type":"number"}},"required":["enabled","max","timeWindow","remaining","requestCount"]}},"required":["id","name","enabled","permissions","expiresAt","rateLimit"]}},"required":["ok","service","user","key"]},"example":{"ok":true,"service":"spectra-api","user":{"id":"user_123"},"key":{"id":"key_123","name":"My API Key","enabled":true,"permissions":null,"expiresAt":null,"rateLimit":{"enabled":false,"max":10,"timeWindow":86400000,"remaining":null,"requestCount":0}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"API_KEY_REQUIRED","message":"Provide API key via X-API-Key header"}}}}},"403":{"description":"API key disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"API_KEY_DISABLED","message":"This API key has been disabled"}}}}}}}},"/v1/projects":{"get":{"operationId":"getV1Projects","tags":["Projects"],"description":"List projects (optionally filtered by teamId)","security":[{"apiKey":[]}],"responses":{"200":{"description":"Projects retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"teamId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","organizationId","teamId","ownerId","name","slug","description","createdAt","updatedAt"]}}},"required":["projects"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"UNAUTHORIZED","message":"API key context missing"}}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"query","name":"teamId","schema":{"type":"string","minLength":1}}]}},"/v1/projects/{projectId}":{"get":{"operationId":"getV1Projects:projectId","tags":["Projects"],"description":"Get a project","security":[{"apiKey":[]}],"responses":{"200":{"description":"Project retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"teamId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","organizationId","teamId","ownerId","name","slug","description","createdAt","updatedAt"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]},"example":{"error":{"code":"UNAUTHORIZED","message":"API key context missing"}}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/layout":{"get":{"operationId":"getV1Projects:projectIdLayout","tags":["Project Details"],"description":"Get project layout (canvas and frames)","security":[{"apiKey":[]}],"responses":{"200":{"description":"Layout retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"sourcePresetId":{"type":"string"},"layoutType":{"type":"string","enum":["horizontal","vertical","grid","custom"]},"gridColumns":{"type":"number"},"canvas":{"type":"object","properties":{"width":{"type":"number"},"height":{"type":"number"}},"required":["width","height"]},"frames":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"}},"required":["id","label","x","y","width","height"]}}},"required":["canvas","frames"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/template":{"get":{"operationId":"getV1Projects:projectIdTemplate","tags":["Project Details"],"description":"Get project HTML template","security":[{"apiKey":[]}],"responses":{"200":{"description":"Template retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"html":{"type":"string"},"cssVariables":{"type":"object","properties":{},"additionalProperties":{"type":"string"}},"locales":{"type":"object","properties":{"defaultLocale":{"type":"string"},"entries":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{},"additionalProperties":{"type":"string"}}}},"required":["defaultLocale","entries"]},"themes":{"type":"object","properties":{"defaultTheme":{"type":"string"},"entries":{"type":"object","properties":{},"additionalProperties":{"type":"object","properties":{},"additionalProperties":{"type":"string"}}}},"required":["defaultTheme","entries"]},"contentOverrides":{"type":"object","properties":{},"additionalProperties":{"type":"string"}}},"required":["html"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"query","name":"includeCssVariables","schema":{"type":"string"}},{"in":"query","name":"includeLocales","schema":{"type":"string"}},{"in":"query","name":"includeThemes","schema":{"type":"string"}},{"in":"query","name":"includeContentOverrides","schema":{"type":"string"}},{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/assets":{"get":{"operationId":"getV1Projects:projectIdAssets","tags":["Project Details"],"description":"List project assets","security":[{"apiKey":[]}],"responses":{"200":{"description":"Assets retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"},"byteSize":{"type":"number"},"checksum":{"anyOf":[{"type":"string"},{"type":"null"}]},"uploadedById":{"type":"string"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","properties":{},"additionalProperties":{}},"contentPath":{"type":"string"},"contentUrl":{"type":"string"}},"required":["id","projectId","filename","mimeType","byteSize","checksum","uploadedById","createdAt","updatedAt","metadata","contentPath","contentUrl"]}}},"required":["assets"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"query","name":"mimeTypeFilter","schema":{"type":"string"}},{"in":"query","name":"filenameSearch","schema":{"type":"string"}},{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/assets/{assetId}/content":{"get":{"operationId":"getV1Projects:projectIdAssets:assetIdContent","tags":["Project Details"],"description":"Fetch asset content (text only)","security":[{"apiKey":[]}],"responses":{"200":{"description":"Asset content retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string"},"mimeType":{"type":"string"},"filename":{"type":"string"}},"required":["content","mimeType","filename"]}}}},"400":{"description":"Asset content not readable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Asset not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"assetId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/history":{"get":{"operationId":"getV1Projects:projectIdHistory","tags":["History"],"description":"List project snapshots","security":[{"apiKey":[]}],"responses":{"200":{"description":"Snapshots retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"snapshots":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"version":{"type":"number"},"createdById":{"type":"string"},"createdAt":{"type":"string"},"metadata":{"anyOf":[{"type":"object","properties":{"auto":{"type":"boolean"},"reason":{"type":"string","enum":["auto","manual"]},"kind":{"type":"string","enum":["manual","autosave","auto","export"]},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"teamId":{"anyOf":[{"type":"string"},{"type":"null"}]},"extra":{"type":"object","properties":{},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"required":["auto","reason","kind","label","createdByName","createdAt","teamId","extra"]},{"type":"null"}]}},"required":["id","projectId","version","createdById","createdAt","metadata"]}}},"required":["snapshots"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"query","name":"limit","schema":{"type":"string"}},{"in":"query","name":"includeAutoSnapshots","schema":{"type":"string"}},{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/locales":{"get":{"operationId":"getV1Projects:projectIdLocales","tags":["Project Details"],"description":"List locales for a project","security":[{"apiKey":[]}],"responses":{"200":{"description":"Locales retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"locales":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"isDefault":{"type":"boolean"}},"required":["id","isDefault"]}},"primaryLocale":{"type":"string"}},"required":["locales","primaryLocale"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/themes":{"get":{"operationId":"getV1Projects:projectIdThemes","tags":["Project Details"],"description":"List themes for a project","security":[{"apiKey":[]}],"responses":{"200":{"description":"Themes retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"themes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"isDefault":{"type":"boolean"}},"required":["id","isDefault"]}},"primaryTheme":{"type":"string"}},"required":["themes","primaryTheme"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/content-variables":{"get":{"operationId":"getV1Projects:projectIdContent-variables","tags":["Project Details"],"description":"List content variable slots for a project","security":[{"apiKey":[]}],"responses":{"200":{"description":"Content variables retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"contentVariables":{"description":"Available content variable slots for exports.","type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"defaultValue":{"type":"string"}},"required":["key","defaultValue"]}}},"required":["contentVariables"]},"example":{"contentVariables":[{"key":"app-name","defaultValue":"YourApp"}]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/exports":{"post":{"operationId":"postV1Projects:projectIdExports","tags":["Exports"],"description":"Create an export job","security":[{"apiKey":[]}],"responses":{"202":{"description":"Export job created","content":{"application/json":{"schema":{"type":"object","properties":{"exportId":{"type":"string"},"projectId":{"type":"string"},"status":{"description":"Export lifecycle status.","type":"string","enum":["queued","processing","completed","failed"]},"createdAt":{"type":"string"},"statusUrl":{"type":"string"}},"required":["exportId","projectId","status","createdAt","statusUrl"]},"example":{"exportId":"export_123","projectId":"proj_123","status":"queued","createdAt":"2025-01-01T00:00:00.000Z","statusUrl":"https://api.spectra.fm/v1/projects/proj_123/exports/export_123"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"500":{"description":"Export failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"combinations":{"type":"array","items":{"type":"object","properties":{"locale":{"type":"string"},"theme":{"type":"string"}},"required":["locale","theme"]}},"contentVariations":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}},"version":{"anyOf":[{"type":"number"},{"type":"string","const":"latest"}]}}}}}}},"get":{"operationId":"getV1Projects:projectIdExports","tags":["Exports"],"description":"List exports for a project","security":[{"apiKey":[]}],"responses":{"200":{"description":"Exports retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"exports":{"type":"array","items":{"type":"object","properties":{"exportId":{"type":"string"},"projectId":{"type":"string"},"status":{"description":"Export lifecycle status.","type":"string","enum":["queued","processing","completed","failed"]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"zip":{"anyOf":[{"type":"object","properties":{"objectKey":{"description":"R2 object key for this artifact. Use downloadUrl or /exports/download.","type":"string"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}]},"downloadUrl":{"description":"Authenticated download URL for this artifact.","type":"string"}},"required":["objectKey","filename"]},{"type":"null"}]},"locales":{"type":"array","items":{"type":"string"}},"themes":{"type":"array","items":{"type":"string"}},"hasContentVariations":{"type":"boolean"},"error":{"anyOf":[{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},{"type":"null"}]}},"required":["exportId","projectId","status","createdAt","completedAt","variantCount","zip","locales","themes","hasContentVariations","error"]}}},"required":["exports"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"query","name":"limit","schema":{"type":"string"}}]}},"/v1/projects/{projectId}/exports/options":{"get":{"operationId":"getV1Projects:projectIdExportsOptions","tags":["Exports"],"description":"Get available export options (locales, themes, content variables)","security":[{"apiKey":[]}],"responses":{"200":{"description":"Export options retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"locales":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"isDefault":{"type":"boolean"}},"required":["id","isDefault"]}},"themes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"isDefault":{"type":"boolean"}},"required":["id","isDefault"]}},"contentVariables":{"description":"Available content variable slots for exports.","type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"defaultValue":{"type":"string"}},"required":["key","defaultValue"]}},"primaryLocale":{"type":"string"},"primaryTheme":{"type":"string"}},"required":["locales","themes","contentVariables","primaryLocale","primaryTheme"]},"example":{"locales":[{"id":"en","label":"EN","isDefault":true},{"id":"de","label":"DE","isDefault":false}],"themes":[{"id":"light","label":"Light","isDefault":true},{"id":"dark","label":"Dark","isDefault":false}],"contentVariables":[{"key":"app-name","defaultValue":"YourApp"}],"primaryLocale":"en","primaryTheme":"light"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Project not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/exports/download":{"get":{"operationId":"getV1Projects:projectIdExportsDownload","tags":["Exports"],"description":"Download a specific export artifact by object key","security":[{"apiKey":[]}],"responses":{"200":{"description":"Download export artifact"},"400":{"description":"Missing or invalid artifact object key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied - user does not have access to this project","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Export artifact not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"500":{"description":"Failed to fetch export artifact","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"query","name":"objectKey","schema":{"type":"string"},"required":true,"description":"R2 object key returned by export status/artifact endpoints."},{"in":"query","name":"filename","schema":{"type":"string"},"description":"Optional filename override for the download response."}]}},"/v1/projects/{projectId}/exports/{exportId}":{"get":{"operationId":"getV1Projects:projectIdExports:exportId","tags":["Exports"],"description":"Get export status","security":[{"apiKey":[]}],"responses":{"200":{"description":"Export status retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"exportId":{"type":"string"},"projectId":{"type":"string"},"status":{"description":"Export lifecycle status.","type":"string","enum":["queued","processing","completed","failed"]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"zip":{"anyOf":[{"type":"object","properties":{"objectKey":{"description":"R2 object key for this artifact. Use downloadUrl or /exports/download.","type":"string"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}]},"downloadUrl":{"description":"Authenticated download URL for this artifact.","type":"string"}},"required":["objectKey","filename"]},{"type":"null"}]},"locales":{"type":"array","items":{"type":"string"}},"themes":{"type":"array","items":{"type":"string"}},"hasContentVariations":{"type":"boolean"},"error":{"anyOf":[{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},{"type":"null"}]}},"required":["exportId","projectId","status","createdAt","completedAt","variantCount","zip","locales","themes","hasContentVariations","error"]},"example":{"exportId":"export_123","projectId":"proj_123","status":"completed","createdAt":"2025-01-01T00:00:00.000Z","completedAt":"2025-01-01T00:05:00.000Z","variantCount":2,"zip":{"objectKey":"projects/proj_123/exports/export_123/export_123.zip","filename":"export_123.zip","downloadUrl":"https://api.spectra.fm/v1/projects/proj_123/exports/download?objectKey=projects%2Fproj_123%2Fexports%2Fexport_123%2Fexport_123.zip&filename=export_123.zip"},"locales":["en"],"themes":["light"],"hasContentVariations":false,"error":null}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Export not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"exportId","schema":{"type":"string"},"required":true}]}},"/v1/projects/{projectId}/exports/{exportId}/artifacts":{"get":{"operationId":"getV1Projects:projectIdExports:exportIdArtifacts","tags":["Exports"],"description":"List export artifacts","security":[{"apiKey":[]}],"responses":{"200":{"description":"Export artifacts retrieved","content":{"application/json":{"schema":{"type":"object","properties":{"exportId":{"type":"string"},"projectId":{"type":"string"},"artifacts":{"type":"array","items":{"type":"object","properties":{"objectKey":{"description":"R2 object key for this artifact. Use downloadUrl or /exports/download.","type":"string"},"size":{"anyOf":[{"type":"number"},{"type":"null"}]},"uploaded":{"anyOf":[{"type":"string"},{"type":"null"}]},"filename":{"type":"string"},"downloadUrl":{"description":"Authenticated download URL for this artifact.","type":"string"}},"required":["objectKey","size","uploaded"]}}},"required":["exportId","projectId","artifacts"]},"example":{"exportId":"export_123","projectId":"proj_123","artifacts":[{"objectKey":"projects/proj_123/exports/export_123/en-light/full.jpg","size":123456,"uploaded":"2025-01-01T00:05:00.000Z","filename":"full.jpg","downloadUrl":"https://api.spectra.fm/v1/projects/proj_123/exports/download?objectKey=projects%2Fproj_123%2Fexports%2Fexport_123%2Fen-light%2Ffull.jpg&filename=full.jpg"}]}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Export not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":{}}},"required":["code","message"]}},"required":["error"]}}}}},"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"exportId","schema":{"type":"string"},"required":true}]}}}}