{"openapi":"3.1.0","info":{"title":"Member apps API","version":"1.0.0","description":"Create member apps, courses, lessons and members programmatically (e.g. from Claude or automation tools).\n\nAuthenticate with `Authorization: Bearer ak_…` (create keys in Dashboard → API). Responses are `{ \"data\": … }` or `{ \"error\": { code, message } }`.\n\nScopes: `apps:read` (Ler apps, produtos, aulas e membros), `apps:write` (Criar e editar apps (incl. design e definições)), `products:write` (Criar e editar produtos, módulos e aulas), `members:write` (Adicionar membros e dar/retirar acessos), `notifications:write` (Enviar notificações push), `ai:use` (Gerar cursos com a IA da organização).\n\nTypical flow: POST /apps → POST /apps/{appId}/products (with modules and lessons, status draft) → review → PATCH /products/{id} {status: published} (members are notified) → POST /apps/{appId}/members."},"servers":[{"url":"https://www.zurianlab.com/api/v1"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/me":{"get":{"summary":"Organization and scopes of this key","description":"Scope: `any`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}}}},"/apps":{"get":{"summary":"List apps","description":"Scope: `apps:read`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}}},"post":{"summary":"Create an app (branding, language, settings)","description":"Scope: `apps:write`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"locale":{"default":"pt-PT","type":"string","enum":["pt-PT","pt-BR","es","en","de","fr","nl","nl-BE","fr-BE","it"]},"branding":{"type":"object","properties":{"logo_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","const":""}]},"logo_light_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","const":""}]},"icon_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","const":""}]},"splash_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","const":""}]},"login_background_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","const":""}]},"primary":{"default":"#7c3aed","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"secondary":{"default":"#22d3ee","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"background":{"default":"#0b0b12","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"surface":{"default":"#161622","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"text":{"default":"#f4f4f8","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"muted":{"default":"#9a9ab0","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"light_background":{"default":"#f6f6fb","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"light_surface":{"default":"#ffffff","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"light_text":{"default":"#14141f","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"mode":{"default":"dark","type":"string","enum":["dark","light","auto"]},"font":{"default":"Inter","type":"string","pattern":"^[A-Za-z0-9 ]{2,40}$"},"heading_font":{"type":"string","pattern":"^[A-Za-z0-9 ]{2,40}$"},"font_scale":{"default":1,"type":"number","minimum":0.8,"maximum":1.4},"radius":{"default":14,"type":"integer","minimum":0,"maximum":32},"card_ratio":{"default":"portrait","type":"string","enum":["portrait","landscape","square"]},"login_title":{"default":"","type":"string","maxLength":80},"login_subtitle":{"default":"","type":"string","maxLength":160},"welcome_message":{"default":"","type":"string","maxLength":500},"footer_text":{"default":"","type":"string","maxLength":200},"show_progress":{"default":true,"type":"boolean"},"show_continue":{"default":true,"type":"boolean"},"show_locked":{"default":true,"type":"boolean"},"show_community":{"default":true,"type":"boolean"},"show_tutor":{"default":true,"type":"boolean"},"custom_css":{"default":"","type":"string","maxLength":20000}}},"settings":{"type":"object","properties":{"community_enabled":{"type":"boolean"},"comments_enabled":{"type":"boolean"},"tutor_enabled":{"type":"boolean"},"onboarding_enabled":{"type":"boolean"},"onboarding_goals":{"maxItems":8,"type":"array","items":{"type":"string","maxLength":120}},"support_email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"support_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"}}}},"required":["name"]}}}}}},"/apps/{appId}":{"get":{"summary":"Get an app with its products","description":"Scope: `apps:read`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]},"patch":{"summary":"Update an app (name, language, branding, settings, status draft/live)","description":"Scope: `apps:write`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"locale":{"type":"string","enum":["pt-PT","pt-BR","es","en","de","fr","nl","nl-BE","fr-BE","it"]},"branding":{"type":"object","properties":{"logo_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","const":""}]},"logo_light_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","const":""}]},"icon_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","const":""}]},"splash_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","const":""}]},"login_background_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","const":""}]},"primary":{"default":"#7c3aed","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"secondary":{"default":"#22d3ee","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"background":{"default":"#0b0b12","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"surface":{"default":"#161622","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"text":{"default":"#f4f4f8","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"muted":{"default":"#9a9ab0","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"light_background":{"default":"#f6f6fb","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"light_surface":{"default":"#ffffff","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"light_text":{"default":"#14141f","type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"mode":{"default":"dark","type":"string","enum":["dark","light","auto"]},"font":{"default":"Inter","type":"string","pattern":"^[A-Za-z0-9 ]{2,40}$"},"heading_font":{"type":"string","pattern":"^[A-Za-z0-9 ]{2,40}$"},"font_scale":{"default":1,"type":"number","minimum":0.8,"maximum":1.4},"radius":{"default":14,"type":"integer","minimum":0,"maximum":32},"card_ratio":{"default":"portrait","type":"string","enum":["portrait","landscape","square"]},"login_title":{"default":"","type":"string","maxLength":80},"login_subtitle":{"default":"","type":"string","maxLength":160},"welcome_message":{"default":"","type":"string","maxLength":500},"footer_text":{"default":"","type":"string","maxLength":200},"show_progress":{"default":true,"type":"boolean"},"show_continue":{"default":true,"type":"boolean"},"show_locked":{"default":true,"type":"boolean"},"show_community":{"default":true,"type":"boolean"},"show_tutor":{"default":true,"type":"boolean"},"custom_css":{"default":"","type":"string","maxLength":20000}}},"settings":{"type":"object","properties":{"community_enabled":{"type":"boolean"},"comments_enabled":{"type":"boolean"},"tutor_enabled":{"type":"boolean"},"onboarding_enabled":{"type":"boolean"},"onboarding_goals":{"maxItems":8,"type":"array","items":{"type":"string","maxLength":120}},"support_email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"support_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"}}},"status":{"type":"string","enum":["draft","live"]}},"additionalProperties":false}}}}}},"/apps/{appId}/products":{"get":{"summary":"List products with modules and lessons","description":"Scope: `apps:read`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]},"post":{"summary":"Create a product, optionally with modules and lessons (video/audio/pdf/html/text/link/quiz/file)","description":"Scope: `products:write`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":190},"subtitle":{"type":"string","maxLength":300},"description":{"type":"string","maxLength":20000},"kind":{"default":"course","type":"string","enum":["course","video","audio","ebook","page","bundle","membership","program","service"]},"access":{"default":"paid","type":"string","enum":["free","paid","hidden"]},"status":{"default":"draft","type":"string","enum":["draft","published"]},"category":{"type":"string","maxLength":80},"cover_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"banner_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"checkout_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"price_label":{"type":"string","maxLength":40},"certificate_enabled":{"default":false,"type":"boolean"},"modules":{"default":[],"maxItems":100,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":190},"unlock_after_days":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"lessons":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":190},"kind":{"default":"text","type":"string","enum":["video","audio","pdf","html","text","link","quiz","file","assignment"]},"summary":{"type":"string","maxLength":5000},"media_url":{"description":"video/audio/pdf/link/file: YouTube, Vimeo, Google Drive or any file URL","type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"html":{"description":"html lessons: full HTML (rendered in a sandbox)","type":"string","maxLength":500000},"text":{"description":"text lessons: plain text / markdown-like","type":"string","maxLength":200000},"thumbnail_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"duration_seconds":{"default":0,"type":"integer","minimum":0,"maximum":86400},"unlock_after_days":{"default":0,"type":"integer","minimum":0,"maximum":3650},"free_preview":{"default":false,"type":"boolean"},"downloadable":{"default":false,"type":"boolean"},"quiz":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":1000},"options":{"minItems":2,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"correct":{"type":"integer","minimum":0,"maximum":9007199254740991},"explanation":{"type":"string","maxLength":2000}},"required":["question","options","correct"]}},"pass_score":{"default":70,"type":"integer","minimum":0,"maximum":100}},"required":["title"]}}},"required":["title","lessons"]}},"lessons":{"default":[],"description":"Lessons without a module","maxItems":200,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":190},"kind":{"default":"text","type":"string","enum":["video","audio","pdf","html","text","link","quiz","file","assignment"]},"summary":{"type":"string","maxLength":5000},"media_url":{"description":"video/audio/pdf/link/file: YouTube, Vimeo, Google Drive or any file URL","type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"html":{"description":"html lessons: full HTML (rendered in a sandbox)","type":"string","maxLength":500000},"text":{"description":"text lessons: plain text / markdown-like","type":"string","maxLength":200000},"thumbnail_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"duration_seconds":{"default":0,"type":"integer","minimum":0,"maximum":86400},"unlock_after_days":{"default":0,"type":"integer","minimum":0,"maximum":3650},"free_preview":{"default":false,"type":"boolean"},"downloadable":{"default":false,"type":"boolean"},"quiz":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":1000},"options":{"minItems":2,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"correct":{"type":"integer","minimum":0,"maximum":9007199254740991},"explanation":{"type":"string","maxLength":2000}},"required":["question","options","correct"]}},"pass_score":{"default":70,"type":"integer","minimum":0,"maximum":100}},"required":["title"]}},"notify":{"default":true,"description":"When published: notify members (in-app + push)","type":"boolean"}},"required":["title"]}}}}}},"/products/{productId}":{"get":{"summary":"Get a product with modules, lessons and lesson bodies","description":"Scope: `apps:read`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]},"patch":{"summary":"Update a product; setting status=published notifies members","description":"Scope: `products:write`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":190},"subtitle":{"type":"string","maxLength":300},"description":{"type":"string","maxLength":20000},"kind":{"type":"string","enum":["course","video","audio","ebook","page","bundle","membership","program","service"]},"access":{"type":"string","enum":["free","paid","hidden"]},"status":{"type":"string","enum":["draft","published"]},"category":{"type":"string","maxLength":80},"cover_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"banner_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"checkout_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"price_label":{"type":"string","maxLength":40},"certificate_enabled":{"type":"boolean"},"notify":{"type":"boolean"}},"additionalProperties":false}}}}},"delete":{"summary":"Delete a product","description":"Scope: `products:write`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/products/{productId}/lessons":{"post":{"summary":"Add lessons (optionally in a new or existing module)","description":"Scope: `products:write`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"module_title":{"type":"string"},"module_id":{"type":"string"},"lessons":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":190},"kind":{"default":"text","type":"string","enum":["video","audio","pdf","html","text","link","quiz","file","assignment"]},"summary":{"type":"string","maxLength":5000},"media_url":{"description":"video/audio/pdf/link/file: YouTube, Vimeo, Google Drive or any file URL","type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"html":{"description":"html lessons: full HTML (rendered in a sandbox)","type":"string","maxLength":500000},"text":{"description":"text lessons: plain text / markdown-like","type":"string","maxLength":200000},"thumbnail_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"duration_seconds":{"default":0,"type":"integer","minimum":0,"maximum":86400},"unlock_after_days":{"default":0,"type":"integer","minimum":0,"maximum":3650},"free_preview":{"default":false,"type":"boolean"},"downloadable":{"default":false,"type":"boolean"},"quiz":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":1000},"options":{"minItems":2,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"correct":{"type":"integer","minimum":0,"maximum":9007199254740991},"explanation":{"type":"string","maxLength":2000}},"required":["question","options","correct"]}},"pass_score":{"default":70,"type":"integer","minimum":0,"maximum":100}},"required":["title"]}}},"required":["lessons"]}}}}}},"/apps/{appId}/members":{"get":{"summary":"List members (?email=, ?limit=, ?offset=)","description":"Scope: `apps:read`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]},"post":{"summary":"Add a member and grant products (sends a one-click access email)","description":"Scope: `members:write`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"default":"","type":"string","maxLength":120},"product_ids":{"default":[],"maxItems":100,"type":"array","items":{"type":"string"}},"invite":{"default":true,"description":"Email a one-click access link","type":"boolean"}},"required":["email"]}}}}}},"/apps/{appId}/members/revoke":{"post":{"summary":"Revoke products from a member","description":"Scope: `members:write`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"product_ids":{"type":"array","items":{"type":"string"}}},"required":["email","product_ids"]}}}}}},"/apps/{appId}/notifications":{"post":{"summary":"Send or schedule a push/in-app notification to a segment","description":"Scope: `notifications:write`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","maxLength":500},"link":{"type":"string","maxLength":500},"image_url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"audience":{"default":"all","type":"string","enum":["all","owners","non_owners","inactive","tag","at_risk","likely_buyers"]},"product_id":{"type":"string"},"tag":{"type":"string","maxLength":60},"inactive_days":{"default":7,"type":"integer","minimum":1,"maximum":365},"scheduled_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"email":{"default":false,"type":"boolean"}},"required":["title"]}}}}}},"/apps/{appId}/generate":{"post":{"summary":"Generate a full course with the organization's AI (saved as draft)","description":"Scope: `ai:use + products:write`","security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"401":{"description":"Missing/invalid API key"},"403":{"description":"Missing scope"},"404":{"description":"Not found (or not in your organization)"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"type":"string"},"source_text":{"type":"string"}},"required":["description"]}}}}}}}}