{"openapi":"3.1.0","info":{"title":"MediaAgo Customer API","version":"1.0.0","description":"Customer integrations for MediaAgo Automation. Documentation is public; private operations require a customer-scoped Bearer token. Internal Mac bridge/admin APIs use separate credentials and are not public integration endpoints."},"servers":[{"url":"https://mediaago.com"}],"components":{"securitySchemes":{"CustomerToken":{"type":"http","scheme":"bearer","description":"Create under Customer Panel → API. Shown once, stored as hash, valid 90 days, revocable. Never use the Mac bridge key."}}},"paths":{"/api/v1/plans":{"get":{"operationId":"get_plans","summary":"List subscription plans","description":"Website catalogue prices in USD. PayTR checkout shows the configured final recurring price separately; no currency conversion is implied.","parameters":[{"name":"language","in":"query","schema":{"type":"string","enum":["tr","en","ru","ar","es"],"default":"en"}}],"responses":{"200":{"description":"Plan catalogue","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"const":"USD"},"billing_interval":{"const":"month"},"plans":{"type":"array","items":{"type":"object","properties":{"kod":{"type":"string","description":"Plan code"},"ad":{"type":"string","description":"Name"},"fiyat":{"type":"number"},"kdv":{"type":"boolean","description":"Whether VAT is added to the website base price"},"tax_included":{"type":"boolean"}}}}}}}}}}}},"/api/v1/industries":{"get":{"operationId":"get_industries","summary":"List industries including Other","parameters":[{"name":"language","in":"query","schema":{"type":"string","enum":["tr","en","ru","ar","es"],"default":"en"}}],"responses":{"200":{"description":"Industry catalogue","content":{"application/json":{"schema":{"type":"object","properties":{"industries":{"type":"array","items":{"type":"object","required":["code","name","requires_description"],"properties":{"code":{"type":"string","description":"Industry code"},"name":{"type":"string","description":"Industry name"},"description":{"type":"string","description":"Summary"},"requires_description":{"type":"boolean"}}}}}}}}}}}},"/api/v1/demo-requests":{"post":{"operationId":"create_demo_request","summary":"Create a demo for your customer account","description":"Creates a new brand and demo; does not attach an existing brand. Existing customer account and Bearer token required. For images/logo/audio use multipart; multipart fields accept the English field names below as well as legacy form names (firma, sektor, dil, ses_secim, kvkk). Clone voice needs klon_onay=1 and ses audio. File validation happens before account/brand creation.","security":[{"CustomerToken":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per operation. Reuse with identical payload for retries. A processing reservation returns 409 and must be reconciled before submitting a new key.","schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["company","industry","brief1","brief2","voice","privacy_consent"],"properties":{"company":{"type":"string","description":"Brand/company name","minLength":2,"maxLength":160},"industry":{"type":"string","description":"Code returned by get_industries; use diger for Other"},"industry_other":{"type":"string","description":"Required description when industry is diger","maxLength":300},"website":{"type":"string","description":"Optional company website","maxLength":255},"language":{"type":"string","description":"Account/brief language","enum":["tr","en","ru","ar","es"],"default":"en"},"visual_mode":{"type":"string","description":"upload requires at least 5 images; graphics, stock and skip allow no images","enum":["upload","graphics","stock","skip"],"default":"upload"},"brief1":{"type":"string","description":"First production brief","minLength":300,"maxLength":6000},"brief2":{"type":"string","description":"Second production brief","minLength":300,"maxLength":6000},"voice":{"type":"string","description":"none: yok; default voice: varsayilan. Upload/clone require multipart audio and consent","enum":["yok","varsayilan","yukle","klon"]},"music":{"type":"string","description":"Music source","enum":["biz","yok","link","dosya"],"default":"biz"},"privacy_consent":{"type":"boolean","const":true,"description":"Explicit privacy/terms consent"}}}},"multipart/form-data":{"schema":{"type":"object","required":["company","industry","brief1","brief2","voice","privacy_consent"],"properties":{"company":{"type":"string","description":"Brand/company name","minLength":2,"maxLength":160},"industry":{"type":"string","description":"Code returned by get_industries; use diger for Other"},"industry_other":{"type":"string","description":"Required description when industry is diger","maxLength":300},"website":{"type":"string","description":"Optional company website","maxLength":255},"language":{"type":"string","description":"Account/brief language","enum":["tr","en","ru","ar","es"],"default":"en"},"visual_mode":{"type":"string","description":"upload requires at least 5 images; graphics, stock and skip allow no images","enum":["upload","graphics","stock","skip"],"default":"upload"},"brief1":{"type":"string","description":"First production brief","minLength":300,"maxLength":6000},"brief2":{"type":"string","description":"Second production brief","minLength":300,"maxLength":6000},"voice":{"type":"string","description":"none: yok; default voice: varsayilan. Upload/clone require multipart audio and consent","enum":["yok","varsayilan","yukle","klon"]},"music":{"type":"string","description":"Music source","enum":["biz","yok","link","dosya"],"default":"biz"},"privacy_consent":{"type":"string","description":"Use 1 for consent","enum":["1"]},"gorsel":{"type":"array","maxItems":15,"items":{"type":"string","format":"binary"},"description":"JPEG/PNG/WebP, max 15 MB each; at least 5 for upload mode"},"logo":{"type":"string","format":"binary","description":"Optional PNG/JPEG/WebP, max 5 MB"},"ses":{"type":"string","format":"binary","description":"Required for voice yukle/klon"},"klon_onay":{"type":"string","description":"1 for explicit voice-cloning consent"},"ses_varsayilan":{"type":"string","description":"Default voice code"},"muzik":{"type":"string","format":"binary"},"muzik_link":{"type":"string","description":"Music URL"}}}}}},"responses":{"200":{"description":"Demo accepted","content":{"application/json":{"schema":{"type":"object","required":["ok","marka_id","demo_id"],"properties":{"ok":{"const":true},"marka_id":{"type":"integer"},"demo_id":{"type":"integer"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}}}}},"/api/v1/contents":{"get":{"operationId":"get_contents","summary":"List your latest 100 content items","security":[{"CustomerToken":[]}],"responses":{"200":{"description":"Contents","content":{"application/json":{"schema":{"type":"object","properties":{"contents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"brand_id":{"type":"integer"},"title":{"type":"string","description":"Title"},"type":{"type":"string","description":"Content type"},"status":{"type":"string","description":"bekliyor, secim, onaylandi, revize, reddedildi, yayinlandi or suresi_doldu"},"version":{"type":"integer"},"available_versions":{"type":"array","items":{"type":"integer"},"description":"Available versions for revision selection"},"revisions_remaining":{"type":"integer"},"scheduled_at":{"type":["string","null"],"format":"date-time"}}}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}}}}},"/api/v1/contents/{id}/decision":{"post":{"operationId":"approve_content","summary":"Approve, request revision or reject content","description":"Requires ownership of the brand, an active brand or demo, a decision-eligible state and a valid version. Existing decision deadlines and revision limits apply. Approval is delivered through the existing Mac bridge; the API does not publish directly. For secim choose a version from available_versions returned by get_contents.","security":[{"CustomerToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per operation. Reuse with identical payload for retries. A processing reservation returns 409 and must be reconciled before submitting a new key.","schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["action","version"],"properties":{"action":{"type":"string","description":"Decision","enum":["approve","revise","reject"]},"version":{"type":"integer","minimum":1},"note":{"type":"string","description":"Revision requires at least 10 characters","maxLength":2000}}}}}},"responses":{"200":{"description":"Decision recorded","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"id":{"type":"integer"},"status":{"type":"string","description":"Decision state"},"publishing":{"type":"string","description":"Bridge handoff explanation"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}},"500":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["hata"],"properties":{"hata":{"type":"string","description":"Error description"}}}}}}}}}}}