{"openapi":"3.1.0","info":{"title":"AdAnt API","version":"1.0.0","description":"Backend API for AdAnt — chat, drive, and a skill registry","contact":{"name":"AdAnt","url":"https://adant.ai"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"http://localhost:8080","description":"Development server"}],"tags":[{"name":"Admin","description":"Admin user management and platform stats"},{"name":"API Keys","description":"API key management for programmatic access"},{"name":"Auth","description":"User authentication and username management"},{"name":"Avatars","description":"Avatar assets — system + user owned, with generation"},{"name":"Billing","description":"Subscription billing and Stripe integration"},{"name":"Products","description":"Product assets — user-owned, with pictures and USPs"},{"name":"VideoEditor","description":"Revisioned video editing projects and render jobs"},{"name":"VideoTemplates","description":"Curated reference ad videos guiding template-style generation"},{"name":"Contact","description":"Contact message submission and management"},{"name":"Scheduled tasks","description":"Recurring agent tasks — cadence, run history, and emailed reports"},{"name":"Drive","description":"File storage and management with R2 integration"},{"name":"Errors","description":"Client error reporting and monitoring infrastructure"},{"name":"Health","description":"System health and status monitoring"},{"name":"v1.apiKey","description":"v1 — API key management (RPC, API-key auth)"},{"name":"v1.artifact","description":"v1 — Brain-produced artifacts. Brain ingests via bst_* per-session bearer; web reads via session cookie."},{"name":"v1.skill","description":"v1 — Skill registry (RPC, API-key auth)"},{"name":"v1.skill.github","description":"v1 — GitHub-indexed skills (RPC, public read-only)"},{"name":"v1.skillList","description":"v1 — Skill lists & favorites (RPC, API-key auth)"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"API key authentication via Better Auth"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"ValidationError":{"allOf":[{"$ref":"#/components/schemas/ApiError"},{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR"]},"details":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"message":{"type":"string"}},"required":["path","message"]}}},"required":["issues"]}},"required":["details"]}]},"ApiError":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_REQUEST","UNAUTHORIZED","FORBIDDEN","NOT_FOUND","CONFLICT","TOO_MANY_REQUESTS","VALIDATION_ERROR","INTERNAL_ERROR","INSUFFICIENT_CREDITS","UPGRADE_REQUIRED","PREVIEW_PENDING","SERVICE_UNAVAILABLE"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{"nullable":true}},"requestId":{"type":"string"},"timestamp":{"type":"string"}},"required":["code","message","timestamp"]},"ErrorReportPayload":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/CapturedError"},"maxItems":50},"userAgent":{"type":"string"},"url":{"type":"string"},"timestamp":{"type":"number"}},"required":["errors","userAgent","url","timestamp"],"description":"Payload for reporting client errors"},"CapturedError":{"type":"object","properties":{"id":{"type":"string"},"message":{"type":"string"},"stack":{"type":"string"},"componentStack":{"type":"string"},"source":{"type":"string","enum":["hydration","loader","action","render","streaming","network","global","unknown"]},"severity":{"type":"string","enum":["fatal","error","warning","info"]},"route":{"type":"string"},"timestamp":{"type":"number"},"context":{"type":"object","additionalProperties":{"nullable":true}},"digest":{"type":"string"},"count":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["id","message","source","severity","timestamp"],"description":"A captured client error"},"AdminUserListResponse":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserListItem"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["users","total","page","limit"],"description":"Paginated user list response"},"AdminUserListItem":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"authMethod":{"type":"string","enum":["google","email","unknown"]},"username":{"type":"string","nullable":true},"role":{"type":"string","enum":["user","internal","admin"]},"banned":{"type":"boolean"},"banReason":{"type":"string","nullable":true},"banExpires":{"type":"string","nullable":true,"format":"date-time"},"bannedAt":{"type":"string","nullable":true,"format":"date-time"},"tier":{"type":"string"},"subscriptionStatus":{"type":"string","nullable":true},"subscriptionInterval":{"type":"string","nullable":true,"enum":["month","year",null]},"subscriptionPeriodEnd":{"type":"string","nullable":true,"format":"date-time"},"subscriptionCancelAtPeriodEnd":{"type":"boolean","nullable":true},"subscriptionPromotionCode":{"type":"string","nullable":true},"trialEndsAt":{"type":"string","nullable":true,"format":"date-time"},"lastActiveAt":{"type":"string","nullable":true,"format":"date-time"},"creditBalanceCredits":{"type":"number","nullable":true,"minimum":0},"createdAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","email","emailVerified","authMethod","username","role","banned","banReason","banExpires","bannedAt","tier","subscriptionStatus","subscriptionInterval","subscriptionPeriodEnd","subscriptionCancelAtPeriodEnd","subscriptionPromotionCode","trialEndsAt","lastActiveAt","creditBalanceCredits","createdAt"],"description":"User list item for admin dashboard"},"AdminUserUsage":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"subscription":{"type":"object","nullable":true,"properties":{"tier":{"type":"string"},"status":{"type":"string"},"interval":{"type":"string","enum":["month","year"]},"currentPeriodEnd":{"type":"string","nullable":true,"format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"}},"required":["tier","status","interval","currentPeriodEnd","cancelAtPeriodEnd"]}},"required":["id","name","email","subscription"]},"windows":{"type":"object","properties":{"d1":{"type":"object","properties":{"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["credits","count"]},"d3":{"type":"object","properties":{"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["credits","count"]},"d7":{"type":"object","properties":{"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["credits","count"]},"d30":{"type":"object","properties":{"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["credits","count"]},"all":{"type":"object","properties":{"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["credits","count"]}},"required":["d1","d3","d7","d30","all"]},"byDay":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["day","credits","count"]}},"byMediaType":{"type":"array","items":{"type":"object","properties":{"mediaType":{"type":"string"},"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["mediaType","credits","count"]}},"bySession":{"type":"array","items":{"type":"object","properties":{"sessionId":{"type":"string"},"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true},"mediaTypes":{"type":"array","items":{"type":"string"}}},"required":["sessionId","credits","count","mediaTypes"]}},"byModel":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["provider","model","credits","count"]}}},"required":["user","windows","byDay","byMediaType","bySession","byModel"],"description":"Per-user subscription status and scheduled cancellation date plus spend over fixed windows and by-day / media-type / session / model breakdowns."},"AdminUserCreditHistory":{"type":"object","properties":{"summary":{"type":"object","properties":{"currentBalanceCredits":{"type":"number","nullable":true},"totalGrantedCredits":{"type":"number","nullable":true,"minimum":0},"totalUsedCredits":{"type":"number","nullable":true,"minimum":0},"pendingCredits":{"type":"number","nullable":true,"minimum":0}},"required":["currentBalanceCredits","totalGrantedCredits","totalUsedCredits","pendingCredits"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["grant_signup","grant_daily","grant_monthly","grant_topup","grant_admin","grant_promotion","grant_referral","grant_refund","debit_reserve","debit_settle","debit_release","debit_consume","expire_free"]},"bucket":{"type":"string","enum":["daily","monthly","one_time"]},"deltaCredits":{"type":"number","nullable":true},"operationNetCredits":{"type":"number","nullable":true},"operationId":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"expiresAt":{"type":"string","nullable":true,"format":"date-time"},"reservationId":{"type":"string","nullable":true},"reservationStatus":{"type":"string","nullable":true,"enum":["pending","settled","refunded","expired",null]},"createdAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","kind","bucket","deltaCredits","operationNetCredits","operationId","metadata","expiresAt","reservationId","reservationStatus","createdAt"]}},"total":{"type":"integer","nullable":true,"minimum":0},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1}},"required":["summary","items","total","page","limit"],"description":"Paginated raw credit-ledger audit plus lifetime grants, realized usage, pending holds, and current spendable balance."},"AdminSystemUsage":{"type":"object","properties":{"windows":{"type":"object","properties":{"d1":{"type":"object","properties":{"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["credits","count"]},"d3":{"type":"object","properties":{"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["credits","count"]},"d7":{"type":"object","properties":{"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["credits","count"]},"d30":{"type":"object","properties":{"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["credits","count"]},"all":{"type":"object","properties":{"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["credits","count"]}},"required":["d1","d3","d7","d30","all"]},"byDay":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["day","credits","count"]}},"byMediaType":{"type":"array","items":{"type":"object","properties":{"mediaType":{"type":"string"},"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["mediaType","credits","count"]}},"byModel":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["provider","model","credits","count"]}},"byUserType":{"type":"array","items":{"type":"object","properties":{"userType":{"type":"string","enum":["internal","admin","free","basic","standard","pro","max","enterprise","suspended"]},"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["userType","credits","count"]}},"byUser":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["user","internal","admin"]},"banned":{"type":"boolean"},"tier":{"type":"string"},"credits":{"type":"number","nullable":true,"minimum":0},"count":{"type":"integer","nullable":true}},"required":["userId","name","email","role","banned","tier","credits","count"]}}},"required":["windows","byDay","byMediaType","byModel","byUserType","byUser"],"description":"System-wide spend for the selected account audience over fixed windows plus by-day / model / media-type / user-type / top-users breakdowns for the requested window."},"AdminStats":{"type":"object","properties":{"totalUsers":{"type":"number"},"proUsers":{"type":"number"},"newUsersThisMonth":{"type":"number"},"newUsersToday":{"type":"number"},"activeUsersToday":{"type":"number"},"trialUsers":{"type":"number"},"subscriptionUsers":{"type":"number"},"yearlySubscriptionUsers":{"type":"number"},"scheduledCancellationUsers":{"type":"number"},"bannedUsers":{"type":"number"},"bannedUsersThisMonth":{"type":"number"},"bannedUsersToday":{"type":"number"},"artifactsCreatedToday":{"type":"number"},"mediaGenerationsToday":{"type":"number"},"artifactDownloadsToday":{"type":"number"},"videoDownloadsToday":{"type":"number"},"sessionsWithVideoDownloads":{"type":"number"},"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"newUsers":{"type":"number"},"totalUsers":{"type":"number"},"activeUsers":{"type":"number"},"artifactsCreated":{"type":"number"},"mediaGenerations":{"type":"number"},"artifactDownloads":{"type":"number"},"videoDownloads":{"type":"number"}},"required":["date","newUsers","totalUsers","activeUsers","artifactsCreated","mediaGenerations","artifactDownloads","videoDownloads"]}},"bannedTrend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"newBannedUsers":{"type":"number"},"totalBannedUsers":{"type":"number"}},"required":["date","newBannedUsers","totalBannedUsers"]}}},"required":["totalUsers","proUsers","newUsersThisMonth","newUsersToday","activeUsersToday","trialUsers","subscriptionUsers","yearlySubscriptionUsers","scheduledCancellationUsers","bannedUsers","bannedUsersThisMonth","bannedUsersToday","artifactsCreatedToday","mediaGenerationsToday","artifactDownloadsToday","videoDownloadsToday","sessionsWithVideoDownloads","trend","bannedTrend"],"description":"Admin dashboard stats"},"AdminSessionCountStats":{"type":"object","properties":{"zero":{"type":"integer","minimum":0},"one":{"type":"integer","minimum":0},"two":{"type":"integer","minimum":0},"threePlus":{"type":"integer","minimum":0}},"required":["zero","one","two","threePlus"],"description":"Active user accounts grouped by their all-time number of chat sessions."},"AdminGrowthMetrics":{"type":"object","properties":{"activeUsers":{"type":"object","properties":{"d1":{"type":"integer"},"d3":{"type":"integer"},"d7":{"type":"integer"},"d30":{"type":"integer"}},"required":["d1","d3","d7","d30"]},"newUsers":{"type":"object","properties":{"d1":{"type":"integer"},"d7":{"type":"integer"},"d30":{"type":"integer"}},"required":["d1","d7","d30"]},"returningUsers":{"type":"object","properties":{"d7":{"type":"integer"},"d30":{"type":"integer"}},"required":["d7","d30"]},"activation":{"type":"object","properties":{"users":{"type":"integer"},"eligibleUsers":{"type":"integer"},"rate":{"type":"number","nullable":true}},"required":["users","eligibleUsers","rate"]},"stickiness":{"type":"object","properties":{"dauWau":{"type":"number","nullable":true},"dauMau":{"type":"number","nullable":true}},"required":["dauWau","dauMau"]},"retention":{"type":"object","properties":{"d1":{"type":"object","properties":{"users":{"type":"integer"},"eligibleUsers":{"type":"integer"},"rate":{"type":"number","nullable":true}},"required":["users","eligibleUsers","rate"]},"d7":{"type":"object","properties":{"users":{"type":"integer"},"eligibleUsers":{"type":"integer"},"rate":{"type":"number","nullable":true}},"required":["users","eligibleUsers","rate"]},"d30":{"type":"object","properties":{"users":{"type":"integer"},"eligibleUsers":{"type":"integer"},"rate":{"type":"number","nullable":true}},"required":["users","eligibleUsers","rate"]}},"required":["d1","d7","d30"]},"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"newUsers":{"type":"integer"},"activeUsers":{"type":"integer"},"returningUsers":{"type":"integer"}},"required":["date","newUsers","activeUsers","returningUsers"]}}},"required":["activeUsers","newUsers","returningUsers","activation","stickiness","retention","trend"],"description":"Rolling acquisition, activation, engagement, and retention metrics."},"AdminRegistrationPolicy":{"type":"object","properties":{"emailSignUpEnabled":{"type":"boolean"},"googleSignUpEnabled":{"type":"boolean"},"turnstileEnabled":{"type":"boolean"},"sentinelEnforcementEnabled":{"type":"boolean"},"blockedEmailDomains":{"type":"array","items":{"type":"string"}},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"updatedBy":{"type":"string","nullable":true}},"required":["emailSignUpEnabled","googleSignUpEnabled","turnstileEnabled","sentinelEnforcementEnabled","blockedEmailDomains","updatedAt","updatedBy"],"description":"Global account-registration policy and audit metadata."},"UpdateAdminRegistrationPolicyInput":{"type":"object","properties":{"emailSignUpEnabled":{"type":"boolean"},"googleSignUpEnabled":{"type":"boolean"},"turnstileEnabled":{"type":"boolean"},"sentinelEnforcementEnabled":{"type":"boolean"}},"description":"Enable or pause email/password registration, Google registration, Turnstile protection, or Sentinel enforcement."},"AdminBlockEmailDomainResponse":{"type":"object","properties":{"policy":{"$ref":"#/components/schemas/AdminRegistrationPolicy"},"suspendedCount":{"type":"integer","minimum":0}},"required":["policy","suspendedCount"]},"AdminBlockEmailDomainInput":{"type":"object","properties":{"domain":{"type":"string"},"suspendExisting":{"type":"boolean","default":true}},"required":["domain"]},"AdminReferralProgram":{"type":"object","properties":{"enabled":{"type":"boolean"},"joinRewardCredits":{"type":"number","minimum":0},"paidRewardCredits":{"type":"number","minimum":0},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"updatedBy":{"type":"string","nullable":true}},"required":["enabled","joinRewardCredits","paidRewardCredits","updatedAt","updatedBy"]},"UpdateAdminReferralProgramInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"joinRewardCredits":{"type":"number","minimum":0,"maximum":100000},"paidRewardCredits":{"type":"number","minimum":0,"maximum":100000}}},"AdminOpenRouterSupplierCost":{"type":"object","properties":{"month":{"type":"string"},"turns":{"type":"integer"},"byokTurns":{"type":"integer"},"mediaJobs":{"type":"integer"},"upstream":{"type":"array","items":{"type":"object","properties":{"account":{"type":"string"},"usd":{"type":"number"}},"required":["account","usd"]}},"upstreamUsd":{"type":"number"},"byokFeeUsd":{"type":"number"},"creditsUsd":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"upstreamUsd":{"type":"number"},"byokFeeUsd":{"type":"number"},"creditsUsd":{"type":"number"}},"required":["date","upstreamUsd","byokFeeUsd","creditsUsd"]}}},"required":["month","turns","byokTurns","mediaJobs","upstream","upstreamUsd","byokFeeUsd","creditsUsd","daily"],"description":"OpenRouter supplier cost for a month, split the way ADA-179's settle metadata records it: upstream inference billed to our own accounts (BYOK), OpenRouter's BYOK fee, and OpenRouter credits. OpenRouter media jobs add their `params.supplierCost` (credits, or the fee on a BYOK job)."},"AdminMediaSupplierMargin":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"totals":{"type":"object","properties":{"jobs":{"type":"integer"},"chargedCredits":{"type":"number"},"chargedUsd":{"type":"number"},"supplierUsd":{"type":"number"},"measuredUsd":{"type":"number"},"estimatedUsd":{"type":"number"},"measuredJobs":{"type":"integer"},"estimatedJobs":{"type":"integer"},"unknownJobs":{"type":"integer"},"unrecordedJobs":{"type":"integer"},"pricedChargedUsd":{"type":"number"},"ratio":{"type":"number","nullable":true}},"required":["jobs","chargedCredits","chargedUsd","supplierUsd","measuredUsd","estimatedUsd","measuredJobs","estimatedJobs","unknownJobs","unrecordedJobs","pricedChargedUsd","ratio"]},"byProvider":{"type":"array","items":{"type":"object","properties":{"jobs":{"type":"integer"},"chargedCredits":{"type":"number"},"chargedUsd":{"type":"number"},"supplierUsd":{"type":"number"},"measuredUsd":{"type":"number"},"estimatedUsd":{"type":"number"},"measuredJobs":{"type":"integer"},"estimatedJobs":{"type":"integer"},"unknownJobs":{"type":"integer"},"unrecordedJobs":{"type":"integer"},"pricedChargedUsd":{"type":"number"},"ratio":{"type":"number","nullable":true},"provider":{"type":"string"}},"required":["jobs","chargedCredits","chargedUsd","supplierUsd","measuredUsd","estimatedUsd","measuredJobs","estimatedJobs","unknownJobs","unrecordedJobs","pricedChargedUsd","ratio","provider"]}},"byModel":{"type":"array","items":{"type":"object","properties":{"jobs":{"type":"integer"},"chargedCredits":{"type":"number"},"chargedUsd":{"type":"number"},"supplierUsd":{"type":"number"},"measuredUsd":{"type":"number"},"estimatedUsd":{"type":"number"},"measuredJobs":{"type":"integer"},"estimatedJobs":{"type":"integer"},"unknownJobs":{"type":"integer"},"unrecordedJobs":{"type":"integer"},"pricedChargedUsd":{"type":"number"},"ratio":{"type":"number","nullable":true},"provider":{"type":"string"},"model":{"type":"string"},"kind":{"type":"string"}},"required":["jobs","chargedCredits","chargedUsd","supplierUsd","measuredUsd","estimatedUsd","measuredJobs","estimatedJobs","unknownJobs","unrecordedJobs","pricedChargedUsd","ratio","provider","model","kind"]}}},"required":["from","to","totals","byProvider","byModel"],"description":"Credits charged against what the serving provider charged us, per provider and per catalog model, for media jobs finished in a UTC date range. Supplier figures come from each job's `params.supplierCost` and say whether they were measured, estimated from a list price, or unknown."},"AdminGrantCreditsResponse":{"type":"object","properties":{"userId":{"type":"string"},"granted":{"type":"boolean"},"creditBalanceCredits":{"type":"number","nullable":true,"minimum":0}},"required":["userId","granted","creditBalanceCredits"],"description":"Result of an admin credit grant"},"AdminGrantCreditsInput":{"type":"object","properties":{"amountCredits":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":100000},"reason":{"type":"string","maxLength":500}},"required":["amountCredits"],"description":"Input for rewarding credits to a user (admin only)"},"UpdateUserRoleResponse":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","internal","admin"]}},"required":["id","role"],"description":"Updated user role response"},"UpdateUserRoleInput":{"type":"object","properties":{"role":{"type":"string","enum":["user","internal","admin"]}},"required":["role"],"description":"Input for updating a user's role"},"AdminSetUserBanResponse":{"type":"object","properties":{"id":{"type":"string"},"banned":{"type":"boolean"},"banReason":{"type":"string","nullable":true},"banExpires":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","banned","banReason","banExpires"],"description":"Updated account suspension state"},"AdminSetUserBanInput":{"type":"object","properties":{"banned":{"type":"boolean"},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["banned"],"description":"Suspend or restore a user account (admin only)"},"AdminDeleteUserResponse":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"],"description":"Deleted user account"},"AdminSetUserTierResponse":{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"string"}},"required":["id","tier"],"description":"Updated user tier response"},"AdminSetUserTierInput":{"type":"object","properties":{"tier":{"type":"string","enum":["free","enterprise"]},"note":{"type":"string","maxLength":500}},"required":["tier"],"description":"Input for setting a user's manual tier override (admin only)"},"AdminMediaJobsResponse":{"type":"object","properties":{"jobs":{"type":"array","items":{"$ref":"#/components/schemas/AdminMediaJobItem"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["jobs","total","page","limit"],"description":"Paginated cross-user media-generation job list."},"AdminMediaJobItem":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"userName":{"type":"string"},"userEmail":{"type":"string"},"kind":{"type":"string"},"operation":{"type":"string"},"provider":{"type":"string"},"model":{"type":"string"},"status":{"type":"string"},"brainSessionId":{"type":"string","nullable":true},"resultArtifactId":{"type":"string","nullable":true},"thumbnailUrl":{"type":"string","nullable":true},"blurhash":{"type":"string","nullable":true},"params":{"type":"object","additionalProperties":{"nullable":true}},"creditsSpent":{"type":"number","minimum":0},"error":{"type":"string","nullable":true},"downloadCount":{"type":"integer","minimum":0},"lastDownloadedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"completedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","userId","userName","userEmail","kind","operation","provider","model","status","brainSessionId","resultArtifactId","params","creditsSpent","error","downloadCount","lastDownloadedAt","createdAt","completedAt"],"description":"One media-generation job, joined with its owner."},"AdminMediaJobStats":{"type":"object","properties":{"running":{"type":"integer","nullable":true},"completed":{"type":"integer","nullable":true},"failed":{"type":"integer","nullable":true},"canceled":{"type":"integer","nullable":true}},"required":["running","completed","failed","canceled"],"description":"Media-generation job counts grouped by status."},"AdminArtifactsResponse":{"type":"object","properties":{"artifacts":{"type":"array","items":{"$ref":"#/components/schemas/AdminArtifactItem"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["artifacts","total","page","limit"],"description":"Paginated cross-user artifact list."},"AdminArtifactItem":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"userName":{"type":"string"},"userEmail":{"type":"string"},"kind":{"type":"string"},"viewer":{"type":"string"},"title":{"type":"string"},"mediaKind":{"type":"string","nullable":true,"enum":["image","video","audio",null]},"filename":{"type":"string"},"contentType":{"type":"string","nullable":true},"sessionTitle":{"type":"string","nullable":true},"brainSessionId":{"type":"string"},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"thumbnailUrl":{"type":"string","nullable":true},"blurhash":{"type":"string","nullable":true},"width":{"type":"number","nullable":true},"height":{"type":"number","nullable":true}},"required":["id","userId","userName","userEmail","kind","viewer","title","mediaKind","filename","contentType","sessionTitle","brainSessionId","createdAt"],"description":"One artifact row, joined with its owner."},"AdminArtifactPayloadResponse":{"type":"object","properties":{"url":{"type":"string"},"kind":{"type":"string"},"mediaKind":{"type":"string","nullable":true,"enum":["image","video","audio",null]},"filename":{"type":"string"},"contentType":{"type":"string","nullable":true},"downloadUrl":{"type":"string"}},"required":["url","kind","mediaKind","filename","contentType"],"description":"Presigned inline preview URL plus an optional named download URL for an artifact's bytes."},"AdminWavespeedBalance":{"type":"object","properties":{"configured":{"type":"boolean"},"balance":{"type":"number","nullable":true}},"required":["configured","balance"],"description":"WaveSpeed account balance (USD). `configured` is false when no API key is set."},"AdminWavespeedUsage":{"type":"object","properties":{"configured":{"type":"boolean"},"days":{"type":"number"},"startTime":{"type":"string","nullable":true},"endTime":{"type":"string","nullable":true},"perModelUsage":{"type":"array","items":{"type":"object","properties":{"model_uuid":{"type":"string"},"model_type":{"type":"string","default":""},"unit_price":{"type":"number","default":0},"total_cost":{"type":"number","default":0},"total_count":{"type":"number","default":0},"last_used_date":{"type":"string","default":""}},"required":["model_uuid"]}},"dailyUsage":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"amount":{"type":"number","default":0},"count":{"type":"number","default":0},"models":{"type":"array","items":{"type":"object","properties":{"model_uuid":{"type":"string"},"amount":{"type":"number","default":0},"count":{"type":"number","default":0}},"required":["model_uuid"]},"default":[]}},"required":["date"]}},"summary":{"type":"object","properties":{"total_cost":{"type":"number","default":0},"total_requests":{"type":"number","default":0},"success_requests":{"type":"number","default":0}}}},"required":["configured","days","startTime","endTime","perModelUsage","dailyUsage","summary"],"description":"WaveSpeed usage stats over the requested window."},"AdminWavespeedBillings":{"type":"object","properties":{"configured":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","properties":{"uuid":{"type":"string"},"access_key_name":{"type":"string","default":""},"billing_type":{"type":"string","default":""},"created_at":{"type":"string"},"price":{"type":"number","default":0},"model_uuid":{"type":"string","default":""},"prediction_uuid":{"type":"string","default":""},"prediction_status":{"type":"string","default":""},"order_state":{"type":"string","default":""}},"required":["uuid","created_at"]}},"page":{"type":"number"},"pageSize":{"type":"number"},"total":{"type":"number"}},"required":["configured","items","page","pageSize","total"],"description":"Paginated WaveSpeed billing records."},"AdminFalAccount":{"type":"object","properties":{"configured":{"type":"boolean"},"username":{"type":"string","nullable":true},"balance":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true}},"required":["configured","username","balance","currency"],"description":"fal account identity and credit balance. `configured` is false when no admin-scoped Platform API key is set."},"AdminFalUsage":{"type":"object","properties":{"configured":{"type":"boolean"},"days":{"type":"number"},"startTime":{"type":"string","nullable":true},"endTime":{"type":"string","nullable":true},"perModelUsage":{"type":"array","items":{"type":"object","properties":{"endpointId":{"type":"string"},"unit":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"number"},"discount":{"type":"number"},"totalCost":{"type":"number"},"currency":{"type":"string"}},"required":["endpointId","unit","quantity","unitPrice","discount","totalCost","currency"]}},"dailyUsage":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"amount":{"type":"number"},"quantity":{"type":"number"}},"required":["date","amount","quantity"]}},"summary":{"type":"object","properties":{"totalCost":{"type":"number"},"totalDiscount":{"type":"number"},"totalQuantity":{"type":"number"},"currency":{"type":"string"},"modelCount":{"type":"number"}},"required":["totalCost","totalDiscount","totalQuantity","currency","modelCount"]}},"required":["configured","days","startTime","endTime","perModelUsage","dailyUsage","summary"],"description":"fal model usage and billed cost over the requested window."},"AdminByteplusBilling":{"type":"object","properties":{"configured":{"type":"boolean"},"period":{"type":"string"},"page":{"type":"number"},"pageSize":{"type":"number"},"total":{"type":"number"},"summary":{"type":"object","nullable":true,"properties":{"originalAmount":{"type":"number"},"discountedAmount":{"type":"number"},"payableAmount":{"type":"number"},"paidAmount":{"type":"number"},"unpaidAmount":{"type":"number"},"couponAmount":{"type":"number"},"currency":{"type":"string","nullable":true}},"required":["originalAmount","discountedAmount","payableAmount","paidAmount","unpaidAmount","couponAmount","currency"]},"details":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"expenseDate":{"type":"string"},"product":{"type":"string"},"productName":{"type":"string"},"instance":{"type":"string"},"configuration":{"type":"string"},"billableItem":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"},"originalAmount":{"type":"number"},"discountedAmount":{"type":"number"},"payableAmount":{"type":"number"},"paidAmount":{"type":"number"},"unpaidAmount":{"type":"number"},"currency":{"type":"string"},"billingMode":{"type":"string"}},"required":["id","expenseDate","product","productName","instance","configuration","billableItem","quantity","unit","originalAmount","discountedAmount","payableAmount","paidAmount","unpaidAmount","currency","billingMode"]}},"dailySpend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"amount":{"type":"number"}},"required":["date","amount"]}}},"required":["configured","period","page","pageSize","total","summary","details","dailySpend"],"description":"BytePlus account bill overview, daily spend, and paginated detail for one accounting period. `configured` is false when the separate Billing AK/SK pair is absent."},"AdminPromotionsListResponse":{"type":"object","properties":{"configured":{"type":"boolean"},"promotions":{"type":"array","items":{"$ref":"#/components/schemas/AdminPromotion"}}},"required":["configured","promotions"],"description":"List of promotion codes; `configured: false` when Stripe is unset."},"AdminPromotion":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"active":{"type":"boolean"},"timesRedeemed":{"type":"integer"},"maxRedemptions":{"type":"integer","nullable":true},"remaining":{"type":"integer","nullable":true},"percentOff":{"type":"number","nullable":true},"term":{"type":"string","enum":["month","year","all"]},"duration":{"type":"string","nullable":true},"expiresAt":{"type":"number","nullable":true},"createdAt":{"type":"number"}},"required":["id","code","active","timesRedeemed","maxRedemptions","remaining","percentOff","term","duration","expiresAt","createdAt"],"description":"A Stripe promotion code flattened for the admin UI."},"AdminPromotionDetailResponse":{"type":"object","properties":{"promotion":{"$ref":"#/components/schemas/AdminPromotion"},"redemptions":{"type":"array","items":{"$ref":"#/components/schemas/AdminPromotionRedemption"}}},"required":["promotion","redemptions"],"description":"A promotion code plus the users who redeemed it."},"AdminPromotionRedemption":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"redeemedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["userId","name","email","redeemedAt"],"description":"A user who redeemed a promotion code."},"AdminCreatePromotionInput":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9-]+$"},"maxRedemptions":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":1000000},"percentOff":{"anyOf":[{"type":"number","enum":[30]},{"type":"number","enum":[50]},{"type":"number","enum":[70]}]},"term":{"type":"string","enum":["month","year","all"],"default":"month"},"expiresAt":{"type":"integer"}},"required":["code","maxRedemptions","percentOff"],"description":"Create a 30%, 50% or 70%-off promotion code for monthly Pro's first month, any yearly plan's first year, or every plan's first invoice."},"AdminUpdatePromotionInput":{"type":"object","properties":{"active":{"type":"boolean"}},"required":["active"],"description":"Pause (false) or resume (true) a promotion code."},"CreditDiscountConfig":{"type":"object","properties":{"globalDiscountPercent":{"type":"integer","minimum":0,"maximum":99},"globalUpdatedAt":{"type":"string","nullable":true},"modelDiscounts":{"type":"array","items":{"$ref":"#/components/schemas/CreditDiscountModel"}}},"required":["globalDiscountPercent","globalUpdatedAt","modelDiscounts"]},"CreditDiscountModel":{"type":"object","properties":{"modelId":{"type":"string"},"discountPercent":{"type":"integer","minimum":0,"maximum":99},"updatedAt":{"type":"string"}},"required":["modelId","discountPercent","updatedAt"]},"CreditDiscountInput":{"type":"object","properties":{"discountPercent":{"type":"integer","minimum":0,"maximum":99}},"required":["discountPercent"]},"DeleteCreditDiscountResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]},"AdminRecentSubscriptions":{"type":"object","properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/AdminRecentSubscriptionRow"}},"total":{"type":"integer"},"byReason":{"type":"object","properties":{"video_download":{"type":"integer"},"report_unlock":{"type":"integer"},"social_posting":{"type":"integer"},"credits":{"type":"integer"},"model_tier":{"type":"integer"},"promo":{"type":"integer"},"email":{"type":"integer"},"direct":{"type":"integer"}},"required":["video_download","report_unlock","social_posting","credits","model_tier","promo","email","direct"]},"recorded":{"type":"integer"},"since":{"type":"string"},"days":{"type":"integer"}},"required":["subscriptions","total","byReason","recorded","since","days"],"description":"Subscriptions started in a window of UTC days, newest first, each with the account and why it most likely subscribed: the surface the web recorded at checkout, or the account's activity in the day before."},"AdminRecentSubscriptionRow":{"type":"object","properties":{"id":{"type":"string"},"stripeSubscriptionId":{"type":"string"},"createdAt":{"type":"string"},"tier":{"type":"string"},"status":{"type":"string"},"billingInterval":{"type":"string","enum":["month","year"]},"cancelAtPeriodEnd":{"type":"boolean"},"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]},"source":{"type":"string","nullable":true,"enum":["video_download","report_unlock","social_posting","credits","model_tier","promo","email","settings","onboarding","tool_page",null]},"promotionCode":{"type":"string","nullable":true},"referred":{"type":"boolean"},"reason":{"$ref":"#/components/schemas/AdminSubscriptionReason"}},"required":["id","stripeSubscriptionId","createdAt","tier","status","billingInterval","cancelAtPeriodEnd","user","source","promotionCode","referred","reason"]},"AdminSubscriptionReason":{"type":"object","properties":{"kind":{"type":"string","enum":["video_download","report_unlock","social_posting","credits","model_tier","promo","email","direct"]},"confidence":{"type":"string","enum":["recorded","inferred","unknown"]},"evidence":{"type":"array","items":{"type":"string"}}},"required":["kind","confidence","evidence"]},"AdminFreeTrialExperiment":{"type":"object","properties":{"status":{"type":"string","enum":["running","off","all-on"]},"rolloutPercentage":{"type":"integer"},"since":{"type":"string","nullable":true},"arms":{"type":"object","properties":{"trial":{"$ref":"#/components/schemas/AdminFreeTrialArmStats"},"control":{"$ref":"#/components/schemas/AdminFreeTrialArmStats"}},"required":["trial","control"]},"pValue":{"type":"number","nullable":true}},"required":["status","rolloutPercentage","since","arms","pValue"],"description":"The free-trial A/B test since the flag last changed: customer signups split by the flag's percentage bucket (targeted accounts excluded), each arm's signups, trials and payers, and the signup-to-paid significance."},"AdminFreeTrialArmStats":{"type":"object","properties":{"signups":{"type":"integer"},"paid":{"type":"integer"},"trialStarted":{"type":"integer"},"signupCredits":{"type":"integer"}},"required":["signups","paid","trialStarted","signupCredits"]},"AdminSignupCreditsExperiment":{"type":"object","properties":{"status":{"type":"string","enum":["running","off","all-on"]},"rolloutPercentage":{"type":"integer"},"since":{"type":"string","nullable":true},"variantCredits":{"type":"number"},"truncated":{"type":"boolean"},"arms":{"type":"object","properties":{"ten":{"$ref":"#/components/schemas/AdminSignupCreditsArmStats"},"control":{"$ref":"#/components/schemas/AdminSignupCreditsArmStats"}},"required":["ten","control"]},"pValue":{"type":"number","nullable":true}},"required":["status","rolloutPercentage","since","variantCredits","truncated","arms","pValue"],"description":"The signup-credits A/B test since the flag last changed: customer signups split by the flag's percentage bucket (targeted accounts excluded), each arm's payers, and the free credits it was granted, used and cost."},"AdminSignupCreditsArmStats":{"type":"object","properties":{"signups":{"type":"integer"},"paid":{"type":"integer"},"granted":{"type":"integer"},"held":{"type":"integer"},"missed":{"type":"integer"},"creditsGranted":{"type":"number"},"creditsSpent":{"type":"number"},"spendUsd":{"type":"number"}},"required":["signups","paid","granted","held","missed","creditsGranted","creditsSpent","spendUsd"]},"AdminFreeRunExperiment":{"type":"object","properties":{"mode":{"type":"string","enum":["off","ab","on"]},"flag":{"type":"object","properties":{"enabled":{"type":"boolean"},"rolloutPercentage":{"type":"number"},"updatedAt":{"type":"string","nullable":true}},"required":["enabled","rolloutPercentage","updatedAt"]},"since":{"type":"string","nullable":true,"description":"The first assignment, or null when there is none."},"arms":{"type":"array","items":{"type":"object","properties":{"arm":{"type":"string","enum":["free_run","control"]},"accounts":{"type":"integer","description":"Accounts (canonical mailboxes) dealt this arm."},"granted":{"type":"integer","description":"Accounts whose free-run credits landed."},"held":{"type":"integer","description":"Accounts whose grant review kept the credits."},"ran":{"type":"integer","description":"Accounts that spent any of their free-run credits."},"grantedCredits":{"type":"number"},"usedCredits":{"type":"number","description":"Free-run credits spent (a reserve still running counts what it holds)."},"expiredCredits":{"type":"number"},"costUsd":{"type":"number","description":"Vendor cost of the credits spent, at $0.20 a credit. Media is charged at cost; agent turns carry a 15–30% margin, so this overstates agent cost a little."},"payers":{"type":"integer","description":"Accounts that have paid, at any time after assignment."},"payersWithin14d":{"type":"integer"},"paidRate":{"type":"number","nullable":true,"description":"payers / accounts, or null with no accounts."},"revenueUsd":{"type":"number","description":"First-month list price of each payer's plan (a lower bound: yearly terms and renewals are not counted)."},"costPerPayerUsd":{"type":"number","nullable":true}},"required":["arm","accounts","granted","held","ran","grantedCredits","usedCredits","expiredCredits","costUsd","payers","payersWithin14d","paidRate","revenueUsd","costPerPayerUsd"]}},"verdict":{"type":"object","properties":{"call":{"type":"string","enum":["too_early","worth_it","not_worth_it","unclear"]},"extraPayers":{"type":"number","nullable":true,"description":"Payers the free-run arm has beyond control's rate, or null without a control arm."},"costPerExtraPayerUsd":{"type":"number","nullable":true},"reason":{"type":"string"}},"required":["call","extraPayers","costPerExtraPayerUsd","reason"]},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"freeRunAccounts":{"type":"integer"},"controlAccounts":{"type":"integer"},"costUsd":{"type":"number"},"payers":{"type":"integer"}},"required":["day","freeRunAccounts","controlAccounts","costUsd","payers"]}},"truncated":{"type":"boolean"},"funnel":{"type":"object","nullable":true,"properties":{"since":{"type":"string","description":"When the flag last changed."},"signups":{"type":"integer","description":"Customer accounts created since the flag changed (no staff, no banned)."},"actionsSince":{"type":"string","description":"The UTC day the page counts below start from: the flag change's day, so they may include presses earlier that day."},"presses":{"type":"integer","description":"Create presses on the tool and model pages."},"signupWalls":{"type":"integer","description":"Of those presses, the signed-out ones sent to sign up instead."},"checkoutsOpened":{"type":"integer","description":"Presses sent to Basic's Checkout: control-arm accounts, and accounts not eligible for a free run."},"freeRunsGranted":{"type":"integer","description":"Presses granted the free run instead of Checkout."}},"required":["since","signups","actionsSince","presses","signupWalls","checkoutsOpened","freeRunsGranted"],"description":"What happened ahead of the Checkout step since the flag changed, so an empty panel says why; null while the flag is off."}},"required":["mode","flag","since","arms","verdict","daily","truncated","funnel"]},"AdminAcquisitionPages":{"type":"object","properties":{"days":{"type":"integer"},"since":{"type":"string"},"trackingSince":{"type":"object","properties":{"views":{"type":"string","nullable":true},"signups":{"type":"string","nullable":true}},"required":["views","signups"]},"totals":{"allOf":[{"$ref":"#/components/schemas/AdminAcquisitionCounts"},{"type":"object","properties":{"attributed":{"type":"integer"}},"required":["attributed"]}]},"newPages":{"$ref":"#/components/schemas/AdminAcquisitionCounts"},"families":{"type":"array","items":{"$ref":"#/components/schemas/AdminAcquisitionFamilyRow"}},"usage":{"$ref":"#/components/schemas/AdminPageUsage"},"sources":{"$ref":"#/components/schemas/AdminAcquisitionSources"}},"required":["days","since","trackingSince","totals","newPages","families","usage","sources"],"description":"Which pages bring traffic, sign-ups and paid customers: person landings per tracked page, the window's customer sign-ups by the page each first landed on, and how many of them have paid, and those sign-ups by their landing's campaign tags."},"AdminAcquisitionCounts":{"type":"object","properties":{"views":{"type":"integer"},"signups":{"type":"integer"},"paid":{"type":"integer"}},"required":["views","signups","paid"]},"AdminAcquisitionFamilyRow":{"type":"object","properties":{"family":{"type":"string","enum":["ai_tools","models","skills","resources","guides","blog","solutions","plugins","home","pricing","other","unrecorded"]},"acquisition":{"type":"boolean"},"views":{"type":"integer"},"signups":{"type":"integer"},"paid":{"type":"integer"},"pages":{"type":"array","items":{"$ref":"#/components/schemas/AdminAcquisitionPageRow"}},"morePages":{"type":"integer"}},"required":["family","acquisition","views","signups","paid","pages","morePages"]},"AdminAcquisitionPageRow":{"type":"object","properties":{"path":{"type":"string"},"views":{"type":"integer"},"signups":{"type":"integer"},"paid":{"type":"integer"}},"required":["path","views","signups","paid"]},"AdminPageUsage":{"type":"object","properties":{"trackingSince":{"type":"string","nullable":true},"skills":{"type":"array","items":{"$ref":"#/components/schemas/AdminSkillUsageRow"}},"tools":{"type":"array","items":{"$ref":"#/components/schemas/AdminToolUsageRow"}},"models":{"type":"array","items":{"$ref":"#/components/schemas/AdminToolUsageRow"}}},"required":["trackingSince","skills","tools","models"],"description":"What visitors did on the skill and AI tool pages in the window: skill downloads and refusals, and how far runs got on the AI tool and AI model pages."},"AdminSkillUsageRow":{"type":"object","properties":{"path":{"type":"string"},"views":{"type":"integer"},"downloads":{"type":"integer"},"signupWalls":{"type":"integer"},"upgradeWalls":{"type":"integer"}},"required":["path","views","downloads","signupWalls","upgradeWalls"]},"AdminToolUsageRow":{"type":"object","properties":{"path":{"type":"string"},"views":{"type":"integer"},"boxSeen":{"type":"integer"},"boxFocused":{"type":"integer"},"generates":{"type":"integer"},"signupWalls":{"type":"integer"},"runsStarted":{"type":"integer"},"runsSucceeded":{"type":"integer"},"runsFailed":{"type":"integer"},"runsRefused":{"type":"integer"},"studioHandoffs":{"type":"integer"},"resultDownloads":{"type":"integer"},"checkoutsOpened":{"type":"integer"},"checkoutsPaid":{"type":"integer"},"freeRunsGranted":{"type":"integer"},"freeRunPaywalls":{"type":"integer"}},"required":["path","views","boxSeen","boxFocused","generates","signupWalls","runsStarted","runsSucceeded","runsFailed","runsRefused","studioHandoffs","resultDownloads","checkoutsOpened","checkoutsPaid","freeRunsGranted","freeRunPaywalls"]},"AdminAcquisitionSources":{"type":"object","properties":{"tagged":{"type":"integer"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/AdminAcquisitionSourceRow"}},"moreRows":{"type":"integer"}},"required":["tagged","rows","moreRows"],"description":"The window's sign-ups with a recorded landing by the landing URL's utm_source, utm_medium and utm_campaign, busiest first. A tagged row lists its utm_content values; the untagged row lists the referring sites."},"AdminAcquisitionSourceRow":{"type":"object","properties":{"tagged":{"type":"boolean"},"source":{"type":"string","nullable":true},"medium":{"type":"string","nullable":true},"campaign":{"type":"string","nullable":true},"signups":{"type":"integer"},"paid":{"type":"integer"},"details":{"type":"array","items":{"$ref":"#/components/schemas/AdminAcquisitionSourceDetail"}},"moreDetails":{"type":"integer"}},"required":["tagged","source","medium","campaign","signups","paid","details","moreDetails"]},"AdminAcquisitionSourceDetail":{"type":"object","properties":{"value":{"type":"string","nullable":true},"signups":{"type":"integer"},"paid":{"type":"integer"}},"required":["value","signups","paid"]},"AdminYearlyOfferFunnel":{"type":"object","properties":{"since":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["first_month_credit","cancel_half_price"]},"surface":{"type":"string","enum":["banner","cancel"]},"impression":{"type":"integer"},"dismiss":{"type":"integer"},"accept":{"type":"integer"},"converted":{"type":"integer"}},"required":["kind","surface","impression","dismiss","accept","converted"]}}},"required":["since","rows"],"description":"Monthly-to-yearly offers per offer and surface: account-days that saw, dismissed or accepted each, and switch invoices paid."},"AdminCancellationInsights":{"type":"object","properties":{"since":{"type":"string"},"days":{"type":"integer"},"total":{"type":"integer"},"surveyed":{"type":"integer"},"outcomes":{"type":"object","properties":{"pending":{"type":"integer"},"saved":{"type":"integer"},"canceled":{"type":"integer"},"resumed":{"type":"integer"}},"required":["pending","saved","canceled","resumed"]},"offers":{"type":"object","properties":{"shown":{"type":"integer"},"accepted":{"type":"integer"},"acceptanceRate":{"type":"number","nullable":true}},"required":["shown","accepted","acceptanceRate"]},"byReason":{"type":"object","properties":{"credits_too_expensive":{"type":"integer"},"video_quality":{"type":"integer"},"research_not_useful":{"type":"integer"},"hard_to_use":{"type":"integer"},"one_off_project":{"type":"integer"},"other":{"type":"integer"}},"required":["credits_too_expensive","video_quality","research_not_useful","hard_to_use","one_off_project","other"]},"byGroup":{"type":"object","properties":{"price":{"type":"integer"},"quality":{"type":"integer"},"research":{"type":"integer"},"ease":{"type":"integer"},"other":{"type":"integer"}},"required":["price","quality","research","ease","other"]},"byTier":{"type":"object","additionalProperties":{"type":"integer"}},"byInterval":{"type":"object","additionalProperties":{"type":"integer"}},"byStripeReason":{"type":"object","additionalProperties":{"type":"integer"}},"rows":{"type":"array","items":{"$ref":"#/components/schemas/AdminCancellationRow"}}},"required":["since","days","total","surveyed","outcomes","offers","byReason","byGroup","byTier","byInterval","byStripeReason","rows"],"description":"Why paying customers cancel (the cancel survey) and how many the save offer keeps"},"AdminCancellationRow":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]},"tier":{"type":"string"},"billingInterval":{"type":"string","nullable":true},"surveyed":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string","enum":["credits_too_expensive","video_quality","research_not_useful","hard_to_use","one_off_project","other"]}},"groups":{"type":"array","items":{"type":"string","enum":["price","quality","research","ease","other"]}},"comment":{"type":"string","nullable":true},"offer":{"type":"string","nullable":true},"offerAccepted":{"type":"boolean"},"outcome":{"type":"string","enum":["pending","saved","canceled","resumed"]},"stripeReason":{"type":"string","nullable":true},"tenureDays":{"type":"integer","nullable":true},"creditsUsed30d":{"type":"number","description":"Display credits the account spent in the 30 days before this attempt (net debits)"}},"required":["id","createdAt","user","tier","billingInterval","surveyed","reasons","groups","comment","offer","offerAccepted","outcome","stripeReason","tenureDays","creditsUsed30d"]},"AdminPluginUsage":{"type":"object","properties":{"days":{"type":"integer"},"since":{"type":"string"},"generatedAt":{"type":"string"},"trackingSince":{"type":"string","nullable":true},"hosts":{"type":"array","items":{"$ref":"#/components/schemas/AdminPluginHostStats"}},"daily":{"type":"array","items":{"$ref":"#/components/schemas/AdminPluginDailyPoint"}},"recent":{"type":"array","items":{"$ref":"#/components/schemas/AdminPluginRecentCall"}}},"required":["days","since","generatedAt","trackingSince","hosts","daily","recent"],"description":"Claude and ChatGPT plugin usage on the public MCP endpoint: connected, active and spending customer accounts per host and surface, the sign-ups each plugin's connect flow and page brought, credits plugin work started and credits of runs it delivered, top tools and failures, a daily series and the latest calls."},"AdminPluginHostStats":{"type":"object","properties":{"host":{"type":"string","enum":["claude","chatgpt","other"]},"connectedUsers":{"type":"integer"},"newConnections":{"type":"integer"},"activeUsers":{"type":"integer"},"activeLastHour":{"type":"integer"},"firstTimeUsers":{"type":"integer"},"spendingUsers":{"type":"integer"},"deliveredOnlyUsers":{"type":"integer"},"payingUsers":{"type":"integer"},"toolCalls":{"type":"integer"},"failedCalls":{"type":"integer"},"avgDurationMs":{"type":"integer"},"credits":{"type":"number"},"deliveredCredits":{"type":"number"},"signups":{"$ref":"#/components/schemas/AdminPluginSignups"},"surfaces":{"type":"array","items":{"$ref":"#/components/schemas/AdminPluginSurface"}},"topTools":{"type":"array","items":{"$ref":"#/components/schemas/AdminPluginTool"}}},"required":["host","connectedUsers","newConnections","activeUsers","activeLastHour","firstTimeUsers","spendingUsers","deliveredOnlyUsers","payingUsers","toolCalls","failedCalls","avgDurationMs","credits","deliveredCredits","signups","surfaces","topTools"]},"AdminPluginSignups":{"type":"object","properties":{"viaConnect":{"type":"integer"},"viaPage":{"type":"integer"},"total":{"type":"integer"},"paid":{"type":"integer"},"pageViews":{"type":"integer"}},"required":["viaConnect","viaPage","total","paid","pageViews"]},"AdminPluginSurface":{"type":"object","properties":{"client":{"type":"string","enum":["chatgpt","codex","claude","claude_code","other"]},"connectedUsers":{"type":"integer"},"activeUsers":{"type":"integer"},"toolCalls":{"type":"integer"},"credits":{"type":"number"},"deliveredCredits":{"type":"number"}},"required":["client","connectedUsers","activeUsers","toolCalls","credits","deliveredCredits"]},"AdminPluginTool":{"type":"object","properties":{"tool":{"type":"string"},"calls":{"type":"integer"},"failed":{"type":"integer"},"users":{"type":"integer"}},"required":["tool","calls","failed","users"]},"AdminPluginDailyPoint":{"type":"object","properties":{"day":{"type":"string"},"host":{"type":"string","enum":["claude","chatgpt","other"]},"calls":{"type":"integer"},"users":{"type":"integer"}},"required":["day","host","calls","users"]},"AdminPluginRecentCall":{"type":"object","properties":{"at":{"type":"string"},"host":{"type":"string","enum":["claude","chatgpt","other"]},"client":{"type":"string","enum":["chatgpt","codex","claude","claude_code","other"]},"tool":{"type":"string"},"outcome":{"type":"string"},"durationMs":{"type":"integer"},"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"]}},"required":["at","host","client","tool","outcome","durationMs","user"]},"AdminAdsTrackingReport":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"fetchedAt":{"type":"string"},"google":{"type":"object","properties":{"status":{"type":"string","enum":["ready","unconfigured","error"]},"message":{"type":"string","nullable":true},"accountId":{"type":"string","nullable":true},"accountName":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"timeZone":{"type":"string","nullable":true},"attribution":{"type":"string"},"videos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"campaign":{"type":"string"},"group":{"type":"string"},"status":{"type":"string"},"matchType":{"type":"string","nullable":true},"videoId":{"type":"string","nullable":true},"finalUrl":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"signups":{"type":"number"},"purchases":{"type":"number"},"purchaseValue":{"type":"number"},"primaryConversions":{"type":"number","nullable":true},"linkClicks":{"type":"number","nullable":true},"landingPageViews":{"type":"number","nullable":true},"reach":{"type":"number","nullable":true},"videoPlays":{"type":"number","nullable":true},"video25":{"type":"number","nullable":true},"video50":{"type":"number","nullable":true},"video75":{"type":"number","nullable":true},"video100":{"type":"number","nullable":true}},"required":["impressions","clicks","spend","signups","purchases","purchaseValue","primaryConversions","linkClicks","landingPageViews","reach","videoPlays","video25","video50","video75","video100"]}},"required":["id","name","campaign","group","status","matchType","videoId","finalUrl","metrics"]}},"videoMessage":{"type":"string","nullable":true},"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"campaign":{"type":"string"},"group":{"type":"string"},"status":{"type":"string"},"matchType":{"type":"string","nullable":true},"videoId":{"type":"string","nullable":true},"finalUrl":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"signups":{"type":"number"},"purchases":{"type":"number"},"purchaseValue":{"type":"number"},"primaryConversions":{"type":"number","nullable":true},"linkClicks":{"type":"number","nullable":true},"landingPageViews":{"type":"number","nullable":true},"reach":{"type":"number","nullable":true},"videoPlays":{"type":"number","nullable":true},"video25":{"type":"number","nullable":true},"video50":{"type":"number","nullable":true},"video75":{"type":"number","nullable":true},"video100":{"type":"number","nullable":true}},"required":["impressions","clicks","spend","signups","purchases","purchaseValue","primaryConversions","linkClicks","landingPageViews","reach","videoPlays","video25","video50","video75","video100"]}},"required":["id","name","campaign","group","status","matchType","videoId","finalUrl","metrics"]}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"campaign":{"type":"string"},"group":{"type":"string"},"status":{"type":"string"},"matchType":{"type":"string","nullable":true},"videoId":{"type":"string","nullable":true},"finalUrl":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"signups":{"type":"number"},"purchases":{"type":"number"},"purchaseValue":{"type":"number"},"primaryConversions":{"type":"number","nullable":true},"linkClicks":{"type":"number","nullable":true},"landingPageViews":{"type":"number","nullable":true},"reach":{"type":"number","nullable":true},"videoPlays":{"type":"number","nullable":true},"video25":{"type":"number","nullable":true},"video50":{"type":"number","nullable":true},"video75":{"type":"number","nullable":true},"video100":{"type":"number","nullable":true}},"required":["impressions","clicks","spend","signups","purchases","purchaseValue","primaryConversions","linkClicks","landingPageViews","reach","videoPlays","video25","video50","video75","video100"]}},"required":["id","name","campaign","group","status","matchType","videoId","finalUrl","metrics"]}},"ads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"campaign":{"type":"string"},"group":{"type":"string"},"status":{"type":"string"},"matchType":{"type":"string","nullable":true},"videoId":{"type":"string","nullable":true},"finalUrl":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"signups":{"type":"number"},"purchases":{"type":"number"},"purchaseValue":{"type":"number"},"primaryConversions":{"type":"number","nullable":true},"linkClicks":{"type":"number","nullable":true},"landingPageViews":{"type":"number","nullable":true},"reach":{"type":"number","nullable":true},"videoPlays":{"type":"number","nullable":true},"video25":{"type":"number","nullable":true},"video50":{"type":"number","nullable":true},"video75":{"type":"number","nullable":true},"video100":{"type":"number","nullable":true}},"required":["impressions","clicks","spend","signups","purchases","purchaseValue","primaryConversions","linkClicks","landingPageViews","reach","videoPlays","video25","video50","video75","video100"]}},"required":["id","name","campaign","group","status","matchType","videoId","finalUrl","metrics"]}}},"required":["status","message","accountId","accountName","currency","timeZone","attribution","videos","videoMessage","campaigns","keywords","ads"]},"meta":{"type":"object","properties":{"status":{"type":"string","enum":["ready","unconfigured","error"]},"message":{"type":"string","nullable":true},"accountId":{"type":"string","nullable":true},"accountName":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"timeZone":{"type":"string","nullable":true},"attribution":{"type":"string"},"videos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"campaign":{"type":"string"},"group":{"type":"string"},"status":{"type":"string"},"matchType":{"type":"string","nullable":true},"videoId":{"type":"string","nullable":true},"finalUrl":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"signups":{"type":"number"},"purchases":{"type":"number"},"purchaseValue":{"type":"number"},"primaryConversions":{"type":"number","nullable":true},"linkClicks":{"type":"number","nullable":true},"landingPageViews":{"type":"number","nullable":true},"reach":{"type":"number","nullable":true},"videoPlays":{"type":"number","nullable":true},"video25":{"type":"number","nullable":true},"video50":{"type":"number","nullable":true},"video75":{"type":"number","nullable":true},"video100":{"type":"number","nullable":true}},"required":["impressions","clicks","spend","signups","purchases","purchaseValue","primaryConversions","linkClicks","landingPageViews","reach","videoPlays","video25","video50","video75","video100"]}},"required":["id","name","campaign","group","status","matchType","videoId","finalUrl","metrics"]}},"videoMessage":{"type":"string","nullable":true},"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"campaign":{"type":"string"},"group":{"type":"string"},"status":{"type":"string"},"matchType":{"type":"string","nullable":true},"videoId":{"type":"string","nullable":true},"finalUrl":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"signups":{"type":"number"},"purchases":{"type":"number"},"purchaseValue":{"type":"number"},"primaryConversions":{"type":"number","nullable":true},"linkClicks":{"type":"number","nullable":true},"landingPageViews":{"type":"number","nullable":true},"reach":{"type":"number","nullable":true},"videoPlays":{"type":"number","nullable":true},"video25":{"type":"number","nullable":true},"video50":{"type":"number","nullable":true},"video75":{"type":"number","nullable":true},"video100":{"type":"number","nullable":true}},"required":["impressions","clicks","spend","signups","purchases","purchaseValue","primaryConversions","linkClicks","landingPageViews","reach","videoPlays","video25","video50","video75","video100"]}},"required":["id","name","campaign","group","status","matchType","videoId","finalUrl","metrics"]}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"campaign":{"type":"string"},"group":{"type":"string"},"status":{"type":"string"},"matchType":{"type":"string","nullable":true},"videoId":{"type":"string","nullable":true},"finalUrl":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"signups":{"type":"number"},"purchases":{"type":"number"},"purchaseValue":{"type":"number"},"primaryConversions":{"type":"number","nullable":true},"linkClicks":{"type":"number","nullable":true},"landingPageViews":{"type":"number","nullable":true},"reach":{"type":"number","nullable":true},"videoPlays":{"type":"number","nullable":true},"video25":{"type":"number","nullable":true},"video50":{"type":"number","nullable":true},"video75":{"type":"number","nullable":true},"video100":{"type":"number","nullable":true}},"required":["impressions","clicks","spend","signups","purchases","purchaseValue","primaryConversions","linkClicks","landingPageViews","reach","videoPlays","video25","video50","video75","video100"]}},"required":["id","name","campaign","group","status","matchType","videoId","finalUrl","metrics"]}},"ads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"campaign":{"type":"string"},"group":{"type":"string"},"status":{"type":"string"},"matchType":{"type":"string","nullable":true},"videoId":{"type":"string","nullable":true},"finalUrl":{"type":"string","nullable":true},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"clicks":{"type":"number"},"spend":{"type":"number"},"signups":{"type":"number"},"purchases":{"type":"number"},"purchaseValue":{"type":"number"},"primaryConversions":{"type":"number","nullable":true},"linkClicks":{"type":"number","nullable":true},"landingPageViews":{"type":"number","nullable":true},"reach":{"type":"number","nullable":true},"videoPlays":{"type":"number","nullable":true},"video25":{"type":"number","nullable":true},"video50":{"type":"number","nullable":true},"video75":{"type":"number","nullable":true},"video100":{"type":"number","nullable":true}},"required":["impressions","clicks","spend","signups","purchases","purchaseValue","primaryConversions","linkClicks","landingPageViews","reach","videoPlays","video25","video50","video75","video100"]}},"required":["id","name","campaign","group","status","matchType","videoId","finalUrl","metrics"]}}},"required":["status","message","accountId","accountName","currency","timeZone","attribution","videos","videoMessage","campaigns","keywords","ads"]}},"required":["from","to","fetchedAt","google","meta"]},"AiToolFreeRunStatus":{"type":"object","properties":{"mode":{"type":"string","enum":["off","ab","on"],"description":"`off` — no free run; `ab` — an A/B test is running (some accounts get one, so a guest is not promised it); `on` — every new Free account's first run is free."},"eligible":{"type":"boolean","nullable":true,"description":"Whether this account's claim could still be granted, the flag aside: null signed out; false once its mailbox had a run (or an arm), or for an account that is not a new Free account. In `ab` a true account may still be dealt control."},"claim":{"type":"object","nullable":true,"properties":{"arm":{"type":"string","enum":["free_run","control"]},"status":{"type":"string","enum":["control","pending","granted","held"]},"path":{"type":"string","description":"The page whose press decided the arm."},"credits":{"type":"number","description":"Credits granted."},"expiresAt":{"type":"string","nullable":true}},"required":["arm","status","path","credits","expiresAt"],"description":"The signed-in account's free run, or null (signed out, or none yet)."}},"required":["mode","eligible","claim"]},"AiToolFreeRunClaim":{"type":"object","properties":{"outcome":{"type":"string","enum":["granted","held","control","used","ineligible","off"],"description":"`granted` — the run's credits are on the account, run it; anything else — open Checkout as before."},"credits":{"type":"number"},"expiresAt":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true,"enum":["no_account","staff","unverified_email","had_subscription","had_credits",null]}},"required":["outcome","credits","expiresAt","reason"]},"ClaimAiToolFreeRun":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":2048,"description":"The AI tool (`/ai-tools/<slug>`), model (`/models/<slug>`) or comparison (`/models/compare/<slug>`) page the press was on. The server reads the run's kind and price from its own catalog copy.","example":"/ai-tools/ai-image-generator"}},"required":["path"]},"VoiceListenSession":{"type":"object","properties":{"provider":{"type":"string","enum":["soniox","openai"],"description":"Which recogniser the WebSocket speaks: Soniox's real-time protocol, or OpenAI's Realtime transcription events."},"url":{"type":"string","description":"The WebSocket to stream mono 16-bit PCM to: 16 kHz for Soniox, 24 kHz for OpenAI."},"model":{"type":"string"},"apiKey":{"type":"string","description":"A short-lived key that expires unused after a minute. Soniox's opens one session of up to 90 seconds; OpenAI's is an ephemeral client secret for a transcription-only session."},"expiresAt":{"type":"string"}},"required":["provider","url","model","apiKey","expiresAt"]},"VoiceTranscript":{"type":"object","properties":{"text":{"type":"string","description":"What was said, each word in the language it was spoken in; empty when no speech was heard."}},"required":["text"]},"AgentListResponse":{"type":"object","properties":{"agents":{"type":"array","items":{"$ref":"#/components/schemas/AgentSummary"}}},"required":["agents"]},"AgentSummary":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string","nullable":true},"basePrompt":{"type":"string"},"skills":{"type":"array","items":{"$ref":"#/components/schemas/AgentSkillRef"}},"ownerKind":{"type":"string","enum":["system","user"]},"userId":{"type":"string","nullable":true},"visibility":{"type":"string","enum":["private","team","public"]},"version":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","handle","name","description","icon","basePrompt","skills","ownerKind","userId","visibility","version","createdAt","updatedAt"]},"AgentSkillRef":{"type":"object","properties":{"specifier":{"type":"string","minLength":1}},"required":["specifier"]},"CreateAgentInput":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]*$"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","minLength":1},"icon":{"type":"string","nullable":true,"minLength":1},"basePrompt":{"type":"string","minLength":1},"skills":{"type":"array","items":{"$ref":"#/components/schemas/AgentSkillRef"},"default":[]},"visibility":{"type":"string","enum":["private","team","public"],"default":"private"}},"required":["handle","name","description","basePrompt"]},"UpdateAgentInput":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]*$"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","minLength":1},"icon":{"type":"string","nullable":true,"minLength":1},"basePrompt":{"type":"string","minLength":1},"skills":{"type":"array","items":{"$ref":"#/components/schemas/AgentSkillRef"}},"visibility":{"type":"string","enum":["private","team","public"]},"version":{"type":"string","minLength":1}}},"AgentSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"AiTrafficStatsResponse":{"type":"object","properties":{"days":{"type":"number"},"totals":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"count":{"type":"number"}},"required":["category","count"]}},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"category":{"type":"string"},"count":{"type":"number"}},"required":["day","category","count"]}},"topAgents":{"type":"array","items":{"type":"object","properties":{"agent":{"type":"string","nullable":true},"vendor":{"type":"string","nullable":true},"category":{"type":"string"},"count":{"type":"number"}},"required":["agent","vendor","category","count"]}},"topPaths":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"count":{"type":"number"}},"required":["path","count"]}},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string","nullable":true,"format":"date-time"},"source":{"type":"string"},"path":{"type":"string"},"category":{"type":"string"},"vendor":{"type":"string","nullable":true},"agent":{"type":"string","nullable":true},"referrerHost":{"type":"string","nullable":true},"userAgent":{"type":"string","nullable":true}},"required":["id","occurredAt","source","path","category","vendor","agent","referrerHost","userAgent"]}}},"required":["days","totals","daily","topAgents","topPaths","recent"],"description":"Aggregated AI-agent traffic metrics"},"ClaimSignupLandingResult":{"type":"object","properties":{"outcome":{"type":"string","enum":["attributed","already_attributed","not_new","stale"],"description":"`attributed` when the landing is now this new account's; `already_attributed` when one was recorded before; `not_new` when the account is older than a day (a sign-in, not a sign-up); `stale` when the landing is over 30 days old or came after the account existed."}},"required":["outcome"]},"ClaimSignupLanding":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":2048,"description":"The path of the first adant.ai page this browser opened (query and fragment are ignored).","example":"/ai-tools/pixar-style-video"},"referrerHost":{"type":"string","nullable":true,"maxLength":253,"description":"The external site that sent the visitor, host only.","example":"www.google.com"},"utm":{"$ref":"#/components/schemas/ClaimSignupLandingUtm"},"ageMs":{"type":"integer","minimum":0,"description":"How long ago the browser opened that page, in milliseconds by its own clock."}},"required":["path","referrerHost","ageMs"]},"ClaimSignupLandingUtm":{"type":"object","nullable":true,"properties":{"source":{"type":"string","nullable":true,"maxLength":256},"medium":{"type":"string","nullable":true,"maxLength":256},"campaign":{"type":"string","nullable":true,"maxLength":256},"content":{"type":"string","nullable":true,"maxLength":256},"term":{"type":"string","nullable":true,"maxLength":256}},"description":"The landing URL's `utm_*` tags, keyed without the `utm_` prefix. Each is stored as a lowercase slug of at most 64 characters; an empty one is dropped.","example":{"source":"x","medium":"paid_social","campaign":"x-launch-2612"}},"ReportPageAction":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":2048,"description":"The AI tool (`/ai-tools/<slug>`) or AI model (`/models/<slug>`) page the action happened on (query and fragment are ignored).","example":"/ai-tools/pixar-style-video"},"action":{"type":"string","enum":["tool_input_seen","tool_input_focus","tool_generate","tool_signup_wall","tool_run_started","tool_run_succeeded","tool_run_failed","tool_run_refused","tool_studio_handoff","tool_result_download","tool_checkout_opened","tool_checkout_paid","tool_free_run_granted","tool_free_run_paywall"],"description":"What the visitor did. Skill downloads are counted by the download route and cannot be reported here."}},"required":["path","action"]},"ShareLinkStatsResponse":{"type":"object","properties":{"days":{"type":"number"},"totals":{"type":"object","properties":{"clicks":{"type":"number"},"botHits":{"type":"number"}},"required":["clicks","botHits"]},"handles":{"type":"array","items":{"type":"object","properties":{"campaign":{"type":"string"},"handle":{"type":"string"},"clicks":{"type":"number"},"botHits":{"type":"number"},"lastClickAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["campaign","handle","clicks","botHits","lastClickAt"]}},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"clicks":{"type":"number"}},"required":["day","clicks"]}},"referrers":{"type":"array","items":{"type":"object","properties":{"referrerHost":{"type":"string","nullable":true},"clicks":{"type":"number"}},"required":["referrerHost","clicks"]}}},"required":["days","totals","handles","daily","referrers"],"description":"Clicks on promoters' short links, per handle"},"RegistrationPolicy":{"type":"object","properties":{"emailSignUpEnabled":{"type":"boolean"},"googleSignUpEnabled":{"type":"boolean"},"turnstileSiteKey":{"type":"string","nullable":true}},"required":["emailSignUpEnabled","googleSignUpEnabled","turnstileSiteKey"],"description":"Public registration policy used to choose which account-creation methods to show."},"UsernameInfo":{"type":"object","properties":{"username":{"type":"string","nullable":true},"isSet":{"type":"boolean"}},"required":["username","isSet"],"description":"User's username information. Username is immutable once set."},"CheckUsernameOutput":{"type":"object","properties":{"available":{"type":"boolean"},"error":{"type":"string","nullable":true}},"required":["available","error"]},"UpdateUsernameOutput":{"type":"object","properties":{"success":{"type":"boolean"},"username":{"type":"string","nullable":true},"error":{"type":"string","nullable":true}},"required":["success","username","error"]},"UpdateUsernameInput":{"type":"object","properties":{"username":{"type":"string","minLength":3,"maxLength":39}},"required":["username"]},"GetSuggestionsOutput":{"type":"object","properties":{"suggestions":{"type":"array","items":{"type":"string"}}},"required":["suggestions"]},"AutoModePref":{"type":"object","properties":{"autoModeEnabled":{"type":"boolean","nullable":true}},"required":["autoModeEnabled"],"description":"Studio auto-mode (media-generation confirmation) preference. Null = never set."},"UpdateAutoModePrefInput":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"OnboardingPrefResponse":{"type":"object","properties":{"onboarding":{"$ref":"#/components/schemas/OnboardingPrefs"}},"required":["onboarding"],"description":"The current user's welcome answers. Null = never answered."},"OnboardingPrefs":{"type":"object","nullable":true,"properties":{"goal":{"type":"string","nullable":true,"enum":["social-account","product","ecommerce","business","clients-brands","something-else",null]},"goalOther":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["instagram-facebook","tiktok","twitter-x","search","linkedin","youtube","friend","ai-tool","other",null]},"link":{"type":"string","nullable":true},"start":{"type":"string","nullable":true,"enum":["recreate","productVideo","strategyOwn","strategyBusiness","strategyClient","planWeek","captions","assignTeam","assignClient","listen",null]},"jobs":{"type":"array","nullable":true,"items":{"type":"string","enum":["research","listening","video","weekly"]}},"completedAt":{"type":"string","nullable":true},"version":{"type":"integer","nullable":true},"scheduleHintHiddenAt":{"type":"string","nullable":true},"checklistHiddenAt":{"type":"string","nullable":true}},"required":["goal","goalOther","source","link","start","jobs","completedAt","version","scheduleHintHiddenAt","checklistHiddenAt"],"description":"Post-signup welcome answers: what the account came here to grow, the link it handed over, and the team's jobs it picked."},"UpdateOnboardingPrefInput":{"type":"object","properties":{"goal":{"type":"string","nullable":true,"enum":["social-account","product","ecommerce","business","clients-brands","something-else",null]},"goalOther":{"type":"string","nullable":true,"maxLength":200},"source":{"type":"string","nullable":true,"enum":["instagram-facebook","tiktok","twitter-x","search","linkedin","youtube","friend","ai-tool","other",null]},"link":{"type":"string","nullable":true,"maxLength":2048},"start":{"type":"string","nullable":true,"enum":["recreate","productVideo","strategyOwn","strategyBusiness","strategyClient","planWeek","captions","assignTeam","assignClient","listen",null]},"jobs":{"type":"array","nullable":true,"items":{"type":"string","enum":["research","listening","video","weekly"]},"maxItems":4},"completed":{"type":"boolean"},"hideScheduleHint":{"type":"boolean"},"hideChecklist":{"type":"boolean"}}},"ContactSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"CreateContactMessage":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","maxLength":320,"format":"email"},"message":{"type":"string","minLength":1,"maxLength":5000}},"required":["name","email","message"],"description":"Input for creating a contact message"},"ContactMessageListResponse":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/ContactMessage"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["messages","total","page","limit"],"description":"Paginated contact message list"},"ContactMessage":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"message":{"type":"string"},"isRead":{"type":"boolean"},"isDone":{"type":"boolean"},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"account":{"$ref":"#/components/schemas/ContactMessageAccount"},"noteCount":{"type":"number"},"replyCount":{"type":"number"}},"required":["id","name","email","message","isRead","isDone","createdAt"],"description":"A contact message"},"ContactMessageAccount":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"banned":{"type":"boolean"}},"required":["id","name","email","createdAt","banned"],"description":"The registered account matching the sender's email address"},"ContactMessageStats":{"type":"object","properties":{"total":{"type":"number"},"unread":{"type":"number"},"open":{"type":"number"},"done":{"type":"number"},"replyEnabled":{"type":"boolean"}},"required":["total","unread","open","done","replyEnabled"],"description":"Inbox triage counts and reply capability"},"ContactMessageBulkResult":{"type":"object","properties":{"updated":{"type":"number"}},"required":["updated"],"description":"How many contact messages the bulk action affected"},"ContactMessageBulkStatusUpdate":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"isRead":{"type":"boolean"},"isDone":{"type":"boolean"}},"required":["ids"],"description":"Apply one status change to several contact messages"},"ContactMessageBulkDelete":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100}},"required":["ids"],"description":"Delete several contact messages"},"ContactMessageStatusUpdate":{"type":"object","properties":{"isRead":{"type":"boolean"},"isDone":{"type":"boolean"}},"description":"Read and workflow status changes for a contact message"},"ContactMessageThread":{"type":"object","properties":{"notes":{"type":"array","items":{"$ref":"#/components/schemas/ContactMessageNote"}},"replies":{"type":"array","items":{"$ref":"#/components/schemas/ContactMessageReply"}}},"required":["notes","replies"],"description":"Internal notes and sent replies for one contact message"},"ContactMessageNote":{"type":"object","properties":{"id":{"type":"string"},"messageId":{"type":"string"},"authorId":{"type":"string"},"authorName":{"type":"string"},"body":{"type":"string"},"createdAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","messageId","authorId","authorName","body","createdAt"],"description":"An internal, operator-only note on a contact message"},"ContactMessageReply":{"type":"object","properties":{"id":{"type":"string"},"messageId":{"type":"string"},"sentById":{"type":"string"},"sentByName":{"type":"string"},"toEmail":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string"},"createdAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","messageId","sentById","sentByName","toEmail","subject","body","createdAt"],"description":"A reply emailed to the sender from the admin console"},"ContactMessageNoteInput":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":5000}},"required":["body"],"description":"Input for adding an internal note"},"ContactMessageReplyInput":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":200},"body":{"type":"string","minLength":1,"maxLength":10000},"markDone":{"type":"boolean","default":true}},"required":["subject","body"],"description":"Input for emailing a reply to the sender"},"DiscordPromotionStatus":{"type":"object","properties":{"enabled":{"type":"boolean"},"state":{"type":"string","enum":["unavailable","needs_connection","ready","claimed"]},"rewardCredits":{"type":"number","minimum":0},"unit":{"type":"string","enum":["credits"]},"inviteUrl":{"type":"string","nullable":true,"format":"uri"},"claimedAt":{"type":"string","nullable":true}},"required":["enabled","state","rewardCredits","unit","inviteUrl","claimedAt"],"description":"Current user's eligibility and claim state for the Discord community reward."},"ReferralProgramStatus":{"type":"object","properties":{"enabled":{"type":"boolean"},"referralCode":{"type":"string","nullable":true},"joinRewardCredits":{"type":"number","minimum":0},"paidRewardCredits":{"type":"number","minimum":0},"joinedCount":{"type":"integer","minimum":0},"paidCount":{"type":"integer","minimum":0},"earnedCredits":{"type":"number","minimum":0},"unit":{"type":"string","enum":["credits"]}},"required":["enabled","referralCode","joinRewardCredits","paidRewardCredits","joinedCount","paidCount","earnedCredits","unit"],"description":"The current user's referral code, rewards, and results."},"ClaimReferralResponse":{"type":"object","properties":{"accepted":{"type":"boolean","enum":[true]},"rewardCredits":{"type":"number","minimum":0},"unit":{"type":"string","enum":["credits"]}},"required":["accepted","rewardCredits","unit"]},"ClaimReferralInput":{"type":"object","properties":{"code":{"type":"string","minLength":6,"maxLength":20,"pattern":"^[A-Za-z0-9]+$"}},"required":["code"]},"CreditDiscountRates":{"type":"object","properties":{"globalDiscountPercent":{"type":"integer","minimum":0,"maximum":99},"modelDiscounts":{"type":"array","items":{"type":"object","properties":{"modelId":{"type":"string"},"discountPercent":{"type":"integer","minimum":0,"maximum":99}},"required":["modelId","discountPercent"]}}},"required":["globalDiscountPercent","modelDiscounts"]},"CreditBalance":{"type":"object","properties":{"unit":{"type":"string","enum":["credits"]},"totalCredits":{"type":"number","minimum":0},"creditsByBucket":{"type":"object","properties":{"daily":{"type":"number","minimum":0},"monthly":{"type":"number","minimum":0},"one_time":{"type":"number","minimum":0}},"required":["daily","monthly","one_time"]},"pendingReservationCredits":{"type":"number","minimum":0},"nextDailyGrantAt":{"type":"string"}},"required":["unit","totalCredits","creditsByBucket","pendingReservationCredits","nextDailyGrantAt"]},"CreditHistoryResponse":{"type":"object","properties":{"unit":{"type":"string","enum":["credits"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/CreditLedgerEntry"}},"nextCursor":{"type":"string","nullable":true}},"required":["unit","items","nextCursor"]},"CreditLedgerEntry":{"type":"object","properties":{"id":{"type":"string"},"kind":{"$ref":"#/components/schemas/CreditLedgerKind"},"bucket":{"$ref":"#/components/schemas/CreditBucket"},"deltaCredits":{"type":"number"},"operationId":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"expiresAt":{"type":"string","nullable":true},"reservationId":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","kind","bucket","deltaCredits","operationId","metadata","expiresAt","reservationId","createdAt"]},"CreditLedgerKind":{"type":"string","enum":["grant_signup","grant_daily","grant_monthly","grant_topup","grant_admin","grant_promotion","grant_referral","grant_refund","debit_reserve","debit_settle","debit_release","debit_consume","expire_free"],"description":"Ledger row classification"},"CreditBucket":{"type":"string","enum":["daily","monthly","one_time"],"description":"Credit bucket: daily | monthly | one_time"},"CreditActivityResponse":{"type":"object","properties":{"unit":{"type":"string","enum":["credits"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/CreditActivityEntry"}},"nextCursor":{"type":"string","nullable":true}},"required":["unit","items","nextCursor"]},"CreditActivityEntry":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["consumption","grant"]},"label":{"type":"string"},"netCredits":{"type":"integer"},"itemCount":{"type":"integer","minimum":0},"createdAt":{"type":"string"}},"required":["id","type","label","netCredits","itemCount","createdAt"]},"CreditSessionUsageResponse":{"type":"object","properties":{"unit":{"type":"string","enum":["credits"]},"sessionId":{"type":"string"},"textCredits":{"type":"number","minimum":0},"imageCredits":{"type":"number","minimum":0},"videoCredits":{"type":"number","minimum":0},"audioCredits":{"type":"number","minimum":0},"otherCredits":{"type":"number","minimum":0},"totalCredits":{"type":"number","minimum":0},"firstActivityAt":{"type":"string","nullable":true},"lastActivityAt":{"type":"string","nullable":true}},"required":["unit","sessionId","textCredits","imageCredits","videoCredits","audioCredits","otherCredits","totalCredits","firstActivityAt","lastActivityAt"],"description":"Net display credits consumed by one chat session, split by media category."},"CreditUsageResponse":{"type":"object","properties":{"unit":{"type":"string","enum":["credits"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/CreditUsageBucket"}}},"required":["unit","items"]},"CreditUsageBucket":{"type":"object","properties":{"day":{"type":"string"},"kind":{"$ref":"#/components/schemas/CreditLedgerKind"},"creditsUsed":{"type":"integer"}},"required":["day","kind","creditsUsed"]},"OpenRouterAccountResponse":{"type":"object","properties":{"snapshots":{"type":"array","items":{"$ref":"#/components/schemas/PublishedOpenRouterSnapshot"}},"runtime":{"type":"object","properties":{"railwayEnvironment":{"type":"string","nullable":true},"railwayService":{"type":"string","nullable":true}},"required":["railwayEnvironment","railwayService"]}},"required":["snapshots","runtime"]},"PublishedOpenRouterSnapshot":{"type":"object","properties":{"environment":{"type":"string","enum":["production","development"]},"publishedAt":{"type":"string"},"publishedBy":{"type":"string"},"publishedByEmail":{"type":"string","nullable":true},"snapshot":{"$ref":"#/components/schemas/OpenRouterAccountSnapshot"}},"required":["environment","publishedAt","publishedBy","publishedByEmail","snapshot"]},"OpenRouterAccountSnapshot":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"environment":{"type":"string","enum":["production","development"]},"workspace":{"type":"string","minLength":1,"maxLength":200},"plannedAt":{"type":"string","format":"date-time"},"operator":{"type":"string","minLength":1,"maxLength":200},"declared":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"includeByokInBudgets":{"type":"boolean"},"budgets":{"type":"array","items":{"type":"object","properties":{"interval":{"type":"string","minLength":1,"maxLength":40},"limitUsd":{"type":"number"}},"required":["interval","limitUsd"],"additionalProperties":false},"maxItems":10},"inferenceKeys":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"limitUsd":{"type":"number"},"limitReset":{"type":"string","minLength":1,"maxLength":40},"includeByokInLimit":{"type":"boolean"},"railway":{"type":"object","properties":{"environment":{"type":"string","minLength":1,"maxLength":200},"service":{"type":"string","minLength":1,"maxLength":200},"variable":{"type":"string","minLength":1,"maxLength":200}},"required":["environment","service","variable"],"additionalProperties":false},"infisical":{"type":"object","properties":{"environment":{"type":"string","minLength":1,"maxLength":200},"path":{"type":"string","maxLength":200,"pattern":"^\\/[A-Za-z0-9_\\-/]*$"},"variable":{"type":"string","pattern":"^[A-Z][A-Z0-9_]*$"}},"required":["environment","path","variable"],"additionalProperties":false}},"required":["name","limitUsd","limitReset","includeByokInLimit","railway"],"additionalProperties":false},"maxItems":50},"byokKeys":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"provider":{"type":"string","minLength":1,"maxLength":200},"credentialEnv":{"type":"string","pattern":"^[A-Z][A-Z0-9_]*$"},"allowedModels":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"maxLength":200},"maxItems":200},"isFallback":{"type":"boolean"},"isByokOnly":{"type":"boolean"}},"required":["name","provider","credentialEnv","allowedModels","isFallback","isByokOnly"],"additionalProperties":false},"maxItems":50},"guardrails":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"limitUsd":{"type":"number"},"resetInterval":{"type":"string","minLength":1,"maxLength":40},"includeByokInBudgets":{"type":"boolean"},"allowedProviders":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":100},"keys":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":50}},"required":["name","description","limitUsd","resetInterval","includeByokInBudgets","allowedProviders","keys"],"additionalProperties":false},"maxItems":50},"manual":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"where":{"type":"string","maxLength":2000},"expected":{"type":"string","maxLength":2000},"why":{"type":"string","maxLength":2000}},"required":["id","where","expected","why"],"additionalProperties":false},"maxItems":50}},"required":["name","includeByokInBudgets","budgets","inferenceKeys","byokKeys","guardrails","manual"],"additionalProperties":false},"live":{"type":"object","properties":{"exists":{"type":"boolean"},"includeByokInBudgets":{"type":"boolean","nullable":true},"budgets":{"type":"array","items":{"type":"object","properties":{"interval":{"type":"string","minLength":1,"maxLength":40},"limitUsd":{"type":"number"}},"required":["interval","limitUsd"],"additionalProperties":false},"maxItems":10},"inferenceKeys":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"limitUsd":{"type":"number","nullable":true},"limitReset":{"type":"string","nullable":true,"minLength":1,"maxLength":40},"includeByokInLimit":{"type":"boolean"},"disabled":{"type":"boolean"},"usage":{"type":"object","properties":{"dailyUsd":{"type":"number"},"weeklyUsd":{"type":"number"},"monthlyUsd":{"type":"number"},"totalUsd":{"type":"number"},"byokMonthlyUsd":{"type":"number"}},"required":["dailyUsd","weeklyUsd","monthlyUsd","totalUsd","byokMonthlyUsd"],"additionalProperties":false}},"required":["name","limitUsd","limitReset","includeByokInLimit","disabled","usage"],"additionalProperties":false},"maxItems":200},"byokKeys":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","nullable":true,"minLength":1,"maxLength":200},"provider":{"type":"string","minLength":1,"maxLength":200},"scope":{"type":"string","enum":["workspace","global"]},"allowedModels":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"maxLength":200},"maxItems":200},"isFallback":{"type":"boolean"},"isByokOnly":{"type":"boolean"},"disabled":{"type":"boolean"}},"required":["name","provider","scope","allowedModels","isFallback","isByokOnly","disabled"],"additionalProperties":false},"maxItems":200},"guardrails":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"limitUsd":{"type":"number","nullable":true},"resetInterval":{"type":"string","nullable":true,"minLength":1,"maxLength":40},"includeByokInBudgets":{"type":"boolean"},"allowedProviders":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"maxLength":200},"maxItems":100},"keys":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":200},"zdr":{"type":"object","properties":{"all":{"type":"boolean","nullable":true},"anthropic":{"type":"boolean","nullable":true},"google":{"type":"boolean","nullable":true},"openai":{"type":"boolean","nullable":true},"other":{"type":"boolean","nullable":true},"xai":{"type":"boolean","nullable":true}},"required":["all","anthropic","google","openai","other","xai"],"additionalProperties":false}},"required":["name","limitUsd","resetInterval","includeByokInBudgets","allowedProviders","keys","zdr"],"additionalProperties":false},"maxItems":200}},"required":["exists","includeByokInBudgets","budgets","inferenceKeys","byokKeys","guardrails"],"additionalProperties":false},"plan":{"type":"object","properties":{"text":{"type":"string","maxLength":200000},"counts":{"type":"object","properties":{"create":{"type":"integer","minimum":0},"update":{"type":"integer","minimum":0},"delete":{"type":"integer","minimum":0},"unmanaged":{"type":"integer","minimum":0}},"required":["create","update","delete","unmanaged"],"additionalProperties":false},"manual":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"where":{"type":"string","maxLength":2000},"expected":{"type":"string","maxLength":2000},"why":{"type":"string","maxLength":2000}},"required":["id","where","expected","why"],"additionalProperties":false},"maxItems":50},"blockers":{"type":"array","items":{"type":"string","maxLength":2000},"maxItems":100}},"required":["text","counts","manual","blockers"],"additionalProperties":false}},"required":["version","environment","workspace","plannedAt","operator","declared","live","plan"],"additionalProperties":false},"ModelTierListResponse":{"type":"object","properties":{"tiers":{"type":"array","items":{"$ref":"#/components/schemas/ModelTierSummary"}},"assignments":{"type":"array","items":{"$ref":"#/components/schemas/TierAssignmentCount"}},"llmCatalog":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/LlmModelCatalogEntry"}}},"llmRoutes":{"type":"array","items":{"$ref":"#/components/schemas/LlmModelRoute"}}},"required":["tiers","assignments","llmCatalog","llmRoutes"]},"ModelTierSummary":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"blurb":{"type":"string","nullable":true},"enabled":{"type":"boolean"},"isDefault":{"type":"boolean"},"position":{"type":"number"},"entry":{"$ref":"#/components/schemas/ModelTierEntry"},"updatedAt":{"type":"string"}},"required":["id","label","blurb","enabled","isDefault","position","entry","updatedAt"]},"ModelTierEntry":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"tierId":{"type":"string"},"modelId":{"type":"string"},"engineId":{"type":"string","nullable":true,"enum":["claude-sdk","pi",null]},"effort":{"type":"string","nullable":true,"enum":["low","medium","high","xhigh","max",null]},"enabled":{"type":"boolean"}},"required":["id","tierId","modelId","engineId","effort","enabled"]},"TierAssignmentCount":{"type":"object","properties":{"tierId":{"type":"string"},"modelId":{"type":"string"},"providerId":{"type":"string"},"sessions":{"type":"integer"}},"required":["tierId","modelId","providerId","sessions"]},"LlmModelCatalogEntry":{"type":"object","properties":{"modelId":{"type":"string"},"providerModelId":{"type":"string"},"engineId":{"type":"string","enum":["claude-sdk","pi"]},"api":{"type":"string","enum":["anthropic-messages","openai-completions","openai-responses","google-generative-ai"]},"billing":{"type":"string","enum":["direct","byok","credits"]},"capabilities":{"type":"object","properties":{"imageInput":{"type":"boolean"},"reasoningEffort":{"type":"boolean"},"promptCache":{"type":"boolean"}},"required":["imageInput","reasoningEffort","promptCache"]},"label":{"type":"string"},"note":{"type":"string"}},"required":["modelId","providerModelId","engineId","api","billing","capabilities","label"]},"LlmModelRoute":{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"providerId":{"type":"string"},"providerModelId":{"type":"string"},"position":{"type":"integer"},"enabled":{"type":"boolean"}},"required":["id","modelId","providerId","providerModelId","position","enabled"]},"TierCallDistributionResponse":{"type":"object","properties":{"period":{"type":"string","enum":["24h","7d"]},"since":{"type":"string"},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/TierCallDistribution"}}},"required":["period","since","tiers"]},"TierCallDistribution":{"type":"object","properties":{"tierId":{"type":"string"},"modelId":{"type":"string","nullable":true},"calls":{"type":"integer"},"sessions":{"type":"integer"},"olderSessions":{"type":"integer"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/TierCallRow"}}},"required":["tierId","modelId","calls","sessions","olderSessions","rows"]},"TierCallRow":{"type":"object","properties":{"modelId":{"type":"string"},"providerId":{"type":"string"},"role":{"type":"string","enum":["primary","backup","fallback_model","older_session"]},"calls":{"type":"integer"},"sessions":{"type":"integer"}},"required":["modelId","providerId","role","calls","sessions"]},"ProviderRegistrySuccess":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"UpdateModelTierInput":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":64},"blurb":{"type":"string","nullable":true,"maxLength":200},"enabled":{"type":"boolean"},"isDefault":{"type":"boolean"}}},"SetTierModelInput":{"type":"object","properties":{"modelId":{"type":"string","minLength":1,"maxLength":128},"effort":{"type":"string","nullable":true,"enum":["low","medium","high","xhigh","max",null]},"enabled":{"type":"boolean"}},"required":["modelId"]},"RoutingViewResponse":{"type":"object","properties":{"llm":{"$ref":"#/components/schemas/RoutingTab"},"media":{"$ref":"#/components/schemas/RoutingTab"},"statsWindowHours":{"type":"integer"}},"required":["llm","media","statsWindowHours"]},"RoutingTab":{"type":"object","properties":{"kind":{"type":"string","enum":["llm","media"]},"columns":{"type":"array","items":{"type":"object","properties":{"providerId":{"type":"string"},"label":{"type":"string"},"enabled":{"type":"boolean"},"keyConfigured":{"type":"boolean"},"health":{"type":"string","nullable":true,"enum":["ok","degraded","down","unknown",null]}},"required":["providerId","label","enabled","keyConfigured","health"]}},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["llm","video","image","audio"]},"label":{"type":"string"},"models":{"type":"array","items":{"$ref":"#/components/schemas/RoutingModelRow"}}},"required":["id","label","models"]}}},"required":["kind","columns","groups"]},"RoutingModelRow":{"type":"object","properties":{"modelId":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["llm","video","image","audio"]},"chain":{"type":"array","items":{"$ref":"#/components/schemas/RoutingChainEntry"}},"isDefault":{"type":"boolean"},"cells":{"type":"array","items":{"$ref":"#/components/schemas/RoutingCell"}},"stats":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/RoutingServedStat"}}},"required":["modelId","label","kind","chain","isDefault","cells","stats"]},"RoutingChainEntry":{"allOf":[{"$ref":"#/components/schemas/RoutingChainRoute"},{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"string"}}},"required":["capabilities"]}]},"RoutingChainRoute":{"type":"object","properties":{"providerId":{"type":"string","minLength":1,"maxLength":64},"modelString":{"type":"string","minLength":1,"maxLength":256},"enabled":{"type":"boolean"}},"required":["providerId","modelString","enabled"]},"RoutingCell":{"type":"object","properties":{"providerId":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/RoutingOption"}},"unavailableReason":{"type":"string","nullable":true},"customAllowed":{"type":"boolean"}},"required":["providerId","options","unavailableReason","customAllowed"]},"RoutingOption":{"type":"object","properties":{"modelString":{"type":"string"},"label":{"type":"string"},"note":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"}}},"required":["modelString","label","capabilities"]},"RoutingServedStat":{"type":"object","properties":{"providerId":{"type":"string"},"requests":{"type":"integer"},"failed":{"type":"integer","nullable":true},"p50LatencyMs":{"type":"number","nullable":true}},"required":["providerId","requests","failed","p50LatencyMs"]},"RoutingChangeListResponse":{"type":"object","properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/RoutingChange"}}},"required":["changes"]},"RoutingChange":{"type":"object","properties":{"id":{"type":"string"},"actorId":{"type":"string"},"actorEmail":{"type":"string","nullable":true},"note":{"type":"string"},"diff":{"type":"array","items":{"$ref":"#/components/schemas/RoutingModelChange"}},"revertsChangeId":{"type":"string","nullable":true},"revertedByChangeId":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","actorId","actorEmail","note","diff","revertsChangeId","revertedByChangeId","createdAt"]},"RoutingModelChange":{"type":"object","properties":{"kind":{"type":"string","enum":["llm","media"]},"modelId":{"type":"string","minLength":1,"maxLength":128},"before":{"type":"array","items":{"$ref":"#/components/schemas/RoutingChainRoute"},"maxItems":20},"after":{"type":"array","items":{"$ref":"#/components/schemas/RoutingChainRoute"},"maxItems":20}},"required":["kind","modelId","before","after"]},"ApplyRoutingChangeInput":{"type":"object","properties":{"note":{"type":"string","minLength":1,"maxLength":1000},"changes":{"type":"array","items":{"$ref":"#/components/schemas/RoutingModelChange"},"minItems":1,"maxItems":100}},"required":["note","changes"]},"RevertRoutingChangeInput":{"type":"object","properties":{"note":{"type":"string","minLength":1,"maxLength":1000}},"required":["note"]},"MediaModelRouteListResponse":{"type":"object","properties":{"routes":{"type":"array","items":{"$ref":"#/components/schemas/MediaModelRoute"}},"catalogModels":{"type":"array","items":{"$ref":"#/components/schemas/CatalogModelInfo"}},"providerCatalog":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/ProviderModelCatalogEntry"}}}},"required":["routes","catalogModels","providerCatalog"]},"MediaModelRoute":{"type":"object","properties":{"id":{"type":"string"},"modelId":{"type":"string"},"providerId":{"type":"string"},"modelString":{"type":"string"},"enabled":{"type":"boolean"},"position":{"type":"number"}},"required":["id","modelId","providerId","modelString","enabled","position"]},"CatalogModelInfo":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"providerId":{"type":"string"},"modelString":{"type":"string"}},"required":["id","label","kind","providerId","modelString"]},"ProviderModelCatalogEntry":{"type":"object","properties":{"modelString":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["video","image","audio"]},"family":{"type":"string"},"note":{"type":"string"}},"required":["modelString","label","kind"]},"UpsertMediaRouteInput":{"type":"object","properties":{"modelId":{"type":"string","minLength":1,"maxLength":128},"providerId":{"type":"string","minLength":1,"maxLength":64},"modelString":{"type":"string","minLength":1,"maxLength":256},"enabled":{"type":"boolean"}},"required":["modelId","providerId","modelString"]},"UpdateMediaRouteInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"modelString":{"type":"string","minLength":1,"maxLength":256},"position":{"type":"integer","minimum":0,"maximum":100}}},"ProviderBudgetListResponse":{"type":"object","properties":{"budgets":{"type":"array","items":{"$ref":"#/components/schemas/ProviderBudget"}}},"required":["budgets"]},"ProviderBudget":{"type":"object","properties":{"providerId":{"type":"string"},"scope":{"type":"string","enum":["key"]},"usedUsd":{"type":"number"},"limitUsd":{"type":"number"},"remainingUsd":{"type":"number"},"reset":{"type":"string","nullable":true},"state":{"type":"string","enum":["ok","warning","exhausted"]},"currency":{"type":"string","enum":["USD"]},"checkedAt":{"type":"string"}},"required":["providerId","scope","usedUsd","limitUsd","remainingUsd","reset","state","currency","checkedAt"]},"ProviderListResponse":{"type":"object","properties":{"providers":{"type":"array","items":{"$ref":"#/components/schemas/ProviderSummary"}}},"required":["providers"]},"ProviderSummary":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["llm","media","both"]},"enabled":{"type":"boolean"},"envKeyName":{"type":"string","nullable":true},"keyConfigured":{"type":"boolean"},"notes":{"type":"string","nullable":true},"health":{"$ref":"#/components/schemas/ProviderHealthSnapshot"},"updatedAt":{"type":"string"}},"required":["id","label","kind","enabled","envKeyName","keyConfigured","notes","health","updatedAt"]},"ProviderHealthSnapshot":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["ok","degraded","down","unknown"]},"latencyMs":{"type":"number","nullable":true},"detail":{"type":"object","additionalProperties":{"nullable":true}},"checkedAt":{"type":"string"}},"required":["status","latencyMs","detail","checkedAt"]},"UpdateProviderInput":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"ProviderHealthHistoryResponse":{"type":"object","properties":{"snapshots":{"type":"array","items":{"$ref":"#/components/schemas/ProviderHealthSnapshot"}}},"required":["snapshots"]},"FeatureFlagList":{"type":"object","properties":{"flags":{"type":"array","items":{"$ref":"#/components/schemas/FeatureFlagState"}}},"required":["flags"]},"FeatureFlagState":{"type":"object","properties":{"key":{"type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"rolloutPercentage":{"type":"integer","minimum":0,"maximum":100},"targets":{"type":"array","items":{"$ref":"#/components/schemas/FeatureFlagTarget"}},"updatedAt":{"type":"string","nullable":true},"updatedBy":{"type":"string","nullable":true}},"required":["key","description","enabled","rolloutPercentage","targets","updatedAt","updatedBy"]},"FeatureFlagTarget":{"type":"object","properties":{"id":{"type":"string"},"mode":{"type":"string","enum":["allow","deny"]},"userId":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"createdAt":{"type":"string"},"createdBy":{"type":"string","nullable":true}},"required":["id","mode","userId","email","createdAt","createdBy"]},"UpdateFeatureFlagInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"rolloutPercentage":{"type":"integer","minimum":0,"maximum":100}}},"AddFeatureFlagTargetInput":{"type":"object","properties":{"email":{"type":"string","format":"email"},"mode":{"type":"string","enum":["allow","deny"],"default":"allow"}},"required":["email"]},"FolderList":{"type":"array","items":{"$ref":"#/components/schemas/Folder"}},"Folder":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"updatedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","userId","name","description","createdAt","updatedAt"]},"CreateFolderInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"}},"required":["name"]},"UpdateFolderInput":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"description":{"type":"string","nullable":true}},"required":["id"]},"DriveSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"DeleteFolderInput":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"DriveFileList":{"type":"array","items":{"$ref":"#/components/schemas/DriveFile"}},"DriveFile":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"folderId":{"type":"string","nullable":true},"name":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"},"status":{"type":"string","enum":["pending","uploaded","failed"]},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"uploadedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","userId","folderId","name","mimeType","size","status","createdAt","updatedAt","uploadedAt"]},"DeleteFileInput":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"StorageQuota":{"type":"object","properties":{"userId":{"type":"string"},"usedBytes":{"type":"number"},"quotaBytes":{"type":"number"},"updatedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["userId","usedBytes","quotaBytes","updatedAt"]},"UploadInitResponse":{"type":"object","properties":{"fileId":{"type":"string"},"uploadUrl":{"type":"string"},"expiresAt":{"type":"string"}},"required":["fileId","uploadUrl","expiresAt"]},"UploadInitInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"mimeType":{"type":"string","minLength":1},"size":{"type":"number","minimum":0,"exclusiveMinimum":true},"folderId":{"type":"string"}},"required":["name","mimeType","size"]},"UploadConfirmResponse":{"type":"object","properties":{"success":{"type":"boolean"},"file":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"},"status":{"type":"string","enum":["pending","uploaded","failed"]},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"uploadedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","mimeType","size","status","createdAt","uploadedAt"]}},"required":["success","file"]},"UploadConfirmInput":{"type":"object","properties":{"fileId":{"type":"string","minLength":1}},"required":["fileId"]},"DownloadResponse":{"type":"object","properties":{"downloadUrl":{"type":"string"},"expiresAt":{"type":"string"},"name":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"}},"required":["downloadUrl","expiresAt","name","mimeType","size"]},"MakeFilePublicResponse":{"type":"object","properties":{"publicAssetId":{"type":"string"},"url":{"type":"string"}},"required":["publicAssetId","url"],"description":"Public CDN URL for the drive file. Bytes are copied into the public-assets bucket; the original drive row stays private."},"SubscriptionInfo":{"type":"object","properties":{"tier":{"$ref":"#/components/schemas/SubscriptionTier"},"status":{"$ref":"#/components/schemas/SubscriptionStatus"},"priceId":{"type":"string","nullable":true},"maxPlanId":{"type":"string","nullable":true,"enum":["max_400","max_1200","max_2000","max_4000",null]},"creditsPerMonth":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"billingInterval":{"type":"string","nullable":true,"enum":["month","year",null]},"priceAmount":{"type":"integer","nullable":true,"minimum":0,"description":"What the subscription's Price charges per billing interval, in cents; null when the Price is not in the catalog"},"grandfathered":{"type":"boolean","description":"The subscription is on a pre-raise Price it keeps until it is cancelled or changed"},"currentPeriodStart":{"type":"string","nullable":true,"format":"date-time"},"currentPeriodEnd":{"type":"string","nullable":true,"format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"availablePlans":{"type":"array","items":{"type":"string","enum":["basic","standard","pro","max"]},"description":"Paid plans with a monthly Stripe Price configured; the others are hidden on the monthly cycle"},"availableYearlyPlans":{"type":"array","items":{"type":"string","enum":["basic","standard","pro","max"]},"description":"Paid plans with a yearly Stripe Price configured; the others are hidden on the yearly cycle"},"availablePacks":{"type":"array","items":{"type":"string","enum":["starter","small","medium","large"]},"description":"Credit packs with a Stripe Price configured; the others are hidden"},"freeTrialOffer":{"$ref":"#/components/schemas/FreeTrialOffer"},"freeTrial":{"$ref":"#/components/schemas/FreeTrialState"}},"required":["tier","status","priceId","maxPlanId","creditsPerMonth","billingInterval","priceAmount","grandfathered","currentPeriodStart","currentPeriodEnd","cancelAtPeriodEnd","availablePlans","availableYearlyPlans","availablePacks","freeTrialOffer","freeTrial"],"description":"User subscription information"},"SubscriptionTier":{"type":"string","enum":["free","basic","standard","pro","max","enterprise"],"description":"Subscription tier level"},"SubscriptionStatus":{"type":"string","nullable":true,"enum":["active","canceled","past_due","trialing","incomplete","incomplete_expired","unpaid","paused",null],"description":"Stripe subscription status"},"FreeTrialOffer":{"type":"object","nullable":true,"properties":{"days":{"type":"integer","minimum":0,"exclusiveMinimum":true},"credits":{"type":"integer","minimum":0}},"required":["days","credits"],"description":"Retired (ADA-505): always null, since no free trial is offered; kept so older clients still parse the response"},"FreeTrialState":{"type":"object","nullable":true,"properties":{"tier":{"type":"string","enum":["standard","pro"]},"endsAt":{"type":"string","nullable":true,"format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"}},"required":["tier","endsAt","cancelAtPeriodEnd"],"description":"The free trial the account is in; tier stays free until Stripe charges the plan"},"CheckoutSessionResponse":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"description":"Stripe checkout session URL"},"CreateCheckoutInput":{"type":"object","properties":{"tier":{"$ref":"#/components/schemas/CheckoutSubscriptionTier"},"maxPlanId":{"$ref":"#/components/schemas/MaxPlanId"},"interval":{"$ref":"#/components/schemas/BillingInterval"},"promotionCode":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9-]+$"},"successUrl":{"type":"string","format":"uri"},"cancelUrl":{"type":"string","format":"uri"},"source":{"$ref":"#/components/schemas/CheckoutSource"},"freeTrial":{"type":"boolean"}},"description":"Input for creating a Stripe checkout session"},"CheckoutSubscriptionTier":{"type":"string","enum":["basic","standard","pro","max"],"description":"Stripe-billed self-serve subscription tier"},"MaxPlanId":{"type":"string","enum":["max_400","max_1200","max_2000","max_4000"],"description":"Selected Max monthly-credit package"},"BillingInterval":{"type":"string","enum":["month","year"],"description":"Billing interval for subscription"},"CheckoutSource":{"type":"string","enum":["video_download","report_unlock","social_posting","credits","model_tier","promo","email","settings","onboarding","tool_page"],"description":"The surface that opened the plans: a video or report gate, the credit paywall, a locked model tier, a promotion link, an email, or Plan & billing itself"},"PromotionCheckoutPreview":{"type":"object","properties":{"code":{"type":"string"},"percentOff":{"anyOf":[{"type":"number","enum":[30]},{"type":"number","enum":[50]},{"type":"number","enum":[70]}]},"tier":{"$ref":"#/components/schemas/CheckoutSubscriptionTier"},"interval":{"$ref":"#/components/schemas/BillingInterval"},"currency":{"type":"string","enum":["usd"]},"dueToday":{"type":"integer","minimum":0},"firstChargeAmount":{"type":"integer","minimum":0},"firstChargeAt":{"type":"integer","minimum":0},"renewalAmount":{"type":"integer","minimum":0},"renewalAt":{"type":"integer","minimum":0},"creditsGrantedToday":{"type":"integer","minimum":0},"creditsPerMonth":{"type":"integer","minimum":0}},"required":["code","percentOff","tier","interval","currency","dueToday","firstChargeAmount","firstChargeAt","renewalAmount","renewalAt","creditsGrantedToday","creditsPerMonth"],"description":"Server-validated first-invoice promotion amounts and dates for checkout (the first month of a monthly plan, or the first year of a yearly plan)"},"PreviewCheckoutPromotionInput":{"type":"object","properties":{"tier":{"$ref":"#/components/schemas/CheckoutSubscriptionTier"},"maxPlanId":{"$ref":"#/components/schemas/MaxPlanId"},"interval":{"$ref":"#/components/schemas/BillingInterval"},"promotionCode":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9-]+$"}},"required":["interval","promotionCode"],"description":"Promotion code and plan selected for checkout"},"CreateCreditPackCheckoutInput":{"type":"object","properties":{"packId":{"$ref":"#/components/schemas/CreditPackId"},"successUrl":{"type":"string","format":"uri"},"cancelUrl":{"type":"string","format":"uri"}},"required":["packId"],"description":"Input for creating a one-time credit pack checkout session (the starter pack for any account, larger packs for paid plans)"},"CreditPackId":{"type":"string","enum":["starter","small","medium","large"],"description":"One-time credit pack catalog identifier. `starter` is sold to every account; the others need an active paid plan."},"CheckoutConversion":{"type":"object","properties":{"sessionId":{"type":"string"},"kind":{"type":"string","enum":["subscription","credit_pack"]},"amountTotal":{"type":"integer","minimum":0},"currency":{"type":"string","minLength":3,"maxLength":3},"interval":{"allOf":[{"$ref":"#/components/schemas/BillingInterval"},{"nullable":true}]},"tier":{"allOf":[{"$ref":"#/components/schemas/CheckoutSubscriptionTier"},{"nullable":true}]},"maxPlanId":{"allOf":[{"$ref":"#/components/schemas/MaxPlanId"},{"nullable":true}]},"packId":{"allOf":[{"$ref":"#/components/schemas/CreditPackId"},{"nullable":true}]},"newCustomer":{"type":"boolean","nullable":true,"description":"True when Stripe holds no earlier successful charge for the customer (a first purchase), false when it does, null when Stripe could not say. Reported to Google Ads as `new_customer`."}},"required":["sessionId","kind","amountTotal","currency","interval","tier","maxPlanId","packId","newCustomer"],"description":"A completed Stripe checkout verified to belong to the authenticated user"},"CheckoutRefusal":{"type":"object","properties":{"refused":{"type":"boolean"},"reason":{"type":"string","nullable":true,"enum":["prepaid_card",null],"description":"Why the card was refused: `prepaid_card` when a prepaid card paid. The payment is refunded in full and no plan or credits are granted."}},"required":["refused","reason"],"description":"Whether AdAnt refused the card that paid a checkout of the authenticated user's"},"PortalSessionResponse":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"description":"Stripe customer portal URL"},"CreatePortalInput":{"type":"object","properties":{"returnUrl":{"type":"string","format":"uri"},"intent":{"type":"string","enum":["cancel"],"description":"`cancel` opens the portal directly on Stripe's cancel confirmation for the current subscription (the completed flow returns to `returnUrl` with `portal=canceled`); omitted opens the portal home."}},"description":"Input for creating a Stripe customer portal session"},"CancelSurveyResult":{"type":"object","properties":{"cancellationId":{"type":"string"},"offer":{"$ref":"#/components/schemas/SaveOfferQuote"},"help":{"type":"boolean","description":"The answer blames ease of use: show guides and a contact before the cancel"}},"required":["cancellationId","offer","help"]},"SaveOfferQuote":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["half_off_next_month"]},"percentOff":{"type":"integer"},"regularCents":{"type":"integer","minimum":0},"discountedCents":{"type":"integer","minimum":0}},"required":["kind","percentOff","regularCents","discountedCents"],"description":"Half off the next monthly invoice, once"},"CancelSurveyInput":{"type":"object","properties":{"reasons":{"type":"array","items":{"$ref":"#/components/schemas/CancelReason"},"minItems":1,"maxItems":6},"comment":{"type":"string","nullable":true,"maxLength":2000}},"required":["reasons"],"description":"The cancel survey's answers"},"CancelReason":{"type":"string","enum":["credits_too_expensive","video_quality","research_not_useful","hard_to_use","one_off_project","other"],"description":"Why the customer is canceling, grouped by product area (price, quality, research, ease, other)"},"CreateSubscriptionChangeInput":{"type":"object","properties":{"tier":{"$ref":"#/components/schemas/CheckoutSubscriptionTier"},"maxPlanId":{"$ref":"#/components/schemas/MaxPlanId"},"interval":{"$ref":"#/components/schemas/BillingInterval"},"returnUrl":{"type":"string","format":"uri"}},"required":["tier","interval"],"description":"Target plan for an existing paid subscription"},"YearlyOffers":{"type":"object","properties":{"banner":{"$ref":"#/components/schemas/YearlyOfferView"},"cancel":{"$ref":"#/components/schemas/YearlyOfferView"}},"required":["banner","cancel"],"description":"The month-one banner offer and the cancel dialog's offer, each null when this account has none."},"YearlyOfferView":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["first_month_credit","cancel_half_price"]},"surface":{"type":"string","enum":["banner","cancel"]},"tier":{"type":"string","enum":["free","basic","standard","pro","max","enterprise"]},"creditsPerMonth":{"type":"integer","minimum":0},"monthlyCents":{"type":"integer","minimum":0},"yearlyCents":{"type":"integer","minimum":0},"discountCents":{"type":"integer","minimum":0},"dueTodayCents":{"type":"integer","minimum":0}},"required":["kind","surface","tier","creditsPerMonth","monthlyCents","yearlyCents","discountCents","dueTodayCents"],"description":"One yearly offer, priced from the live subscription. Amounts in cents; `dueTodayCents` is what the switch invoice charges."},"BillingSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"YearlyOfferEventInput":{"type":"object","properties":{"surface":{"type":"string","enum":["banner","cancel"]},"kind":{"type":"string","enum":["first_month_credit","cancel_half_price"]},"event":{"type":"string","enum":["impression","dismiss"]}},"required":["surface","kind","event"],"description":"An offer the web showed or dismissed. Counted once per account, offer, surface and UTC day."},"AcceptYearlyOfferInput":{"type":"object","properties":{"surface":{"type":"string","enum":["banner","cancel"]},"kind":{"type":"string","enum":["first_month_credit","cancel_half_price"]},"returnUrl":{"type":"string","format":"uri"}},"required":["surface","kind"],"description":"The offer to take. The server prices it again; the finished flow returns to `returnUrl` (same origin only) with `portal=yearly`."},"CreatePurchaseCheckoutInput":{"type":"object","properties":{"itemKey":{"type":"string","minLength":1,"maxLength":200,"description":"The key of the item, as the page selling it names it."},"from":{"type":"string","minLength":1,"maxLength":300,"description":"The page path the buyer is on. The server returns them there only when it is a page it knows."}},"required":["itemKey"],"description":"Input for buying one item once"},"ArkEnrollmentList":{"type":"object","properties":{"enrollments":{"type":"array","items":{"$ref":"#/components/schemas/ArkEnrollmentRow"}},"quota":{"$ref":"#/components/schemas/ArkLibraryQuota"}},"required":["enrollments","quota"]},"ArkEnrollmentRow":{"type":"object","properties":{"imageSha256":{"type":"string"},"status":{"type":"string","enum":["pending","processing","active","failed"]},"projectName":{"type":"string"},"groupId":{"type":"string","nullable":true},"assetId":{"type":"string","nullable":true},"error":{"type":"object","nullable":true,"properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"attempts":{"type":"integer"},"sourceKind":{"type":"string","enum":["avatar","artifact","url"]},"sourceRef":{"type":"string"},"avatarId":{"type":"string","nullable":true},"ownerUserId":{"type":"string","nullable":true},"lastUsedAt":{"type":"string","nullable":true},"lastCheckedAt":{"type":"string","nullable":true},"activeAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["imageSha256","status","projectName","groupId","assetId","error","attempts","sourceKind","sourceRef","avatarId","ownerUserId","lastUsedAt","lastCheckedAt","activeAt","createdAt","updatedAt"]},"ArkLibraryQuota":{"type":"object","properties":{"configured":{"type":"boolean"},"projectName":{"type":"string"},"groups":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":"integer"}},"required":["used","limit"]},"assets":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":"integer"}},"required":["used","limit"]},"nearLimit":{"type":"boolean"},"counts":{"type":"object","properties":{"pending":{"type":"integer"},"processing":{"type":"integer"},"active":{"type":"integer"},"failed":{"type":"integer"}},"required":["pending","processing","active","failed"]}},"required":["configured","projectName","groups","assets","nearLimit","counts"]},"ArkEnrollmentRelease":{"type":"object","properties":{"released":{"type":"boolean"}},"required":["released"]},"ArkLibraryBackfill":{"type":"object","properties":{"registered":{"type":"integer"},"queued":{"type":"integer"},"skipped":{"type":"integer"}},"required":["registered","queued","skipped"]},"AvatarListResponse":{"type":"object","properties":{"avatars":{"type":"array","items":{"$ref":"#/components/schemas/AvatarSummary"}}},"required":["avatars"]},"AvatarSummary":{"type":"object","properties":{"id":{"type":"string"},"assetType":{"type":"string","enum":["avatar"]},"name":{"type":"string"},"ownerKind":{"type":"string","enum":["system","user"]},"category":{"type":"string","enum":["ai_human","animation","tvc"]},"userId":{"type":"string","nullable":true},"imageUrl":{"type":"string","nullable":true},"enabled":{"type":"boolean"},"activeRevisionId":{"type":"string","nullable":true},"sortOrder":{"type":"integer","nullable":true},"artifactId":{"type":"string","nullable":true},"gender":{"type":"string","nullable":true,"enum":["female","male","non_binary","unspecified",null]},"age":{"type":"string","nullable":true},"ethnicity":{"type":"string","nullable":true},"attributes":{"$ref":"#/components/schemas/AvatarAttributes"},"generation":{"$ref":"#/components/schemas/AvatarGeneration"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","assetType","name","ownerKind","category","userId","imageUrl","enabled","activeRevisionId","sortOrder","artifactId","gender","age","ethnicity","attributes","generation","createdAt","updatedAt"]},"AvatarAttributes":{"type":"object","properties":{"outfit":{"type":"string","nullable":true,"maxLength":500},"details":{"type":"string","nullable":true,"maxLength":1000},"behaviorPrompt":{"type":"string","nullable":true,"maxLength":2000}}},"AvatarGeneration":{"type":"object","nullable":true,"properties":{"mode":{"type":"string","enum":["text","image","video"]},"model":{"type":"string"},"prompt":{"type":"string"},"referenceUrls":{"type":"array","items":{"type":"string"}},"jobId":{"type":"string","nullable":true}},"required":["mode","model","prompt"]},"CreateAvatarInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"imageUrl":{"type":"string","format":"uri"},"appearance":{"$ref":"#/components/schemas/AvatarAppearance"}},"required":["name","imageUrl"]},"AvatarAppearance":{"type":"object","properties":{"gender":{"type":"string","enum":["female","male","non_binary","unspecified"]},"age":{"type":"string","maxLength":40},"ethnicity":{"type":"string","maxLength":60},"outfit":{"type":"string","maxLength":500},"details":{"type":"string","maxLength":1000},"behaviorPrompt":{"type":"string","maxLength":2000}},"default":{}},"GenerateAvatarInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"mode":{"type":"string","enum":["text","image"],"default":"text"},"appearance":{"$ref":"#/components/schemas/AvatarAppearance"},"referenceImageUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":8},"model":{"type":"string"},"size":{"type":"string","pattern":"^\\d+x\\d+$"}},"required":["name"]},"UpdateAvatarInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"appearance":{"$ref":"#/components/schemas/AvatarAppearance"}}},"AvatarSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"AdminAvatarListResponse":{"type":"object","properties":{"avatars":{"type":"array","items":{"$ref":"#/components/schemas/AdminAvatarSummary"}}},"required":["avatars"]},"AdminAvatarSummary":{"allOf":[{"$ref":"#/components/schemas/AvatarSummary"},{"type":"object","properties":{"arkEnrollment":{"$ref":"#/components/schemas/ArkEnrollmentSummary"}}}]},"ArkEnrollmentSummary":{"type":"object","nullable":true,"properties":{"imageSha256":{"type":"string"},"status":{"type":"string","enum":["pending","processing","active","failed"]},"assetId":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true},"updatedAt":{"type":"string"}},"required":["imageSha256","status","assetId","errorCode","updatedAt"]},"CreateSystemAvatarForm":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"name":{"type":"string","minLength":1,"maxLength":120},"category":{"type":"string","enum":["ai_human","animation","tvc"]},"gender":{"type":"string","enum":["female","male","non_binary","unspecified"]},"age":{"type":"string","maxLength":40},"ethnicity":{"type":"string","maxLength":60},"details":{"type":"string","maxLength":1000}},"required":["name"]},"ReorderSystemAvatarsInput":{"type":"object","properties":{"category":{"type":"string","enum":["ai_human","animation","tvc"]},"orderedIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":500}},"required":["orderedIds"]},"UpdateSystemAvatarInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"category":{"type":"string","enum":["ai_human","animation","tvc"]},"gender":{"type":"string","nullable":true,"enum":["female","male","non_binary","unspecified",null]},"age":{"type":"string","nullable":true,"maxLength":40},"ethnicity":{"type":"string","nullable":true,"maxLength":60},"details":{"type":"string","nullable":true,"maxLength":1000}}},"ReplaceSystemAvatarImageForm":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}},"AdminVoiceAssetListResponse":{"type":"object","properties":{"voices":{"type":"array","items":{"$ref":"#/components/schemas/AdminVoiceAsset"}},"total":{"type":"integer","minimum":0}},"required":["voices","total"]},"AdminVoiceAsset":{"allOf":[{"$ref":"#/components/schemas/VoiceCatalogItem"},{"type":"object","properties":{"active":{"type":"boolean"},"providerStatus":{"type":"integer","nullable":true},"syncedAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["active","providerStatus","syncedAt","updatedAt"]}]},"VoiceCatalogItem":{"type":"object","properties":{"id":{"type":"string"},"voiceId":{"type":"string"},"provider":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"language":{"type":"string","nullable":true},"accent":{"type":"string","nullable":true},"gender":{"type":"string","nullable":true},"age":{"type":"string","nullable":true},"traits":{"type":"array","items":{"type":"string"}},"useCases":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}},"recommended":{"type":"boolean"},"coverUrl":{"type":"string","nullable":true,"format":"uri"},"sampleUrl":{"type":"string","nullable":true,"format":"uri"},"sampleModel":{"type":"string"}},"required":["id","voiceId","provider","name","description","language","accent","gender","age","traits","useCases","tags","recommended","coverUrl","sampleUrl","sampleModel"]},"UpdateAdminVoiceAssetInput":{"type":"object","properties":{"active":{"type":"boolean"}},"required":["active"]},"ChatShareLink":{"type":"object","properties":{"token":{"type":"string"},"url":{"type":"string"},"sessionId":{"type":"string"},"createdAt":{"type":"string"},"snapshotAt":{"type":"string"}},"required":["token","url","sessionId","createdAt","snapshotAt"]},"ShareChatInput":{"type":"object","properties":{"sessionId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"}},"required":["sessionId"]},"ChatShareLinkResponse":{"type":"object","properties":{"link":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"url":{"type":"string"},"sessionId":{"type":"string"},"createdAt":{"type":"string"},"snapshotAt":{"type":"string"}},"required":["token","url","sessionId","createdAt","snapshotAt"]}},"required":["link"]},"ChatShareSuccess":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"SharedConversation":{"type":"object","properties":{"token":{"type":"string"},"sessionId":{"type":"string"},"title":{"type":"string","nullable":true},"sharedBy":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"snapshotAt":{"type":"string"},"isOwner":{"type":"boolean"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"turn":{"type":"integer"},"seq":{"type":"integer"},"type":{"type":"string"},"payload":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"number"}},"required":["id","turn","seq","type","payload","createdAt"]}},"artifacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"viewer":{"type":"string"},"title":{"type":"string"},"createdAt":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"thumbnailUrl":{"type":"string","nullable":true}},"required":["id","kind","viewer","title","createdAt","metadata","thumbnailUrl"]}}},"required":["token","sessionId","title","sharedBy","snapshotAt","isOwner","events","artifacts"]},"SharedArtifactPayload":{"type":"object","properties":{"url":{"type":"string"},"kind":{"type":"string"}},"required":["url","kind"]},"TeamList":{"type":"object","properties":{"teams":{"type":"array","items":{"$ref":"#/components/schemas/TeamSummary"}},"invitations":{"type":"array","items":{"$ref":"#/components/schemas/TeamInvitation"}},"canCreateTeam":{"type":"boolean"},"ownsTeam":{"type":"boolean"}},"required":["teams","invitations","canCreateTeam","ownsTeam"]},"TeamSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","member"]},"memberCount":{"type":"integer"},"createdAt":{"type":"string"}},"required":["id","name","role","memberCount","createdAt"]},"TeamInvitation":{"type":"object","properties":{"id":{"type":"string"},"team":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"inviter":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"expiresAt":{"type":"string"}},"required":["id","team","inviter","expiresAt"]},"TeamNameInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60}},"required":["name"]},"TeamMemberList":{"type":"object","properties":{"team":{"allOf":[{"$ref":"#/components/schemas/TeamSummary"},{"nullable":true}]},"members":{"type":"array","items":{"$ref":"#/components/schemas/TeamMember"}}},"required":["team","members"]},"TeamMember":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"avatarUrl":{"type":"string","nullable":true},"role":{"type":"string","enum":["owner","member"]},"status":{"type":"string","enum":["active","invited"]},"inviteId":{"type":"string"}},"required":["userId","name","email","avatarUrl","role","status"]},"TeamSuccess":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"TeamInvite":{"type":"object","properties":{"id":{"type":"string"},"teamId":{"type":"string"},"email":{"type":"string"},"status":{"type":"string","enum":["pending","accepted","revoked","expired"]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","teamId","email","status","expiresAt","createdAt"]},"CreateTeamInviteInput":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320},"teamId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"}},"required":["email"]},"TeamJoinResult":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"inviter":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"]},"alreadyMember":{"type":"boolean"},"addressedToYou":{"type":"boolean"}},"required":["team","inviter","alreadyMember"]},"SessionParticipantList":{"type":"object","properties":{"participants":{"type":"array","items":{"$ref":"#/components/schemas/SessionParticipant"}}},"required":["participants"]},"SessionParticipant":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"avatarUrl":{"type":"string","nullable":true},"addedAt":{"type":"string"}},"required":["userId","name","email","avatarUrl","addedAt"]},"TaskPeople":{"type":"object","properties":{"people":{"type":"array","items":{"$ref":"#/components/schemas/TaskPerson"}}},"required":["people"]},"TaskPerson":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"avatarUrl":{"type":"string","nullable":true},"role":{"type":"string","enum":["owner","participant"]}},"required":["userId","name","avatarUrl","role"]},"SessionParticipantResponse":{"type":"object","properties":{"participant":{"$ref":"#/components/schemas/SessionParticipant"}},"required":["participant"]},"AddSessionParticipantInput":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"}},"required":["userId"]},"StartVideoDiagnosisResponse":{"allOf":[{"$ref":"#/components/schemas/VideoDiagnosisRun"},{"type":"object","properties":{"reused":{"type":"boolean","description":"True when an earlier run answered the same question: completed within the last day, or still in flight. Nothing was queued."}},"required":["reused"]}]},"VideoDiagnosisRun":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","running","completed","failed"]},"url":{"type":"string"},"compareWith":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"result":{"type":"object","nullable":true,"properties":{"version":{"type":"number","enum":[2]},"source":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","youtube","instagram"]},"videoId":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"authorHandle":{"type":"string","nullable":true}},"required":["platform","videoId","url","authorHandle"]},"whatHappened":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["judged"]},"label":{"type":"string","enum":["outlier","normal","flop"]},"basis":{"type":"object","properties":{"method":{"type":"string","enum":["account_typical","views_to_followers"]},"views":{"type":"integer","minimum":0},"comparedWith":{"type":"number","minimum":0},"ratio":{"type":"number","minimum":0},"threshold":{"type":"number","minimum":0}},"required":["method","views","comparedWith","ratio","threshold"]},"metrics":{"type":"object","properties":{"views":{"type":"integer","nullable":true,"minimum":0},"likes":{"type":"integer","nullable":true,"minimum":0},"comments":{"type":"integer","nullable":true,"minimum":0},"shares":{"type":"integer","nullable":true,"minimum":0},"saves":{"type":"integer","nullable":true,"minimum":0,"default":null},"followerCount":{"type":"integer","nullable":true,"minimum":0},"postedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["views","likes","comments","shares","followerCount","postedAt"]},"versusSample":{"type":"object","nullable":true,"properties":{"views":{"type":"integer","minimum":0},"sampleViews":{"type":"integer","minimum":0,"exclusiveMinimum":true},"ratio":{"type":"number","minimum":0}},"required":["views","sampleViews","ratio"]},"benchmark":{"type":"object","properties":{"source":{"type":"string","enum":["user_sample","account_best","niche_outliers"]},"videos":{"type":"array","items":{"type":"object","properties":{"video":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","youtube","instagram"]},"videoId":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"authorHandle":{"type":"string","nullable":true}},"required":["platform","videoId","url","authorHandle"]},"metrics":{"type":"object","properties":{"views":{"type":"integer","nullable":true,"minimum":0},"likes":{"type":"integer","nullable":true,"minimum":0},"comments":{"type":"integer","nullable":true,"minimum":0},"shares":{"type":"integer","nullable":true,"minimum":0},"saves":{"type":"integer","nullable":true,"minimum":0,"default":null},"followerCount":{"type":"integer","nullable":true,"minimum":0},"postedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["views","likes","comments","shares","followerCount","postedAt"]}},"required":["video","metrics"]},"minItems":1,"maxItems":3}},"required":["source","videos"]},"summary":{"type":"string","minLength":1}},"required":["status","label","basis","metrics","benchmark","summary"]},{"type":"object","properties":{"status":{"type":"string","enum":["too_early"]},"metrics":{"type":"object","properties":{"views":{"type":"integer","nullable":true,"minimum":0},"likes":{"type":"integer","nullable":true,"minimum":0},"comments":{"type":"integer","nullable":true,"minimum":0},"shares":{"type":"integer","nullable":true,"minimum":0},"saves":{"type":"integer","nullable":true,"minimum":0,"default":null},"followerCount":{"type":"integer","nullable":true,"minimum":0},"postedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["views","likes","comments","shares","followerCount","postedAt"]},"versusSample":{"type":"object","nullable":true,"properties":{"views":{"type":"integer","minimum":0},"sampleViews":{"type":"integer","minimum":0,"exclusiveMinimum":true},"ratio":{"type":"number","minimum":0}},"required":["views","sampleViews","ratio"]},"ageHours":{"type":"number","minimum":0},"summary":{"type":"string","minLength":1}},"required":["status","metrics","ageHours","summary"]},{"type":"object","properties":{"status":{"type":"string","enum":["no_benchmark"]},"metrics":{"type":"object","properties":{"views":{"type":"integer","nullable":true,"minimum":0},"likes":{"type":"integer","nullable":true,"minimum":0},"comments":{"type":"integer","nullable":true,"minimum":0},"shares":{"type":"integer","nullable":true,"minimum":0},"saves":{"type":"integer","nullable":true,"minimum":0,"default":null},"followerCount":{"type":"integer","nullable":true,"minimum":0},"postedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["views","likes","comments","shares","followerCount","postedAt"]},"versusSample":{"type":"object","nullable":true,"properties":{"views":{"type":"integer","minimum":0},"sampleViews":{"type":"integer","minimum":0,"exclusiveMinimum":true},"ratio":{"type":"number","minimum":0}},"required":["views","sampleViews","ratio"]},"summary":{"type":"string","minLength":1}},"required":["status","metrics","summary"]}]},"why":{"type":"object","properties":{"reasons":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1},"explanation":{"type":"string","minLength":1},"evidence":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["timestamp"]},"detail":{"type":"string","minLength":1},"sourceAtSeconds":{"type":"number","nullable":true,"minimum":0},"benchmarkAtSeconds":{"type":"number","nullable":true,"minimum":0}},"required":["kind","detail","sourceAtSeconds","benchmarkAtSeconds"]},{"type":"object","properties":{"kind":{"type":"string","enum":["structure"]},"detail":{"type":"string","minLength":1},"sourceAtSeconds":{"type":"number","nullable":true,"minimum":0},"benchmarkAtSeconds":{"type":"number","nullable":true,"minimum":0}},"required":["kind","detail","sourceAtSeconds","benchmarkAtSeconds"]},{"type":"object","properties":{"kind":{"type":"string","enum":["engagement"]},"detail":{"type":"string","minLength":1},"metric":{"type":"string","enum":["likes_per_1k_views","comments_per_1k_views","shares_per_1k_views","saves_per_1k_views"]},"sourcePer1kViews":{"type":"number","minimum":0},"benchmarkPer1kViews":{"type":"number","minimum":0}},"required":["kind","detail","metric","sourcePer1kViews","benchmarkPer1kViews"]}]},"minItems":1},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["title","explanation","evidence","confidence"]}},"accountLevelCauses":{"type":"array","items":{"type":"string","minLength":1},"minItems":1}},"required":["reasons","accountLevelCauses"]},"makeMyVersion":{"type":"object","properties":{"directions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["refine","retell"]},"title":{"type":"string","minLength":1},"summary":{"type":"string","minLength":1},"changes":{"type":"array","items":{"type":"object","properties":{"target":{"type":"string","enum":["video","caption"]},"span":{"type":"object","nullable":true,"properties":{"startSeconds":{"type":"number","minimum":0},"endSeconds":{"type":"number","minimum":0}},"required":["startSeconds","endSeconds"]},"change":{"type":"string","minLength":1},"why":{"type":"string","minLength":1}},"required":["target","span","change","why"]},"minItems":1},"outline":{"type":"array","items":{"type":"object","properties":{"startSeconds":{"type":"number","minimum":0},"endSeconds":{"type":"number","minimum":0},"beat":{"type":"string","minLength":1}},"required":["startSeconds","endSeconds","beat"]},"minItems":1},"full":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["locked"]}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","enum":["unlocked"]},"version":{"type":"object","properties":{"script":{"type":"string","minLength":1},"storyboard":{"type":"array","items":{"type":"object","properties":{"startSeconds":{"type":"number","minimum":0},"endSeconds":{"type":"number","minimum":0},"shot":{"type":"string","minLength":1},"onScreenText":{"type":"string","nullable":true}},"required":["startSeconds","endSeconds","shot","onScreenText"]},"minItems":1},"generationPrompt":{"type":"string","minLength":1}},"required":["script","storyboard","generationPrompt"]}},"required":["status","version"]}]}},"required":["kind","title","summary","changes","outline","full"]},"minItems":1,"maxItems":2}},"required":["directions"]},"anatomy":{"type":"object","properties":{"videos":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["source","benchmark"]},"video":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","youtube","instagram"]},"videoId":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"authorHandle":{"type":"string","nullable":true}},"required":["platform","videoId","url","authorHandle"]},"hook":{"type":"object","properties":{"startSeconds":{"type":"number","minimum":0},"endSeconds":{"type":"number","minimum":0},"description":{"type":"string","minLength":1}},"required":["startSeconds","endSeconds","description"]},"beats":{"type":"array","items":{"type":"object","properties":{"startSeconds":{"type":"number","minimum":0},"endSeconds":{"type":"number","minimum":0},"description":{"type":"string","minLength":1}},"required":["startSeconds","endSeconds","description"]},"minItems":1},"payoff":{"type":"object","nullable":true,"properties":{"startSeconds":{"type":"number","minimum":0},"endSeconds":{"type":"number","minimum":0},"description":{"type":"string","minLength":1}},"required":["startSeconds","endSeconds","description"]},"loop":{"type":"object","nullable":true,"properties":{"startSeconds":{"type":"number","minimum":0},"endSeconds":{"type":"number","minimum":0},"description":{"type":"string","minLength":1}},"required":["startSeconds","endSeconds","description"]}},"required":["role","video","hook","beats","payoff","loop"]},"minItems":1}},"required":["videos"]}},"required":["version","source","whatHappened","why","makeMyVersion","anatomy"],"description":"Set once completed. `makeMyVersion.full` is `locked` unless the caller is signed in."},"failure":{"type":"object","nullable":true,"properties":{"code":{"type":"string","enum":["unsupported_link","video_not_found","sample_not_found","analysis_failed","write_failed","timed_out","internal_error"]},"message":{"type":"string"}},"required":["code","message"],"description":"Set once failed: the code and what to show."}},"required":["id","status","url","compareWith","createdAt","completedAt","result","failure"]},"StartVideoDiagnosis":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"description":"One TikTok video, one YouTube Short, or one Instagram Reel — a Reel only with `compareWith`.","example":"https://www.tiktok.com/@creator/video/7412345678901234567"},"compareWith":{"type":"string","nullable":true,"minLength":1,"maxLength":2048,"description":"Compare with: the user's own benchmark video (TikTok, YouTube Short or Instagram Reel); required when `url` is a Reel. Without it the account's best recent posts, else niche outliers, are the benchmark."}},"required":["url"]},"VideoDiagnosisSettings":{"type":"object","properties":{"turnstileSiteKey":{"type":"string","nullable":true,"description":"The Cloudflare Turnstile site key to render the widget with (action `video-diagnosis`); its token goes in the `x-captcha-response` header of a start. Null where this deployment does not verify Turnstile."},"anonymousDailyLimit":{"type":"integer","description":"New diagnoses a UTC day per IP and per device without an account."},"signedInDailyLimit":{"type":"integer","description":"New diagnoses a UTC day per signed-in account."}},"required":["turnstileSiteKey","anonymousDailyLimit","signedInDailyLimit"]},"ClaimVideoDiagnosisSignup":{"type":"object","properties":{"outcome":{"type":"string","enum":["attributed","already_attributed","not_new","unknown_run"],"description":"`attributed` when this new account is now counted as the diagnosis's signup; `already_attributed` when it was counted before; `not_new` when the account is older than an hour (a sign-in, not a signup); `unknown_run` for an id with no diagnosis."}},"required":["outcome"]},"ProductListResponse":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/ProductSummary"}}},"required":["products"]},"ProductSummary":{"type":"object","properties":{"id":{"type":"string"},"assetType":{"type":"string","enum":["product"]},"name":{"type":"string"},"ownerKind":{"type":"string","enum":["system","user"]},"userId":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"sellingPoints":{"type":"array","items":{"type":"string"}},"images":{"type":"array","items":{"$ref":"#/components/schemas/ProductImageRef"}},"sourceUrl":{"type":"string","nullable":true},"brand":{"$ref":"#/components/schemas/ProductBrand"},"brandAssets":{"type":"array","items":{"$ref":"#/components/schemas/BrandAssetSummary"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","assetType","name","ownerKind","userId","category","description","sellingPoints","images","sourceUrl","brand","brandAssets","createdAt","updatedAt"]},"ProductImageRef":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"mime":{"type":"string"},"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true}},"required":["id","url","mime","width","height"]},"ProductBrand":{"type":"object","nullable":true,"properties":{"palette":{"type":"array","items":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"maxItems":12,"default":[]},"fonts":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"maxItems":8,"default":[]},"summary":{"type":"string","nullable":true,"maxLength":2000,"default":null},"voice":{"type":"string","nullable":true,"maxLength":500,"default":null}}},"BrandAssetSummary":{"type":"object","properties":{"id":{"type":"string"},"productId":{"type":"string"},"label":{"type":"string"},"kind":{"$ref":"#/components/schemas/BrandAssetKind"},"mime":{"type":"string"},"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true},"url":{"type":"string"},"alwaysOverlay":{"type":"boolean"},"defaultPlacement":{"$ref":"#/components/schemas/OverlayPlacement"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","productId","label","kind","mime","width","height","url","alwaysOverlay","defaultPlacement","createdAt","updatedAt"]},"BrandAssetKind":{"type":"string","enum":["logo","wordmark","icon","badge","other"]},"OverlayPlacement":{"type":"object","nullable":true,"properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"w":{"type":"number","minimum":0.01,"maximum":1},"h":{"type":"number","minimum":0.01,"maximum":1}},"required":["x","y","w","h"]},"ProductLookupResponse":{"type":"object","properties":{"canonicalUrl":{"type":"string","nullable":true},"match":{"$ref":"#/components/schemas/ProductLookupMatch"}},"required":["canonicalUrl","match"]},"ProductLookupMatch":{"type":"object","nullable":true,"properties":{"product":{"$ref":"#/components/schemas/ProductSummary"},"similarity":{"type":"string","enum":["exact","same-site"]}},"required":["product","similarity"]},"ImportProductResponse":{"type":"object","properties":{"product":{"$ref":"#/components/schemas/ProductSummary"},"found":{"$ref":"#/components/schemas/ImportProductFound"},"pageError":{"type":"string","nullable":true}},"required":["product","found","pageError"]},"ImportProductFound":{"type":"object","properties":{"name":{"type":"boolean"},"description":{"type":"boolean"},"images":{"type":"integer"},"logo":{"type":"boolean"}},"required":["name","description","images","logo"]},"ImportProductInput":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048},"productId":{"type":"string","minLength":1}},"required":["url"]},"CreateProductInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"category":{"type":"string","maxLength":120},"description":{"type":"string","maxLength":5000},"sellingPoints":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":10,"default":[]},"sourceUrl":{"type":"string","minLength":1,"maxLength":2048},"brand":{"$ref":"#/components/schemas/ProductBrand"},"imageUrls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":12}},"required":["name","imageUrls"]},"UpdateProductInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"category":{"type":"string","nullable":true,"maxLength":120},"description":{"type":"string","nullable":true,"maxLength":5000},"sellingPoints":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":10},"sourceUrl":{"type":"string","nullable":true,"minLength":1,"maxLength":2048},"brand":{"$ref":"#/components/schemas/ProductBrand"},"imageUrls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":12}}},"ProductSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"CreateBrandAssetInput":{"type":"object","properties":{"imageUrl":{"type":"string","format":"uri"},"label":{"type":"string","minLength":1,"maxLength":80},"kind":{"$ref":"#/components/schemas/BrandAssetKind"},"alwaysOverlay":{"type":"boolean","default":false},"defaultPlacement":{"$ref":"#/components/schemas/OverlayPlacement"}},"required":["imageUrl","label"]},"UpdateBrandAssetInput":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"kind":{"$ref":"#/components/schemas/BrandAssetKind"},"alwaysOverlay":{"type":"boolean"},"defaultPlacement":{"$ref":"#/components/schemas/OverlayPlacement"}}},"VideoOverlayResponse":{"type":"object","properties":{"artifactId":{"type":"string"},"layout":{"$ref":"#/components/schemas/OverlayLayout"},"layers":{"type":"array","items":{"$ref":"#/components/schemas/ResolvedOverlayLayer"}},"plateUrl":{"type":"string","nullable":true},"revision":{"type":"integer"},"pending":{"type":"boolean"},"error":{"type":"string","nullable":true}},"required":["artifactId","layout","layers","plateUrl","revision","pending","error"]},"OverlayLayout":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"plateArtifactId":{"type":"string","minLength":1,"maxLength":120},"width":{"type":"integer","minimum":0,"exclusiveMinimum":true},"height":{"type":"integer","minimum":0,"exclusiveMinimum":true},"layers":{"type":"array","items":{"$ref":"#/components/schemas/OverlayLayer"},"maxItems":24}},"required":["version","plateArtifactId","width","height","layers"]},"OverlayLayer":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["text","image"]},"label":{"type":"string","minLength":1,"maxLength":500},"source":{"$ref":"#/components/schemas/OverlayLayerSource"},"box":{"$ref":"#/components/schemas/OverlayBox"},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"startSec":{"type":"number","nullable":true,"minimum":0,"default":null},"endSec":{"type":"number","nullable":true,"minimum":0,"default":null},"naturalWidth":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null},"naturalHeight":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"default":null}},"required":["id","kind","label","source","box"]},"OverlayLayerSource":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["layer"]},"key":{"type":"string","minLength":1,"maxLength":512}},"required":["type","key"]},{"type":"object","properties":{"type":{"type":"string","enum":["brandAsset"]},"brandAssetId":{"type":"string","minLength":1,"maxLength":120}},"required":["type","brandAssetId"]}]},"OverlayBox":{"type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"w":{"type":"number","minimum":0.01,"maximum":1},"h":{"type":"number","minimum":0.01,"maximum":1}},"required":["x","y","w","h"]},"ResolvedOverlayLayer":{"allOf":[{"$ref":"#/components/schemas/OverlayLayer"},{"type":"object","properties":{"url":{"type":"string","nullable":true}},"required":["url"]}]},"SaveVideoOverlayInput":{"type":"object","properties":{"layers":{"type":"array","items":{"$ref":"#/components/schemas/OverlayLayer"},"maxItems":24}},"required":["layers"]},"AdminScheduledTaskStats":{"type":"object","properties":{"tasksScheduledToday":{"type":"integer"},"tasksScheduledTotal":{"type":"integer"},"tasksEnabled":{"type":"integer"},"usersWithTasks":{"type":"integer"},"runsSucceededToday":{"type":"integer"},"byCategory":{"type":"object","properties":{"content_strategy":{"type":"integer"},"social_video":{"type":"integer"},"social_manager":{"type":"integer"},"reddit_listening":{"type":"integer"},"x_listening":{"type":"integer"},"social_management":{"type":"integer"}},"required":["content_strategy","social_video","social_manager","reddit_listening","x_listening","social_management"]},"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"tasksScheduled":{"type":"integer"},"runsSucceeded":{"type":"integer"}},"required":["date","tasksScheduled","runsSucceeded"]}}},"required":["tasksScheduledToday","tasksScheduledTotal","tasksEnabled","usersWithTasks","runsSucceededToday","byCategory","trend"],"description":"Scheduled-task adoption for the admin overview: tasks put on the calendar, how many are live, and the runs they produced."},"AdminRecentScheduledTasks":{"type":"object","properties":{"tasks":{"type":"array","items":{"$ref":"#/components/schemas/AdminScheduledTaskRow"}},"total":{"type":"integer"},"accounts":{"type":"integer"},"since":{"type":"string"},"days":{"type":"integer"}},"required":["tasks","total","accounts","since","days"],"description":"The tasks live accounts scheduled in a window of UTC days, newest first, each with the account behind it — the overview tile's drill-down."},"AdminScheduledTaskRow":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening","social_management"]},"agentKey":{"type":"string"},"enabled":{"type":"boolean"},"createdAt":{"type":"string"},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"lastRunStatus":{"type":"string","nullable":true,"enum":["queued","running","succeeded","failed","canceled",null]},"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]}},"required":["id","title","category","agentKey","enabled","createdAt","nextRunAt","lastRunAt","lastRunStatus","user"]},"MetaAdsConnection":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"displayName":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","reconnect"]},"scopes":{"type":"array","items":{"type":"string"}},"tokenExpiresAt":{"type":"string","nullable":true},"adAccount":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"}},"required":["id","name","currency"]},"page":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"instagram":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"username":{"type":"string","nullable":true}},"required":["id","username"]},"createdAt":{"type":"string"}},"required":["id","displayName","status","scopes","tokenExpiresAt","adAccount","page","instagram","createdAt"]},"TemplateSubmission":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"processingStatus":{"type":"string","enum":["idle","queued","running","succeeded","failed"]},"title":{"type":"string"},"note":{"type":"string"},"sourceKind":{"type":"string","enum":["artifact","upload"]},"artifactId":{"type":"string","nullable":true},"videoUrl":{"type":"string"},"posterUrl":{"type":"string","nullable":true},"durationSeconds":{"type":"number","nullable":true},"width":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"aspectRatio":{"type":"string","nullable":true},"suggestedCategories":{"type":"array","items":{"type":"string","enum":["ugc","animation","tvc"]}},"categories":{"type":"array","items":{"type":"string","enum":["ugc","animation","tvc"]}},"reviewNote":{"type":"string"},"reviewedAt":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"processingError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","processingStatus","title","note","sourceKind","artifactId","videoUrl","posterUrl","durationSeconds","width","height","aspectRatio","suggestedCategories","categories","reviewNote","reviewedAt","templateId","processingError","createdAt","updatedAt"]},"CreateTemplateSubmissionInput":{"type":"object","properties":{"artifactId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":200},"note":{"type":"string","maxLength":2000},"suggestedCategories":{"type":"array","items":{"type":"string","enum":["ugc","animation","tvc"]},"maxItems":3}},"required":["artifactId","title"]},"TemplateSubmissionListResponse":{"type":"object","properties":{"submissions":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSubmission"}}},"required":["submissions"]},"VideoTemplateListResponse":{"type":"object","properties":{"templates":{"type":"array","items":{"$ref":"#/components/schemas/VideoTemplateSummary"}}},"required":["templates"]},"VideoTemplateSummary":{"type":"object","properties":{"id":{"type":"string"},"assetType":{"type":"string","enum":["template"]},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["ugc","animation","tvc"]},"categories":{"type":"array","items":{"type":"string","enum":["ugc","animation","tvc"]}},"status":{"type":"string","enum":["draft","published"]},"enabled":{"type":"boolean"},"activeRevisionId":{"type":"string","nullable":true},"durationSeconds":{"type":"number","nullable":true},"aspectRatio":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"sortOrder":{"type":"number","nullable":true},"videoUrl":{"type":"string"},"posterUrl":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","assetType","slug","name","description","type","categories","status","enabled","activeRevisionId","durationSeconds","aspectRatio","tags","sortOrder","videoUrl","posterUrl","createdAt","updatedAt"]},"VideoTemplateDetail":{"allOf":[{"$ref":"#/components/schemas/VideoTemplateSummary"},{"type":"object","properties":{"metadata":{"type":"object","additionalProperties":{"nullable":true}},"examples":{"type":"array","items":{"$ref":"#/components/schemas/VideoTemplateExample"}}},"required":["metadata","examples"]}]},"VideoTemplateExample":{"type":"object","properties":{"videoUrl":{"type":"string"},"posterUrl":{"type":"string"},"label":{"type":"string"}},"required":["videoUrl"]},"VideoTemplateGenerationsResponse":{"type":"object","properties":{"generations":{"type":"array","items":{"$ref":"#/components/schemas/VideoTemplateGeneration"}}},"required":["generations"]},"VideoTemplateGeneration":{"type":"object","properties":{"jobId":{"type":"string"},"artifactId":{"type":"string"},"videoUrl":{"type":"string","nullable":true},"thumbnailUrl":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["jobId","artifactId","videoUrl","thumbnailUrl","createdAt"]},"AddTemplateExampleForm":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"An example output video generated from this template."},"label":{"type":"string","description":"Short caption (e.g. \"Skincare product, generated avatar\")."}}},"AdminTemplateSubmissionListResponse":{"type":"object","properties":{"submissions":{"type":"array","items":{"$ref":"#/components/schemas/AdminTemplateSubmission"}}},"required":["submissions"]},"AdminTemplateSubmission":{"allOf":[{"$ref":"#/components/schemas/TemplateSubmission"},{"type":"object","properties":{"userId":{"type":"string"},"userEmail":{"type":"string","nullable":true},"userName":{"type":"string","nullable":true},"reviewedBy":{"type":"string","nullable":true},"sourceKey":{"type":"string","nullable":true}},"required":["userId","userEmail","userName","reviewedBy","sourceKey"]}]},"ApproveTemplateSubmissionInput":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"string","enum":["ugc","animation","tvc"]},"minItems":1,"maxItems":3},"title":{"type":"string","minLength":1,"maxLength":200},"reviewNote":{"type":"string","maxLength":2000}}},"RejectTemplateSubmissionInput":{"type":"object","properties":{"reviewNote":{"type":"string","minLength":1,"maxLength":2000}},"required":["reviewNote"]},"AdminVideoTemplateListResponse":{"type":"object","properties":{"templates":{"type":"array","items":{"$ref":"#/components/schemas/VideoTemplateDetail"}}},"required":["templates"]},"CreateVideoTemplateForm":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The reference video (any container; transcoded to mp4)."},"metadata":{"type":"string","description":"The template's full analysis metadata.json (0.3.0), pasted verbatim."},"name":{"type":"string","description":"Display name override (defaults to metadata.video_name)."},"type":{"type":"string","enum":["ugc","animation","tvc"],"description":"Template type (defaults from metadata.type)."}},"required":["metadata"]},"ReorderVideoTemplatesInput":{"type":"object","properties":{"type":{"type":"string","enum":["ugc","animation","tvc"]},"orderedIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":500}},"required":["orderedIds"]},"UpdateVideoTemplateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":5000},"type":{"type":"string","enum":["ugc","animation","tvc"]},"categories":{"type":"array","items":{"type":"string","enum":["ugc","animation","tvc"]},"maxItems":3},"status":{"type":"string","enum":["draft","published"]},"sortOrder":{"type":"integer","nullable":true},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"maxItems":30},"metadata":{"type":"object","additionalProperties":{"nullable":true}}}},"ReplaceTemplateVideoForm":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The replacement reference video (any container; transcoded to mp4, poster re-extracted)."}}},"VideoTemplateSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"ProductReportList":{"type":"object","properties":{"reports":{"type":"array","items":{"$ref":"#/components/schemas/ProductReportSummary"}}},"required":["reports"]},"ProductReportSummary":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["social_content_research","social_content_strategy","reddit_listening","x_listening","social_listening","creator_collaboration"]},"productSlug":{"type":"string"},"title":{"type":"string"},"latestVersionNo":{"type":"integer"},"latestVersionId":{"type":"string"},"productName":{"type":"string"},"reportDate":{"type":"string"},"source":{"type":"string","enum":["chatgpt","codex","claude","cli","unknown","agent","team"]},"strategyCount":{"type":"integer"},"creatorCount":{"type":"integer","minimum":0},"platformCount":{"type":"integer"},"coverThumbUrl":{"type":"string","nullable":true},"coverPost":{"type":"object","nullable":true,"properties":{"platform":{"type":"string","enum":["x","reddit"]},"source":{"type":"string"},"text":{"type":"string"},"image":{"type":"string","nullable":true},"reach":{"type":"string"}},"required":["platform","source","text","image","reach"]},"unopened":{"type":"boolean"},"sharedFrom":{"$ref":"#/components/schemas/ProductReportSharedFrom"},"sessionId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","kind","productSlug","title","latestVersionNo","latestVersionId","productName","reportDate","source","strategyCount","platformCount","coverThumbUrl","unopened","sharedFrom","createdAt","updatedAt"]},"ProductReportSharedFrom":{"type":"object","nullable":true,"properties":{"by":{"type":"string"},"viaTeam":{"type":"boolean"},"note":{"type":"string","nullable":true},"sharedAt":{"type":"string"}},"required":["by","viaTeam","note","sharedAt"]},"ProductReportView":{"type":"object","properties":{"report":{"$ref":"#/components/schemas/ProductReportSummary"},"version":{"allOf":[{"$ref":"#/components/schemas/ProductReportVersionSummary"},{"type":"object","properties":{"pdfUrl":{"type":"string","nullable":true},"htmlUrl":{"type":"string","nullable":true}},"required":["pdfUrl","htmlUrl"]}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ProductReportVersionSummary"}},"data":{"$ref":"#/components/schemas/ProductReportData"},"locked":{"$ref":"#/components/schemas/ProductReportLocked"}},"required":["report","version","versions","data"]},"ProductReportVersionSummary":{"type":"object","properties":{"id":{"type":"string"},"versionNo":{"type":"integer"},"reportDate":{"type":"string"},"source":{"type":"string","enum":["chatgpt","codex","claude","cli","unknown","agent","team"]},"note":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","versionNo","reportDate","source","note","createdAt"]},"ProductReportData":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[1]},"layout":{"type":"string","enum":["research","strategy_brief","reddit_listening","x_listening","social_listening","creator_collaboration"]},"cover":{"type":"object","properties":{"clientName":{"type":"string"},"reportSubtitle":{"type":"string"},"clientContact":{"type":"string"},"reportDate":{"type":"string"}},"required":["clientName","reportSubtitle","clientContact","reportDate"]},"exec":{"type":"object","properties":{"headline":{"type":"string"},"findings":{"type":"array","items":{"type":"string"}},"recommendation":{"type":"string"}},"required":["headline","findings","recommendation"]},"landscape":{"type":"object","properties":{"headline":{"type":"string"},"copy":{"type":"string"},"heroStat":{"type":"object","properties":{"value":{"type":"string"},"suffix":{"type":"string"},"label":{"type":"string"},"platforms":{"type":"string"}},"required":["value","suffix","label","platforms"]}},"required":["headline","copy","heroStat"]},"competitive":{"type":"object","properties":{"tiers":{"type":"array","items":{"type":"object","properties":{"header":{"type":"string"},"brand":{"type":"string"},"badge":{"type":"string"},"desc":{"type":"string"}},"required":["header","brand","badge","desc"]}}},"required":["tiers"]},"platforms":{"type":"object","properties":{"tiktok":{"type":"object","properties":{"brandHeadline":{"type":"string"},"brandIntro":{"type":"string"},"brandVideos":{"type":"array","items":{"type":"object","properties":{"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"side":{"type":"string","enum":["brand","creator"]},"url":{"type":"string"},"thumb":{"type":"string","nullable":true},"handle":{"type":"string"},"metric":{"type":"string"},"metricValue":{"type":"number","nullable":true},"metricUnit":{"type":"string","nullable":true,"enum":["views","likes",null]},"format":{"type":"string"},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["platform","side","url","thumb","handle","metric","metricValue","metricUnit","format"]}},"brandEmptyNote":{"type":"string","nullable":true},"creatorHeadline":{"type":"string"},"creatorIntro":{"type":"string"},"creatorVideos":{"type":"array","items":{"type":"object","properties":{"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"side":{"type":"string","enum":["brand","creator"]},"url":{"type":"string"},"thumb":{"type":"string","nullable":true},"handle":{"type":"string"},"metric":{"type":"string"},"metricValue":{"type":"number","nullable":true},"metricUnit":{"type":"string","nullable":true,"enum":["views","likes",null]},"format":{"type":"string"},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["platform","side","url","thumb","handle","metric","metricValue","metricUnit","format"]}},"creatorEmptyNote":{"type":"string","nullable":true}},"required":["brandHeadline","brandIntro","brandVideos","brandEmptyNote","creatorHeadline","creatorIntro","creatorVideos","creatorEmptyNote"]},"instagram":{"type":"object","properties":{"brandHeadline":{"type":"string"},"brandIntro":{"type":"string"},"brandVideos":{"type":"array","items":{"type":"object","properties":{"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"side":{"type":"string","enum":["brand","creator"]},"url":{"type":"string"},"thumb":{"type":"string","nullable":true},"handle":{"type":"string"},"metric":{"type":"string"},"metricValue":{"type":"number","nullable":true},"metricUnit":{"type":"string","nullable":true,"enum":["views","likes",null]},"format":{"type":"string"},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["platform","side","url","thumb","handle","metric","metricValue","metricUnit","format"]}},"brandEmptyNote":{"type":"string","nullable":true},"creatorHeadline":{"type":"string"},"creatorIntro":{"type":"string"},"creatorVideos":{"type":"array","items":{"type":"object","properties":{"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"side":{"type":"string","enum":["brand","creator"]},"url":{"type":"string"},"thumb":{"type":"string","nullable":true},"handle":{"type":"string"},"metric":{"type":"string"},"metricValue":{"type":"number","nullable":true},"metricUnit":{"type":"string","nullable":true,"enum":["views","likes",null]},"format":{"type":"string"},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["platform","side","url","thumb","handle","metric","metricValue","metricUnit","format"]}},"creatorEmptyNote":{"type":"string","nullable":true}},"required":["brandHeadline","brandIntro","brandVideos","brandEmptyNote","creatorHeadline","creatorIntro","creatorVideos","creatorEmptyNote"]},"youtube":{"type":"object","properties":{"brandHeadline":{"type":"string"},"brandIntro":{"type":"string"},"brandVideos":{"type":"array","items":{"type":"object","properties":{"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"side":{"type":"string","enum":["brand","creator"]},"url":{"type":"string"},"thumb":{"type":"string","nullable":true},"handle":{"type":"string"},"metric":{"type":"string"},"metricValue":{"type":"number","nullable":true},"metricUnit":{"type":"string","nullable":true,"enum":["views","likes",null]},"format":{"type":"string"},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["platform","side","url","thumb","handle","metric","metricValue","metricUnit","format"]}},"brandEmptyNote":{"type":"string","nullable":true},"creatorHeadline":{"type":"string"},"creatorIntro":{"type":"string"},"creatorVideos":{"type":"array","items":{"type":"object","properties":{"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"side":{"type":"string","enum":["brand","creator"]},"url":{"type":"string"},"thumb":{"type":"string","nullable":true},"handle":{"type":"string"},"metric":{"type":"string"},"metricValue":{"type":"number","nullable":true},"metricUnit":{"type":"string","nullable":true,"enum":["views","likes",null]},"format":{"type":"string"},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["platform","side","url","thumb","handle","metric","metricValue","metricUnit","format"]}},"creatorEmptyNote":{"type":"string","nullable":true}},"required":["brandHeadline","brandIntro","brandVideos","brandEmptyNote","creatorHeadline","creatorIntro","creatorVideos","creatorEmptyNote"]}},"required":["tiktok","instagram","youtube"]},"metaAds":{"type":"object","properties":{"headline":{"type":"string"},"intro":{"type":"string"},"ads":{"type":"array","items":{"type":"object","properties":{"advertiser":{"type":"string"},"adId":{"type":"string","nullable":true},"query":{"type":"string","nullable":true},"thumb":{"type":"string","nullable":true}},"required":["advertiser","adId","query","thumb"]}},"emptyNote":{"type":"string","nullable":true}},"required":["headline","intro","ads","emptyNote"]},"formats":{"type":"object","properties":{"headline":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"name":{"type":"string"},"desc":{"type":"string"}},"required":["tag","name","desc"]}}},"required":["headline","items"]},"strategies":{"type":"object","properties":{"headline":{"type":"string"},"intro":{"type":"string"},"closingHeadline":{"type":"string"},"closingCopy":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"title":{"type":"string"},"platform":{"type":"string","nullable":true,"enum":["tiktok","instagram","youtube","meta-ads",null]},"format":{"type":"string"},"metric":{"type":"string"},"metricValue":{"type":"number","nullable":true},"metricUnit":{"type":"string","nullable":true,"enum":["views","likes",null]},"posted":{"type":"string","nullable":true},"handle":{"type":"string"},"url":{"type":"string"},"thumb":{"type":"string","nullable":true},"whyThisVideo":{"type":"string"},"avatar":{"type":"string"},"keep":{"type":"string"},"change":{"type":"string"},"style":{"type":"string","nullable":true},"overlays":{"type":"array","items":{"type":"string"}},"message":{"type":"string"},"sourceTier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]},"hook":{"type":"string"},"script":{"type":"string"},"cta":{"type":"string"},"audience":{"type":"string"},"observedAt":{"type":"string","nullable":true},"analysisArtifactId":{"type":"string","nullable":true}},"required":["index","title","platform","format","metric","metricValue","metricUnit","posted","handle","url","thumb","whyThisVideo","avatar","keep","change","style","overlays","message"]}},"reserves":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"title":{"type":"string"},"platform":{"type":"string","nullable":true,"enum":["tiktok","instagram","youtube","meta-ads",null]},"format":{"type":"string"},"metric":{"type":"string"},"metricValue":{"type":"number","nullable":true},"metricUnit":{"type":"string","nullable":true,"enum":["views","likes",null]},"posted":{"type":"string","nullable":true},"handle":{"type":"string"},"url":{"type":"string"},"thumb":{"type":"string","nullable":true},"whyThisVideo":{"type":"string"},"avatar":{"type":"string"},"keep":{"type":"string"},"change":{"type":"string"},"style":{"type":"string","nullable":true},"overlays":{"type":"array","items":{"type":"string"}},"message":{"type":"string"},"sourceTier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]},"hook":{"type":"string"},"script":{"type":"string"},"cta":{"type":"string"},"audience":{"type":"string"},"observedAt":{"type":"string","nullable":true},"analysisArtifactId":{"type":"string","nullable":true}},"required":["index","title","platform","format","metric","metricValue","metricUnit","posted","handle","url","thumb","whyThisVideo","avatar","keep","change","style","overlays","message"]}}},"required":["headline","intro","closingHeadline","closingCopy","items"]},"status":{"type":"string","nullable":true,"enum":["complete","partial",null]},"requestedStrategyCount":{"type":"integer","nullable":true},"gaps":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"title":{"type":"string"},"observedAt":{"type":"string","nullable":true}},"required":["url","title","observedAt"]}},"reddit":{"type":"object","properties":{"window":{"type":"string","enum":["day","week","month"]},"scannedAt":{"type":"string"},"stats":{"type":"object","properties":{"scannedPosts":{"type":"number"},"candidates":{"type":"number"},"brand":{"type":"number"},"competitor":{"type":"number"},"need":{"type":"number"}},"required":["scannedPosts","candidates","brand","competitor","need"],"additionalProperties":{"nullable":true}},"audience":{"type":"object","properties":{"icp":{"type":"string"},"useCases":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"capability":{"type":"string"},"detail":{"type":"string"}},"required":["name","capability"],"additionalProperties":{"nullable":true}}}},"required":["icp","useCases"],"additionalProperties":{"nullable":true}},"pulse":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"summary":{"type":"string"},"tone":{"type":"string","enum":["positive","mixed","negative","neutral"]},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"}},"required":["label","url"]}}},"required":["name","summary","tone","links"],"additionalProperties":{"nullable":true}}},"threads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"subreddit":{"type":"string"},"title":{"type":"string"},"excerpt":{"type":"string"},"author":{"type":"string"},"postedAt":{"type":"string","nullable":true},"score":{"type":"number"},"numComments":{"type":"number"},"bucket":{"type":"string","enum":["brand","competitor","need"]},"postType":{"type":"string"},"matched":{"type":"array","items":{"type":"string"}},"thumb":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","gallery","crosspost","video","link"]},"verdict":{"type":"string","enum":["reply","help","skip"]},"why":{"type":"string"},"risk":{"type":"string"},"reply":{"type":"string"},"changed":{"type":"boolean"},"useCase":{"type":"string"}},"required":["id","url","subreddit","title","excerpt","author","score","numComments","bucket","matched","media","verdict","why","risk","reply"],"additionalProperties":{"nullable":true}}},"revision":{"type":"object","properties":{"feedback":{"type":"string"},"changes":{"type":"array","items":{"type":"string"}}},"required":["feedback","changes"]}},"required":["window","scannedAt","stats","pulse","threads"],"additionalProperties":{"nullable":true}},"creators":{"type":"object","properties":{"criteria":{"type":"object","properties":{"segment":{"type":"string","enum":["ugc","micro","influencer","all"]},"bands":{"type":"string","enum":["5k-50k","10k-100k"]},"targetCount":{"type":"integer","minimum":1,"maximum":100},"platforms":{"type":"array","items":{"type":"string","enum":["tiktok","instagram","youtube"]},"minItems":1,"maxItems":3},"niches":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"excludedKeywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"minFollowers":{"type":"integer","minimum":0},"maxFollowers":{"type":"integer","minimum":0},"locations":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"languages":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"minAverageViews":{"type":"integer","minimum":0},"minEngagementRate":{"type":"number","minimum":0,"maximum":100},"activeWithinDays":{"type":"integer","minimum":1,"maximum":365},"requireOutlier":{"type":"boolean"},"excludeCompetitorPartners":{"type":"boolean"}},"required":["segment","targetCount","platforms","niches","keywords","excludedKeywords","locations","languages","requireOutlier","excludeCompetitorPartners"]},"productUrl":{"type":"string","nullable":true,"maxLength":4096,"pattern":"^https:\\/\\//i"},"sourceReportId":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"scannedAt":{"type":"string","format":"date-time"},"competitors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":2000},"aliases":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"sourceUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"}},"required":["name","aliases","sourceUrl"]},"maxItems":30},"searched":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"candidatesReviewed":{"type":"integer","minimum":0},"coverage":{"type":"object","properties":{"reviewedAccountUrls":{"type":"array","items":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"maxItems":10000},"gaps":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":200}},"required":["reviewedAccountUrls","gaps"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"accounts":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"handle":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"url":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"avatarUrl":{"type":"string","nullable":true,"maxLength":4096,"pattern":"^https:\\/\\//i"},"avatarThumb":{"type":"string","nullable":true},"followers":{"type":"integer","nullable":true,"minimum":0},"postCount":{"type":"integer","nullable":true,"minimum":0},"bio":{"type":"string","maxLength":4000},"location":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"language":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"observedAt":{"type":"string","format":"date-time"}},"required":["platform","handle","name","url","avatarUrl","followers","bio","location","language","observedAt"]},"minItems":1,"maxItems":6},"primaryAccountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"fit":{"type":"string","minLength":1,"maxLength":2000},"suggestedCollaboration":{"type":"string","minLength":1,"maxLength":2000},"outreachDm":{"type":"string","minLength":1,"maxLength":600},"matchedCriteria":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"unverifiedCriteria":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"pastContent":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"accountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"url":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"caption":{"type":"string","maxLength":4000},"format":{"type":"string","enum":["video","image","carousel","unknown"]},"thumbnailUrl":{"type":"string","nullable":true,"maxLength":4096,"pattern":"^https:\\/\\//i"},"thumb":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true,"format":"date-time"},"observedAt":{"type":"string","format":"date-time"},"views":{"type":"integer","nullable":true,"minimum":0},"likes":{"type":"integer","nullable":true,"minimum":0},"comments":{"type":"integer","nullable":true,"minimum":0},"outlier":{"type":"string","enum":["outlier","reference","unverified"]},"whyRelevant":{"type":"string","maxLength":2000}},"required":["platform","accountUrl","url","caption","thumbnailUrl","postedAt","observedAt","views","likes","comments","outlier","whyRelevant"]},"maxItems":20},"collaborations":{"type":"array","items":{"type":"object","properties":{"brand":{"type":"string","minLength":1,"maxLength":2000},"relationship":{"type":"string","enum":["disclosed","affiliate","inferred","mention"]},"evidenceUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"evidence":{"type":"string","minLength":1,"maxLength":2000},"observedAt":{"type":"string","format":"date-time"},"competitor":{"type":"boolean"}},"required":["brand","relationship","evidenceUrl","evidence","observedAt","competitor"]},"maxItems":30},"collaborationCoverage":{"type":"string","enum":["reviewed","limited","unavailable"]},"identityEvidence":{"type":"array","items":{"type":"object","properties":{"accountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"matchedAccountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"basis":{"type":"string","enum":["profile_link","name_and_image"]},"explanation":{"type":"string","minLength":1,"maxLength":2000},"confidence":{"type":"string","enum":["confirmed","probable"]},"imageSimilarity":{"type":"number","minimum":0,"maximum":1}},"required":["accountUrl","matchedAccountUrl","basis","explanation","confidence"]},"maxItems":15}},"required":["id","name","accounts","primaryAccountUrl","fit","suggestedCollaboration","matchedCriteria","unverifiedCriteria","pastContent","collaborations","collaborationCoverage","identityEvidence"]},"maxItems":100}},"required":["criteria","productUrl","sourceReportId","scannedAt","competitors","searched","candidatesReviewed","items"]},"x":{"type":"object","properties":{"window":{"type":"string","enum":["day","week","month"]},"scannedAt":{"type":"string"},"productUrl":{"type":"string"},"replyAs":{"type":"object","properties":{"name":{"type":"string"},"handle":{"type":"string"}},"required":["name","handle"],"additionalProperties":{"nullable":true}},"stats":{"type":"object","properties":{"searches":{"type":"number"},"discovered":{"type":"number"},"readPosts":{"type":"number"},"candidates":{"type":"number"},"brand":{"type":"number"},"competitor":{"type":"number"},"need":{"type":"number"}},"required":["searches","discovered","readPosts","candidates","brand","competitor","need"],"additionalProperties":{"nullable":true}},"pulse":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"summary":{"type":"string"},"tone":{"type":"string","enum":["positive","mixed","negative","neutral"]},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"}},"required":["label","url"]}}},"required":["name","summary","tone","links"],"additionalProperties":{"nullable":true}}},"posts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"handle":{"type":"string"},"authorName":{"type":"string"},"text":{"type":"string"},"postedAt":{"type":"string","nullable":true},"likes":{"type":"number"},"reposts":{"type":"number"},"replies":{"type":"number"},"views":{"type":"number"},"bucket":{"type":"string","enum":["brand","competitor","need"]},"matched":{"type":"array","items":{"type":"string"}},"thumb":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","video","gif","link","quote"]},"isReply":{"type":"boolean"},"verdict":{"type":"string","enum":["reply","skip"]},"why":{"type":"string"},"risk":{"type":"string"},"reply":{"type":"string"},"sellingPoint":{"type":"string"},"changed":{"type":"boolean"}},"required":["id","url","handle","authorName","text","likes","reposts","replies","views","bucket","matched","media","isReply","verdict","why","risk","reply"],"additionalProperties":{"nullable":true}}},"revision":{"type":"object","properties":{"feedback":{"type":"string"},"changes":{"type":"array","items":{"type":"string"}}},"required":["feedback","changes"]}},"required":["window","scannedAt","productUrl","stats","pulse","posts"],"additionalProperties":{"nullable":true}}},"required":["schemaVersion","cover","exec","landscape","competitive","platforms","metaAds","formats","strategies"]},"ProductReportLocked":{"type":"object","nullable":true,"properties":{"reason":{"type":"string","enum":["UPGRADE_REQUIRED"]},"feature":{"type":"string"},"requiredTiers":{"type":"array","items":{"type":"string"}},"strategies":{"type":"integer","minimum":0},"sections":{"type":"array","items":{"type":"string","enum":["competitive","platforms","metaAds","formats","landscape","limitations"]}},"pdf":{"type":"boolean"}},"required":["reason","feature","requiredTiers","strategies","sections","pdf"],"description":"Present when the caller's plan reads only the teaser: `data` is then the executive summary and the top strategy, and this names what was withheld. The PDF route answers 403 UPGRADE_REQUIRED on that plan."},"ProductReportPdf":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"ProductReportSuccess":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"MarkReportOpenedInput":{"type":"object","properties":{"versionNo":{"type":"integer","minimum":1}},"required":["versionNo"]},"RecordReportHandoffInput":{"type":"object","properties":{"versionNo":{"type":"integer","minimum":1},"strategyIndex":{"type":"integer","minimum":1},"surface":{"type":"string","enum":["strategy_card","strategy_preview","session_pane","report_actions"]},"destination":{"type":"string","enum":["social_video","content_strategy"]}},"required":["surface","destination"],"description":"One strategy → Studio click: which card (or the report as a whole), from which surface, aimed at which agent."},"ProductReportShareList":{"type":"object","properties":{"shares":{"type":"array","items":{"$ref":"#/components/schemas/ProductReportShareRecipient"}}},"required":["shares"]},"ProductReportShareRecipient":{"type":"object","properties":{"id":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]},"viaTeam":{"type":"boolean"},"note":{"type":"string","nullable":true},"openedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","user","viaTeam","note","openedAt","createdAt"]},"ShareProductReportInput":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":320},"note":{"type":"string","maxLength":2000}},"required":["email"]},"ProductReportTeamShareResult":{"type":"object","properties":{"shares":{"type":"array","items":{"$ref":"#/components/schemas/ProductReportShareRecipient"}},"skipped":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"reason":{"type":"string"}},"required":["userId","reason"]}}},"required":["shares","skipped"]},"ShareProductReportWithTeamInput":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":50}},"required":["userIds"]},"RedeemProductReportLinkResponse":{"type":"object","properties":{"reportId":{"type":"string"},"mode":{"type":"string","enum":["share","push"]}},"required":["reportId","mode"]},"ProductReportLink":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"mode":{"type":"string","enum":["share","push"]},"viaTeam":{"type":"boolean"},"note":{"type":"string","nullable":true},"maxRedemptions":{"type":"integer","nullable":true},"redemptionCount":{"type":"integer"},"state":{"type":"string","enum":["active","revoked","expired","exhausted"]},"expiresAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","url","mode","viaTeam","note","maxRedemptions","redemptionCount","state","expiresAt","createdAt"]},"CreateProductReportLinkInput":{"type":"object","properties":{"mode":{"type":"string","enum":["share","push"]},"note":{"type":"string","maxLength":2000},"maxRedemptions":{"type":"integer","minimum":1,"maximum":1000},"expiresInDays":{"type":"integer","nullable":true,"minimum":1,"maximum":365}},"required":["mode"]},"ProductReportLinkList":{"type":"object","properties":{"links":{"type":"array","items":{"$ref":"#/components/schemas/ProductReportLink"}}},"required":["links"]},"AdminReportList":{"type":"object","properties":{"reports":{"type":"array","items":{"$ref":"#/components/schemas/ProductReportSummary"}}},"required":["reports"]},"AdminAllReportsResponse":{"type":"object","properties":{"reports":{"type":"array","items":{"$ref":"#/components/schemas/AdminReportRow"}},"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"}},"required":["reports","total","page","limit"]},"AdminReportRow":{"type":"object","properties":{"id":{"type":"string"},"owner":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]},"requestedBy":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]},"title":{"type":"string"},"productName":{"type":"string"},"latestVersionNo":{"type":"integer"},"reportDate":{"type":"string"},"source":{"type":"string","enum":["chatgpt","codex","claude","cli","unknown","agent","team"]},"strategyCount":{"type":"integer"},"platformCount":{"type":"integer"},"unopened":{"type":"boolean"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","owner","requestedBy","title","productName","latestVersionNo","reportDate","source","strategyCount","platformCount","unopened","updatedAt","createdAt"]},"AdminReportStats":{"type":"object","properties":{"reportsGeneratedToday":{"type":"integer"},"agentReportsGeneratedToday":{"type":"integer"},"reportsGeneratedTotal":{"type":"integer"},"agentReportsGeneratedTotal":{"type":"integer"},"usersWithReports":{"type":"integer"},"videoHandoffsToday":{"type":"integer"},"videoHandoffsTotal":{"type":"integer"},"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"reportsGenerated":{"type":"integer"},"agentReportsGenerated":{"type":"integer"},"videoHandoffs":{"type":"integer"}},"required":["date","reportsGenerated","agentReportsGenerated","videoHandoffs"]}}},"required":["reportsGeneratedToday","agentReportsGeneratedToday","reportsGeneratedTotal","agentReportsGeneratedTotal","usersWithReports","videoHandoffsToday","videoHandoffsTotal","trend"],"description":"The report funnel for the admin overview: reports generated, the agent's share of them, and strategies handed off to become videos."},"AdminReportHandoffsResponse":{"type":"object","properties":{"handoffs":{"type":"array","items":{"$ref":"#/components/schemas/AdminReportHandoffRow"}},"total":{"type":"integer"},"accounts":{"type":"integer"},"since":{"type":"string"},"days":{"type":"integer"},"destination":{"type":"string","enum":["social_video","content_strategy"]}},"required":["handoffs","total","accounts","since","days","destination"],"description":"Strategies carried out of reports in a window of UTC days, newest first, each with the account that clicked — the overview's \"video clicks\" drill-down."},"AdminReportHandoffRow":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"surface":{"type":"string","enum":["strategy_card","strategy_preview","session_pane","report_actions"]},"destination":{"type":"string","enum":["social_video","content_strategy"]},"reportId":{"type":"string"},"reportTitle":{"type":"string","nullable":true},"versionNo":{"type":"integer","nullable":true},"strategyIndex":{"type":"integer","nullable":true},"strategy":{"type":"object","nullable":true,"properties":{"title":{"type":"string"},"platform":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"thumb":{"type":"string","nullable":true}},"required":["title","platform","url","thumb"]},"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]}},"required":["id","createdAt","surface","destination","reportId","reportTitle","versionNo","strategyIndex","strategy","user"]},"AdminSetReportRequesterResponse":{"type":"object","properties":{"requestedBy":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]}},"required":["requestedBy"]},"AdminSetReportRequesterInput":{"type":"object","properties":{"userId":{"type":"string","nullable":true,"minLength":1}},"required":["userId"]},"AdminReportViewResponse":{"allOf":[{"$ref":"#/components/schemas/ProductReportView"},{"type":"object","properties":{"owner":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]}},"required":["owner"]}]},"AdminShareReportResponse":{"type":"object","properties":{"shares":{"type":"array","items":{"$ref":"#/components/schemas/ProductReportShareRecipient"}},"skipped":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"reason":{"type":"string"}},"required":["userId","reason"]}}},"required":["shares","skipped"]},"AdminShareReportInput":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":100},"note":{"type":"string","maxLength":2000},"viaTeam":{"type":"boolean"}},"required":["userIds"]},"AdminPushStoredReportResponse":{"type":"object","properties":{"pushes":{"type":"array","items":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]},"reportId":{"type":"string"},"versionNo":{"type":"integer"},"appended":{"type":"boolean"}},"required":["user","reportId","versionNo","appended"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"reason":{"type":"string"}},"required":["userId","reason"]}},"warnings":{"type":"array","items":{"type":"string"}}},"required":["pushes","skipped","warnings"]},"AdminPushStoredReportInput":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":50},"note":{"type":"string","maxLength":2000},"versionNo":{"type":"integer","minimum":1}},"required":["userIds"]},"AdminRepairThumbnailsResponse":{"type":"object","properties":{"reportId":{"type":"string"},"versions":{"type":"array","items":{"type":"object","properties":{"versionId":{"type":"string"},"versionNo":{"type":"integer"},"blank":{"type":"integer"},"filled":{"type":"integer"},"remaining":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["versionId","versionNo","blank","filled","remaining","warnings"]}}},"required":["reportId","versions"]},"AdminRepairThumbnailsInput":{"type":"object","properties":{"versionNo":{"type":"integer","minimum":1},"allVersions":{"type":"boolean"}}},"AdminCreateReportLinkInput":{"type":"object","properties":{"mode":{"type":"string","enum":["share","push"]},"note":{"type":"string","maxLength":2000},"maxRedemptions":{"type":"integer","minimum":1,"maximum":1000},"expiresInDays":{"type":"integer","nullable":true,"minimum":1,"maximum":365},"viaTeam":{"type":"boolean"}},"required":["mode"]},"AdminReportLinkList":{"type":"object","properties":{"links":{"type":"array","items":{"$ref":"#/components/schemas/ProductReportLink"}}},"required":["links"]},"AdminReportShareList":{"type":"object","properties":{"shares":{"type":"array","items":{"$ref":"#/components/schemas/ProductReportShareRecipient"}}},"required":["shares"]},"AdminReportVersionsResponse":{"type":"object","properties":{"report":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"owner":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email","name"]}},"required":["id","title","owner"]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/AdminReportVersionRow"}}},"required":["report","versions"]},"AdminReportVersionRow":{"type":"object","properties":{"id":{"type":"string"},"versionNo":{"type":"integer"},"reportDate":{"type":"string"},"source":{"type":"string","enum":["chatgpt","codex","claude","cli","unknown","agent","team"]},"note":{"type":"string","nullable":true},"pushedBy":{"type":"string","nullable":true},"openedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","versionNo","reportDate","source","note","pushedBy","openedAt","createdAt"]},"AdminPushReportResponse":{"type":"object","properties":{"reportId":{"type":"string"},"versionNo":{"type":"integer"},"title":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"deduplicated":{"type":"boolean"}},"required":["reportId","versionNo","title","warnings","deduplicated"]},"AdminPushReportForm":{"type":"object","properties":{"userId":{"type":"string","minLength":1},"data":{"type":"string","format":"binary"},"assets":{"type":"array","items":{"type":"string","format":"binary"}},"pdf":{"type":"string","format":"binary"},"html":{"type":"string","format":"binary"},"note":{"type":"string","maxLength":2000},"reportId":{"type":"string"}},"required":["userId"]},"ApiKeyListResponse":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"keyPrefix":{"type":"string"},"userId":{"type":"string"},"permissions":{"type":"array","nullable":true,"items":{"type":"string","enum":["read","write","delete"]}},"expiresAt":{"type":"string","nullable":true,"format":"date-time"},"lastUsedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","keyPrefix","userId","permissions","expiresAt","lastUsedAt","createdAt"],"description":"API key record (without the key value)"},"CreateApiKeyResponse":{"type":"object","properties":{"apiKey":{"$ref":"#/components/schemas/ApiKey"},"plainKey":{"type":"string"}},"required":["apiKey","plainKey"],"description":"Created API key with the plain key (only shown once)"},"CreateApiKeyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"expiresAt":{"type":"string","nullable":true,"format":"date-time"},"permissions":{"type":"array","nullable":true,"items":{"type":"string","enum":["read","write","delete"]}}},"required":["name"],"description":"Input for creating a new API key"},"UpdateApiKeyInput":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":100}},"required":["id","name"]},"DeleteApiKeyInput":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"CreateCliTokenResponse":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]},"CreateCliTokenInput":{"type":"object","properties":{"state":{"type":"string","minLength":1},"port":{"type":"string","minLength":1}},"required":["state","port"]},"ExchangeCliTokenResponse":{"type":"object","properties":{"apiKey":{"type":"string"},"username":{"type":"string"}},"required":["apiKey","username"]},"ExchangeCliTokenInput":{"type":"object","properties":{"token":{"type":"string","minLength":1}},"required":["token"]},"IssueBrainSessionTokenResponse":{"type":"object","properties":{"token":{"type":"string"},"brainSessionId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string","enum":["skill:read","artifact:read","artifact:write","credit:reserve","credit:settle","media:generate","public-asset:write","asset:read","product:write","avatar:write"]}},"expiresAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["token","brainSessionId","permissions","expiresAt"],"description":"A short-lived brain-session token bound to a single brain session."},"IssueBrainSessionTokenInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"permissions":{"type":"array","items":{"type":"string","enum":["skill:read","artifact:read","artifact:write","credit:reserve","credit:settle","media:generate","public-asset:write","asset:read","product:write","avatar:write"]}}},"description":"Input for minting a short-lived brain-session token (bst_*) for media generation."},"LocalTokenListResponse":{"type":"array","items":{"$ref":"#/components/schemas/LocalToken"}},"LocalToken":{"type":"object","properties":{"id":{"type":"string"},"tokenPrefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["media","research","report"]}},"deviceName":{"type":"string"},"expiresAt":{"type":"string","nullable":true,"format":"date-time"},"lastUsedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","tokenPrefix","scopes","deviceName","expiresAt","lastUsedAt","createdAt"],"description":"An active, device-bound plugin session. The secret token is never returned."},"RevokeLocalTokenInput":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"]},"CreditReserveResponse":{"type":"object","properties":{"reservationId":{"type":"string"},"bucketAllocation":{"type":"array","items":{"$ref":"#/components/schemas/CreditBucketAllocationItem"}},"reservedAmount":{"type":"integer","minimum":0},"availableBefore":{"type":"integer","minimum":0}},"required":["reservationId","bucketAllocation","reservedAmount","availableBefore"]},"CreditBucketAllocationItem":{"type":"object","properties":{"bucket":{"$ref":"#/components/schemas/CreditBucket"},"amount":{"type":"integer","minimum":0}},"required":["bucket","amount"]},"CreditReserveInput":{"type":"object","properties":{"userId":{"type":"string"},"operationId":{"type":"string"},"amount":{"type":"integer","minimum":0,"exclusiveMinimum":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["userId","operationId","amount"]},"CreditSettleResponse":{"type":"object","properties":{"refundedAmount":{"type":"integer","minimum":0},"additionalDebited":{"type":"integer","minimum":0}},"required":["refundedAmount","additionalDebited"]},"CreditSettleInput":{"type":"object","properties":{"operationId":{"type":"string"},"actualAmount":{"type":"integer","minimum":0},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["operationId","actualAmount"]},"CreditRefundResponse":{"type":"object","properties":{"refundedAmount":{"type":"integer","minimum":0}},"required":["refundedAmount"]},"CreditRefundInput":{"type":"object","properties":{"operationId":{"type":"string"},"reason":{"type":"string","maxLength":512},"refundedBy":{"type":"string","enum":["user_cancel","technical_failure","expired"]}},"required":["operationId","reason"]},"CreditBalanceInput":{"type":"object","properties":{"userId":{"type":"string"}},"required":["userId"]},"FeatureFlagValues":{"type":"object","properties":{"features":{"type":"object","additionalProperties":{"type":"boolean"},"example":{"video-editor":true},"description":"Resolved flag values for the signed-in user."}},"required":["features"]},"FavoriteListResponse":{"type":"array","items":{"$ref":"#/components/schemas/Favorite"}},"Favorite":{"type":"object","properties":{"id":{"type":"string"},"skillId":{"type":"string"},"skillName":{"type":"string"},"skillDescription":{"type":"string","nullable":true},"namespace":{"type":"string"},"ownerName":{"type":"string"},"createdAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","skillId","skillName","skillDescription","namespace","ownerName","createdAt"]},"SkillListSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"AddFavoriteInput":{"type":"object","properties":{"skillId":{"type":"string","minLength":1}},"required":["skillId"]},"RemoveFavoriteInput":{"type":"object","properties":{"skillId":{"type":"string","minLength":1}},"required":["skillId"]},"FavoriteBatchCheckResponse":{"type":"object","additionalProperties":{"type":"boolean"}},"V1BatchCheckFavoritesInput":{"type":"object","properties":{"skillIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1}},"required":["skillIds"]},"SkillListListResponse":{"type":"array","items":{"$ref":"#/components/schemas/SkillList"}},"SkillList":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"visibility":{"type":"string","enum":["private","public"]},"ownerType":{"type":"string","enum":["user"]},"ownerName":{"type":"string"},"createdByUsername":{"type":"string","nullable":true},"itemCount":{"type":"number"},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"updatedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","description","visibility","ownerType","ownerName","createdByUsername","itemCount","createdAt","updatedAt"]},"V1SkillListListInput":{"type":"object","properties":{"username":{"type":"string","minLength":1}},"required":["username"]},"SkillListDetail":{"allOf":[{"$ref":"#/components/schemas/SkillList"},{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SkillListItem"}}},"required":["items"]}]},"SkillListItem":{"type":"object","properties":{"id":{"type":"string"},"skillId":{"type":"string"},"skillName":{"type":"string"},"skillDescription":{"type":"string","nullable":true},"namespace":{"type":"string"},"ownerName":{"type":"string"},"pinnedVersion":{"type":"string","nullable":true},"addedByUsername":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"position":{"type":"number"},"addedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","skillId","skillName","skillDescription","namespace","ownerName","pinnedVersion","addedByUsername","note","position","addedAt"]},"V1SkillListGetInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"listName":{"type":"string","minLength":1}},"required":["username","listName"]},"V1CheckSkillInListsInput":{"type":"object","properties":{"skillId":{"type":"string","minLength":1},"listIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1}},"required":["skillId","listIds"]},"V1SkillListCreateInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},"description":{"type":"string","maxLength":500},"visibility":{"type":"string","enum":["private","public"],"default":"private"}},"required":["username","name"]},"V1SkillListUpdateInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"listName":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9-]*$"},"description":{"type":"string","nullable":true,"maxLength":500},"visibility":{"type":"string","enum":["private","public"]}},"required":["username","listName"]},"V1SkillListDeleteInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"listName":{"type":"string","minLength":1}},"required":["username","listName"]},"V1SkillListAddItemInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"listName":{"type":"string","minLength":1},"skillId":{"type":"string","minLength":1},"versionId":{"type":"string"},"note":{"type":"string","maxLength":200}},"required":["username","listName","skillId"]},"V1SkillListRemoveItemInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"listName":{"type":"string","minLength":1},"itemId":{"type":"string","minLength":1}},"required":["username","listName","itemId"]},"MeResponseData":{"type":"object","nullable":true,"properties":{"userId":{"type":"string"},"username":{"type":"string"}},"required":["userId","username"],"description":"Current user info"},"ExploreResponse":{"type":"object","properties":{"skills":{"type":"array","items":{"$ref":"#/components/schemas/ExploreSkill"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"}},"required":["skills","total","page","limit","totalPages"],"description":"Paginated list of public skills for the marketplace"},"ExploreSkill":{"allOf":[{"$ref":"#/components/schemas/SkillWithUser"},{"type":"object","properties":{"totalDownloads":{"type":"number"},"namespace":{"type":"string","default":"user"},"userImage":{"type":"string","nullable":true,"default":null},"github":{"$ref":"#/components/schemas/GithubRepoInfo"}},"required":["totalDownloads"]}],"description":"Skill with download stats for explore/marketplace view"},"Visibility":{"type":"string","enum":["private","public"],"description":"Package visibility: private (owner only) or public (everyone)"},"GithubRepoInfo":{"type":"object","nullable":true,"properties":{"owner":{"type":"string"},"repo":{"type":"string"},"stars":{"type":"number"},"forks":{"type":"number"},"avatarUrl":{"type":"string","nullable":true},"htmlUrl":{"type":"string","nullable":true},"license":{"type":"string","nullable":true},"githubPath":{"type":"string","nullable":true}},"default":null,"required":["owner","repo","stars","forks","avatarUrl","htmlUrl","license","githubPath"],"description":"GitHub repository metadata for indexed skills"},"SkillWithUser":{"allOf":[{"$ref":"#/components/schemas/Skill"},{"type":"object","properties":{"username":{"type":"string"}},"required":["username"]}],"description":"Skill metadata with owner username"},"Skill":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"userId":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"visibility":{"$ref":"#/components/schemas/Visibility"}},"required":["id","name","userId","description","createdAt","updatedAt","visibility"],"description":"Skill metadata"},"SkillListResponse":{"type":"array","items":{"$ref":"#/components/schemas/SkillWithUser"},"description":"List of skills"},"V1ListUserSkillsInput":{"type":"object","properties":{"username":{"type":"string","minLength":1}},"required":["username"]},"SkillDetailResponse":{"allOf":[{"$ref":"#/components/schemas/SkillWithUser"},{"type":"object","nullable":true,"properties":{"skillMd":{"type":"string","nullable":true},"namespace":{"type":"string","default":"user"},"github":{"$ref":"#/components/schemas/GithubRepoInfo"},"userImage":{"type":"string","nullable":true,"default":null}},"required":["skillMd"]}],"description":"Skill metadata with SKILL.md content from latest version"},"V1SkillDetailInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["username","name"]},"SkillVersion":{"type":"object","properties":{"id":{"type":"string"},"skillId":{"type":"string"},"version":{"type":"string"},"r2Key":{"type":"string"},"checksum":{"type":"string"},"manifest":{"$ref":"#/components/schemas/SkillManifest"},"publishedAt":{"type":"string","nullable":true,"format":"date-time"},"deprecatedAt":{"type":"string","nullable":true,"format":"date-time"},"deprecationMessage":{"type":"string","nullable":true}},"required":["id","skillId","version","r2Key","checksum","manifest","publishedAt"],"description":"Skill version metadata"},"SkillManifest":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/SkillName"},"version":{"$ref":"#/components/schemas/Semver"},"description":{"type":"string","maxLength":500},"files":{"type":"array","items":{"type":"string"}},"pspm":{"$ref":"#/components/schemas/PspmMetadata"},"dependencies":{"type":"object","additionalProperties":{"type":"string"}},"encryption":{"$ref":"#/components/schemas/EncryptionMetadata"}},"required":["name","version"],"description":"Skill package manifest (package.json)"},"SkillName":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z][a-z0-9-]*$","description":"Skill name identifier","example":"my-skill"},"Semver":{"type":"string","description":"Semantic version string (e.g., 1.0.0)","example":"1.0.0"},"PspmMetadata":{"type":"object","properties":{"type":{"type":"string","enum":["skill"]},"capabilities":{"type":"array","items":{"type":"string"}},"requirements":{"type":"object","properties":{"claude":{"type":"string"},"node":{"type":"string"}}}},"required":["type"],"description":"PSPM-specific metadata for the skill package"},"EncryptionMetadata":{"type":"object","properties":{"algorithm":{"type":"string","enum":["aes-256-gcm"]},"kdf":{"type":"string","enum":["scrypt"]},"salt":{"type":"string"},"iv":{"type":"string"},"authTag":{"type":"string"},"scope":{"type":"string"}},"required":["algorithm","kdf","salt","iv","authTag","scope"],"description":"Client-side encryption metadata for private packages. The server stores this opaquely."},"V1ListVersionsInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["username","name"]},"SkillVersionWithDownload":{"allOf":[{"$ref":"#/components/schemas/SkillVersion"},{"type":"object","nullable":true,"properties":{"downloadUrl":{"type":"string"},"skillMd":{"type":"string","nullable":true}},"required":["downloadUrl"]}],"description":"Skill version metadata with download URL"},"V1GetVersionInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1}},"required":["username","name","version"]},"SkillStatsResponse":{"type":"object","properties":{"totalDownloads":{"type":"number"}},"required":["totalDownloads"],"description":"Download statistics for a skill package"},"V1SkillStatsInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["username","name"]},"PublishSkillResponse":{"type":"object","properties":{"skill":{"$ref":"#/components/schemas/SkillWithUser"},"version":{"$ref":"#/components/schemas/SkillVersion"}},"required":["skill","version"],"description":"Published skill with version info"},"PublishSkillInput":{"type":"object","properties":{"manifest":{"$ref":"#/components/schemas/SkillManifest"},"tarballBase64":{"type":"string","maxLength":14680064},"visibility":{"$ref":"#/components/schemas/Visibility"}},"required":["manifest","tarballBase64","visibility"],"description":"Input for publishing a skill"},"V1DeleteSkillInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["username","name"]},"V1DeleteVersionInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1}},"required":["username","name","version"]},"V1DeprecateVersionInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1},"message":{"type":"string","minLength":1,"maxLength":500}},"required":["username","name","version","message"]},"V1UndeprecateVersionInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1}},"required":["username","name","version"]},"ChangeAccessResponse":{"allOf":[{"$ref":"#/components/schemas/Skill"},{"type":"object","properties":{"username":{"type":"string"}},"required":["username"]}],"description":"Updated skill after changing visibility"},"V1ChangeAccessInput":{"type":"object","properties":{"username":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"visibility":{"$ref":"#/components/schemas/Visibility"}},"required":["username","name","visibility"]},"V1GithubRepoListInput":{"type":"object","properties":{"owner":{"type":"string","minLength":1},"repo":{"type":"string","minLength":1}},"required":["owner","repo"]},"V1GithubSkillDetailInput":{"type":"object","properties":{"owner":{"type":"string","minLength":1},"repo":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["owner","repo","name"]},"V1GithubListVersionsInput":{"type":"object","properties":{"owner":{"type":"string","minLength":1},"repo":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["owner","repo","name"]},"V1GithubGetVersionInput":{"type":"object","properties":{"owner":{"type":"string","minLength":1},"repo":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"version":{"type":"string","minLength":1}},"required":["owner","repo","name","version"]},"V1GithubSkillStatsInput":{"type":"object","properties":{"owner":{"type":"string","minLength":1},"repo":{"type":"string","minLength":1},"name":{"type":"string","minLength":1}},"required":["owner","repo","name"]},"ArtifactListPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Artifact"}},"nextCursor":{"type":"string","nullable":true}},"required":["items","nextCursor"],"description":"One page of artifacts. `nextCursor` is null when exhausted."},"Artifact":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"brainSessionId":{"type":"string"},"brainTurnId":{"type":"string"},"sessionTitle":{"type":"string","nullable":true},"skillId":{"type":"string","nullable":true},"kind":{"type":"string","enum":["slides","doc","sheet","image","file","web","static-site","html","markdown","text","code","json","csv","tsv","pptx","video"]},"viewer":{"type":"string","enum":["slides-pdf","doc-html","sheet-grid","image","file-download","web-iframe","static-site","html-preview","markdown-preview","text-preview","pptx-preview","video-preview"]},"payloadRef":{"type":"string"},"title":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"thumbnailUrl":{"type":"string","nullable":true},"threadSessionId":{"type":"string","nullable":true},"threadAgentKey":{"type":"string","nullable":true}},"required":["id","userId","brainSessionId","brainTurnId","sessionTitle","skillId","kind","viewer","payloadRef","title","metadata","createdAt"],"description":"A single artifact produced during a chat session."},"ArtifactCheckpointsResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Artifact"}}},"required":["items"],"description":"All artifacts in the checkpoint chain that contains the requested id, ordered by version ascending. Single-element list when there is no chain."},"ArtifactPayloadResponse":{"type":"object","properties":{"url":{"type":"string"},"kind":{"type":"string","enum":["slides","doc","sheet","image","file","web","static-site","html","markdown","text","code","json","csv","tsv","pptx","video"]},"variant":{"type":"string","enum":["original","thumbnail","download"],"default":"original"},"quality":{"type":"string","enum":["540","720","1080","preview","original"],"default":"original"},"maxQuality":{"type":"string","enum":["540","720","1080","preview","original"],"default":"original"},"downloadable":{"type":"boolean"}},"required":["url","kind","downloadable"]},"ArtifactRenditionsResponse":{"type":"object","properties":{"source":{"type":"object","properties":{"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true},"bytes":{"type":"integer","nullable":true}},"required":["width","height","bytes"]},"maxQuality":{"type":"string","enum":["540","720","1080","preview","original"]},"renditions":{"type":"array","items":{"$ref":"#/components/schemas/ArtifactRendition"}}},"required":["source","maxQuality","renditions"],"description":"The download ladder for one artifact under the caller's plan: which sizes exist, which are built, and which the plan includes."},"ArtifactRendition":{"type":"object","properties":{"quality":{"type":"string","enum":["540","720","1080","preview","original"]},"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true},"ready":{"type":"boolean"},"status":{"type":"string","nullable":true,"enum":["failed","too-large",null]},"allowed":{"type":"boolean"}},"required":["quality","width","height","ready","status","allowed"]},"ArtifactDownloadResponse":{"type":"object","properties":{"recorded":{"type":"boolean","enum":[true]}},"required":["recorded"],"description":"Confirmation that an explicit artifact download was recorded."},"ArtifactGetQuery":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"]},"CreateArtifactInput":{"type":"object","properties":{"id":{"type":"string","minLength":1},"brainSessionId":{"type":"string","minLength":1},"brainTurnId":{"type":"string","minLength":1},"sessionTitle":{"type":"string","nullable":true},"skillId":{"type":"string","nullable":true},"kind":{"type":"string","enum":["slides","doc","sheet","image","file","web","static-site","html","markdown","text","code","json","csv","tsv","pptx","video"]},"viewer":{"type":"string","enum":["slides-pdf","doc-html","sheet-grid","image","file-download","web-iframe","static-site","html-preview","markdown-preview","text-preview","pptx-preview","video-preview"]},"payloadRef":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":120},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"source":{"$ref":"#/components/schemas/ArtifactSource"}},"required":["id","brainSessionId","brainTurnId","sessionTitle","skillId","kind","viewer","payloadRef","title"],"description":"Brain → server ingest payload for a freshly produced artifact."},"ArtifactSource":{"type":"object","properties":{"kind":{"type":"string","enum":["media_job"]},"jobId":{"type":"string","minLength":1}},"required":["kind","jobId"],"description":"Where the artifact's bytes came from. A media_job source dedupes on a unique per-user sourceKey (content-guarded server-side)."},"RenameArtifactInput":{"type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":120}},"required":["id","title"]},"PatchArtifactSessionTitleResponse":{"type":"object","properties":{"updated":{"type":"integer","minimum":0}},"required":["updated"]},"PatchArtifactSessionTitleInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"sessionTitle":{"type":"string","nullable":true}},"required":["brainSessionId","sessionTitle"]},"ArtifactDeleteBySessionResponse":{"type":"object","properties":{"deletedCount":{"type":"integer","minimum":0},"r2KeysDeleted":{"type":"integer","minimum":0}},"required":["deletedCount","r2KeysDeleted"],"description":"Counts from a bulk session delete: artifact rows removed, and R2 objects reclaimed (best-effort)."},"ArtifactDeleteBySessionInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1}},"required":["brainSessionId"]},"FileCreateUploadResponse":{"type":"object","properties":{"id":{"type":"string","example":"file_01H..."},"key":{"type":"string"},"upload_url":{"type":"string","description":"Presigned PUT URL — upload the file bytes here directly."},"expires_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","key","upload_url","expires_at"]},"FileCreateUploadInput":{"type":"object","properties":{"filename":{"type":"string","minLength":1},"content_type":{"type":"string","minLength":1,"example":"image/png"},"size_bytes":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["filename","content_type","size_bytes"]},"FileResource":{"type":"object","properties":{"id":{"type":"string","example":"file_01H..."},"type":{"type":"string","enum":["file"]},"filename":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":0},"created_at":{"type":"string","nullable":true,"format":"date-time"},"preview_kind":{"type":"string","enum":["image","video","audio","pdf","markdown","text","code","json","csv","tsv","pptx","download"]},"preview_url":{"type":"string"},"thumbnail_url":{"type":"string"},"thumbnail_status":{"type":"string","enum":["pending","ready","unsupported","failed"]},"thumbnail_width":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"thumbnail_height":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"thumbnail_blurhash":{"type":"string","nullable":true}},"required":["id","type","filename","mime_type","size_bytes","created_at","preview_kind","preview_url","thumbnail_url","thumbnail_status","thumbnail_width","thumbnail_height","thumbnail_blurhash"]},"FileCompleteUploadInput":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"file_01H..."},"filename":{"type":"string","minLength":1},"content_type":{"type":"string","minLength":1,"example":"image/png"}},"required":["id","filename","content_type"]},"FileList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FileResource"}},"next_cursor":{"type":"string","nullable":true}},"required":["data"]},"FileContentResponse":{"type":"object","properties":{"download_url":{"type":"string"},"expires_at":{"type":"string","nullable":true,"format":"date-time"},"filename":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"integer","minimum":0}},"required":["download_url","expires_at","filename","mime_type","size_bytes"]},"FilesSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"FileFromAssetInput":{"type":"object","properties":{"asset_type":{"type":"string","enum":["drive","artifact"],"description":"Source store: a file in the user's AI-Drive, or a brain-produced artifact."},"asset_id":{"type":"string","minLength":1,"example":"art_01H..."}},"required":["asset_type","asset_id"]},"CreatePublicAssetUploadResult":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"url":{"type":"string"},"uploadUrl":{"type":"string"},"uploadUrlExpiresIn":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["id","key","url","uploadUrl","uploadUrlExpiresIn"]},"CreatePublicAssetUploadInput":{"type":"object","properties":{"contentType":{"type":"string","minLength":1,"maxLength":255,"description":"Media MIME type (image/video/audio). Page-renderable types (text/html, image/svg+xml, application/pdf, …) are rejected."},"filename":{"type":"string","minLength":1,"maxLength":512},"sizeBytes":{"type":"integer","minimum":0}},"required":["contentType"],"description":"Request a presigned PUT URL for uploading bytes to the public CDN bucket. Media content types only — active content (HTML, SVG, PDF) is rejected."},"PublicAssetListPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PublicAsset"}},"nextCursor":{"type":"string","nullable":true}},"required":["items","nextCursor"]},"PublicAsset":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"brainSessionId":{"type":"string","nullable":true},"key":{"type":"string"},"url":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"integer","nullable":true,"minimum":0},"sourceFileId":{"type":"string","nullable":true},"createdAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","userId","brainSessionId","key","url","contentType","sizeBytes","sourceFileId","createdAt"],"description":"A user-owned asset stored in the public-read R2 bucket and served via the Cloudflare custom domain (e.g. https://assets.adant.app/<key>)."},"DeletePublicAssetResult":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]},"DeletePublicAssetInput":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"]},"VoiceCatalogListResponse":{"type":"object","properties":{"voices":{"type":"array","items":{"$ref":"#/components/schemas/VoiceCatalogItem"}},"total":{"type":"integer","minimum":0},"facets":{"$ref":"#/components/schemas/VoiceCatalogFacets"}},"required":["voices","total","facets"]},"VoiceCatalogFacets":{"type":"object","properties":{"languages":{"type":"array","items":{"type":"string"}},"accents":{"type":"array","items":{"type":"string"}},"genders":{"type":"array","items":{"type":"string"}},"ages":{"type":"array","items":{"type":"string"}},"useCases":{"type":"array","items":{"type":"string"}},"traits":{"type":"array","items":{"type":"string"}}},"required":["languages","accents","genders","ages","useCases","traits"]},"V1ProductLookupInput":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048}},"required":["url"]},"V1ProductListResponse":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/V1ProductListItem"}}},"required":["products"]},"V1ProductListItem":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","nullable":true},"sourceUrl":{"type":"string","nullable":true},"imageCount":{"type":"integer"},"brandAssets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"$ref":"#/components/schemas/BrandAssetKind"},"alwaysOverlay":{"type":"boolean"}},"required":["id","label","kind","alwaysOverlay"]}},"updatedAt":{"type":"string"}},"required":["id","name","category","sourceUrl","imageCount","brandAssets","updatedAt"]},"V1ProductListInput":{"type":"object","properties":{}},"V1ProductCreateUploadResult":{"type":"object","properties":{"key":{"type":"string"},"uploadUrl":{"type":"string"},"uploadUrlExpiresIn":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["key","uploadUrl","uploadUrlExpiresIn"]},"V1ProductCreateUploadInput":{"type":"object","properties":{"purpose":{"type":"string","enum":["image","brandAsset"]},"contentType":{"type":"string","minLength":1,"maxLength":255},"filename":{"type":"string","minLength":1,"maxLength":512},"sizeBytes":{"type":"integer","minimum":0}},"required":["purpose","contentType"]},"V1ProductUpsertInput":{"type":"object","properties":{"productId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":120},"category":{"type":"string","nullable":true,"maxLength":120},"description":{"type":"string","nullable":true,"maxLength":5000},"sellingPoints":{"type":"array","items":{"type":"string","maxLength":500},"maxItems":10},"sourceUrl":{"type":"string","nullable":true,"minLength":1,"maxLength":2048},"brand":{"$ref":"#/components/schemas/ProductBrand"},"images":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":512},"mime":{"type":"string","minLength":1,"maxLength":255}},"required":["key","mime"]},"maxItems":12},"imageArtifactIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":12},"brandAssets":{"type":"array","items":{"$ref":"#/components/schemas/V1BrandAssetInput"},"maxItems":12},"brandAssetArtifacts":{"type":"array","items":{"$ref":"#/components/schemas/V1BrandAssetArtifactInput"},"maxItems":12}}},"V1BrandAssetInput":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":512},"mime":{"type":"string","minLength":1,"maxLength":255},"label":{"type":"string","minLength":1,"maxLength":80},"kind":{"$ref":"#/components/schemas/BrandAssetKind"},"alwaysOverlay":{"type":"boolean","default":false},"defaultPlacement":{"$ref":"#/components/schemas/OverlayPlacement"}},"required":["key","mime","label"]},"V1BrandAssetArtifactInput":{"type":"object","properties":{"artifactId":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","minLength":1,"maxLength":80},"kind":{"$ref":"#/components/schemas/BrandAssetKind"},"alwaysOverlay":{"type":"boolean","default":false},"defaultPlacement":{"$ref":"#/components/schemas/OverlayPlacement"}},"required":["artifactId","label"]},"V1BrandAssetSearchResponse":{"type":"object","properties":{"assets":{"type":"array","items":{"$ref":"#/components/schemas/V1BrandAssetHit"}}},"required":["assets"]},"V1BrandAssetHit":{"allOf":[{"$ref":"#/components/schemas/BrandAssetSummary"},{"type":"object","properties":{"productName":{"type":"string"}},"required":["productName"]}]},"V1BrandAssetSearchInput":{"type":"object","properties":{"query":{"type":"string","maxLength":120},"productId":{"type":"string","minLength":1},"alwaysOverlay":{"type":"boolean"},"limit":{"type":"integer","minimum":1,"maximum":100}}},"V1VideoOverlayCreateUploadResult":{"type":"object","properties":{"layerId":{"type":"string"},"key":{"type":"string"},"uploadUrl":{"type":"string"},"uploadUrlExpiresIn":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["layerId","key","uploadUrl","uploadUrlExpiresIn"]},"V1VideoOverlayCreateUploadInput":{"type":"object","properties":{"artifactId":{"type":"string","minLength":1,"maxLength":120},"contentType":{"type":"string","minLength":1,"maxLength":255},"layerId":{"type":"string","minLength":1,"maxLength":120}},"required":["artifactId","contentType"]},"V1VideoOverlayAttachInput":{"type":"object","properties":{"artifactId":{"type":"string","minLength":1,"maxLength":120},"plateArtifactId":{"type":"string","minLength":1,"maxLength":120},"width":{"type":"integer","minimum":0,"exclusiveMinimum":true},"height":{"type":"integer","minimum":0,"exclusiveMinimum":true},"layers":{"type":"array","items":{"$ref":"#/components/schemas/OverlayLayer"},"maxItems":24}},"required":["artifactId","plateArtifactId","width","height","layers"]},"V1AvatarSaveResponse":{"type":"object","properties":{"avatar":{"$ref":"#/components/schemas/AvatarSummary"},"created":{"type":"boolean"}},"required":["avatar","created"]},"V1AvatarSaveInput":{"type":"object","properties":{"imageArtifactId":{"type":"string","minLength":1,"maxLength":64,"description":"The caller's image artifact to file as the avatar picture (a generated character shot, or an uploaded photo saved as an artifact)."},"name":{"type":"string","minLength":1,"maxLength":120},"category":{"type":"string","enum":["ai_human","animation","tvc"],"default":"ai_human"},"appearance":{"$ref":"#/components/schemas/AvatarAppearance"}},"required":["imageArtifactId","name"]},"AvatarListInput":{"type":"object","properties":{"category":{"type":"string","enum":["ai_human","animation","tvc"],"description":"Optional avatar-category filter."},"limit":{"type":"integer","minimum":1,"maximum":40,"default":12,"description":"Maximum number of visible avatars to return. Selection is diverse and seed-rotated, not a `sortOrder` prefix."},"seed":{"type":"string","maxLength":200,"description":"Rotation seed (e.g. the session id) so repeat calls surface different faces."}}},"AvatarMatchResponse":{"type":"object","properties":{"matches":{"type":"array","items":{"$ref":"#/components/schemas/AvatarMatchItem"}},"rosterSize":{"type":"number"},"model":{"type":"string"}},"required":["matches","rosterSize","model"]},"AvatarMatchItem":{"allOf":[{"$ref":"#/components/schemas/AvatarListItem"},{"type":"object","properties":{"reason":{"type":"string","description":"Why this avatar fits the request (short casting rationale)."}},"required":["reason"]}]},"AvatarListItem":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ownerKind":{"type":"string","enum":["system","user"]},"category":{"type":"string","enum":["ai_human","animation","tvc"]},"imageUrl":{"type":"string"},"gender":{"type":"string","nullable":true,"enum":["female","male","non_binary","unspecified",null]},"age":{"type":"string","nullable":true},"ethnicity":{"type":"string","nullable":true},"outfit":{"type":"string","nullable":true},"details":{"type":"string","nullable":true},"behaviorPrompt":{"type":"string","nullable":true}},"required":["id","name","ownerKind","category","imageUrl","gender","age","ethnicity","outfit","details","behaviorPrompt"]},"AvatarMatchInput":{"type":"object","properties":{"request":{"type":"string","minLength":8,"maxLength":2000,"description":"The casting ask summarised in 1–3 sentences: product/niche, audience, ad format, and any stated casting constraints."},"category":{"type":"string","enum":["ai_human","animation","tvc"],"description":"Optional hard filter on avatar class."},"limit":{"type":"integer","minimum":1,"maximum":6,"default":6,"description":"Maximum number of ranked avatars to return."},"excludeIds":{"type":"array","items":{"type":"string"},"maxItems":60,"default":[],"description":"Avatar ids already shown this session; excluded so a repeat ask returns different faces."}},"required":["request"]},"TemplateListResponse":{"type":"object","properties":{"templates":{"type":"array","items":{"$ref":"#/components/schemas/TemplateListItem"}}},"required":["templates"]},"TemplateListItem":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ugc","animation","tvc"]},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"durationSeconds":{"type":"number","nullable":true},"aspectRatio":{"type":"string","nullable":true},"videoUrl":{"type":"string"},"posterUrl":{"type":"string","nullable":true},"productOrNiche":{"type":"string","nullable":true},"templateUseCase":{"type":"string","nullable":true}},"required":["id","slug","name","type","description","tags","durationSeconds","aspectRatio","videoUrl","posterUrl","productOrNiche","templateUseCase"]},"TemplateListInput":{"type":"object","properties":{"type":{"type":"string","enum":["ugc","animation","tvc"],"description":"Optional template-category filter."}}},"TemplateMatchResponse":{"type":"object","properties":{"matches":{"type":"array","items":{"$ref":"#/components/schemas/TemplateMatchItem"}},"model":{"type":"string"}},"required":["matches","model"]},"TemplateMatchItem":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"reason":{"type":"string"},"relevance":{"type":"integer","minimum":0,"maximum":100}},"required":["id","slug","name","reason","relevance"]},"TemplateMatchInput":{"type":"object","properties":{"request":{"type":"string","minLength":8,"maxLength":2000,"description":"The user's video ask summarised in 1–3 sentences (product/niche, use case, style, format)."}},"required":["request"]},"AssetRetrieveResponse":{"type":"object","properties":{"kind":{"type":"string","enum":["avatar","product","productImage","template","voice","brandAsset","strategy"]},"id":{"type":"string"},"name":{"type":"string"},"images":{"type":"array","items":{"$ref":"#/components/schemas/AssetRetrieveImage"}},"videos":{"type":"array","items":{"$ref":"#/components/schemas/AssetRetrieveImage"}},"audios":{"type":"array","items":{"$ref":"#/components/schemas/AssetRetrieveImage"}},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["kind","id","name","images","metadata"]},"AssetRetrieveImage":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"AssetRetrieveInput":{"type":"object","properties":{"kind":{"type":"string","enum":["avatar","product","productImage","template","voice","brandAsset","strategy"],"description":"Which mentioned asset kind to retrieve."},"id":{"type":"string","minLength":1,"example":"sysavatar_aiden_frost"}},"required":["kind","id"]},"PublicTierListResponse":{"type":"object","properties":{"tiers":{"type":"array","items":{"$ref":"#/components/schemas/PublicTier"}}},"required":["tiers"]},"PublicTier":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"blurb":{"type":"string","nullable":true},"isDefault":{"type":"boolean"},"requiresPlan":{"type":"string","nullable":true,"enum":["pro",null]},"available":{"type":"boolean"}},"required":["id","label","blurb","isDefault","requiresPlan","available"]},"MediaPlanPreflightResponse":{"type":"object","properties":{"planId":{"type":"string"},"creditUnit":{"type":"string","enum":["credits"]},"estimatedCredits":{"type":"number","minimum":0},"estimatedChargeCredits":{"type":"number","minimum":0},"requiredReservationCredits":{"type":"number","minimum":0},"availableCreditsBefore":{"type":"number","minimum":0},"remainingCreditsAfterReservation":{"type":"number","minimum":0},"items":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"jobId":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["image","video","audio"]},"model":{"type":"string"},"estimatedCredits":{"type":"number","minimum":0},"estimatedChargeCredits":{"type":"number","minimum":0},"requiredReservationCredits":{"type":"number","minimum":0},"motionFidelity":{"type":"string","enum":["approximate","exact"]}},"required":["itemId","jobId","kind","model","estimatedCredits","estimatedChargeCredits","requiredReservationCredits"]}}},"required":["planId","creditUnit","estimatedCredits","estimatedChargeCredits","requiredReservationCredits","availableCreditsBefore","remainingCreditsAfterReservation","items"]},"MediaPlanPreflightInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"brainTurnId":{"type":"string","minLength":1},"sessionTitle":{"type":"string","nullable":true},"skillId":{"type":"string","nullable":true},"planId":{"type":"string","minLength":1,"maxLength":200},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100},"jobId":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["image"]},"model":{"type":"string","minLength":1},"size":{"type":"string","pattern":"^\\d+x\\d+$"},"quality":{"type":"string","enum":["low","medium","high","xhigh","max","auto"]},"n":{"type":"integer","minimum":1,"maximum":4}},"required":["itemId","jobId","kind","model"]},{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100},"jobId":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["video"]},"model":{"type":"string","minLength":1},"resolution":{"type":"string","enum":["360p","480p","720p","1080p","2k","4k"]},"durationSeconds":{"type":"integer","minimum":1,"maximum":30},"motionFidelity":{"type":"string","enum":["approximate","exact"]}},"required":["itemId","jobId","kind","model"]},{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":100},"jobId":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","minLength":1,"maxLength":120},"kind":{"type":"string","enum":["audio"]},"model":{"type":"string","minLength":1},"characters":{"type":"integer","minimum":1,"maximum":8000}},"required":["itemId","jobId","kind","model","characters"]}]},"minItems":2,"maxItems":20}},"required":["brainSessionId","brainTurnId","planId","items"]},"MediaPlanForJobResponse":{"type":"object","properties":{"plan":{"type":"object","nullable":true,"properties":{"planId":{"type":"string"},"itemCount":{"type":"integer","minimum":0,"exclusiveMinimum":true},"estimatedChargeCredits":{"type":"number","minimum":0},"itemEstimatedChargeCredits":{"type":"number","minimum":0}},"required":["planId","itemCount","estimatedChargeCredits","itemEstimatedChargeCredits"]}},"required":["plan"]},"MediaPlanReleaseResponse":{"type":"object","properties":{"jobId":{"type":"string"},"kind":{"type":"string","nullable":true,"enum":["image","video","audio",null]},"releaseDisposition":{"type":"string","enum":["released","already_closed","submitted"]},"creditUnit":{"type":"string","enum":["credits"]},"reservedCredits":{"type":"number","minimum":0},"releasedCredits":{"type":"number","minimum":0}},"required":["jobId","kind","releaseDisposition","creditUnit","reservedCredits","releasedCredits"]},"MediaPlanReleaseInput":{"type":"object","properties":{"jobId":{"type":"string","minLength":1,"maxLength":200},"brainSessionId":{"type":"string","minLength":1}},"required":["jobId","brainSessionId"]},"MediaJobResponse":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed","canceled"]},"stage":{"type":"string","enum":["queued","dispatching","provider_processing","finalizing","completed","failed","canceled"]},"artifactId":{"type":"string","nullable":true},"artifactUrl":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"kind":{"type":"string","nullable":true,"enum":["image","video","audio",null]},"model":{"type":"string","nullable":true},"operation":{"type":"string","nullable":true,"enum":["image_generate","image_edit","video_generate","voice_generate",null]},"prompt":{"type":"string","nullable":true},"aspectRatio":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"error":{"type":"string","nullable":true},"creditUnit":{"type":"string","enum":["credits"]},"estimatedCredits":{"type":"number","nullable":true,"minimum":0},"reservedCredits":{"type":"number","nullable":true,"minimum":0},"finalCredits":{"type":"number","nullable":true,"minimum":0},"createdAt":{"type":"string","nullable":true,"format":"date-time"},"executionStartedAt":{"type":"string","nullable":true,"format":"date-time"},"completedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["jobId","status","artifactId","artifactUrl","error"]},"MediaImageGenerateInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"brainTurnId":{"type":"string","minLength":1},"sessionTitle":{"type":"string","nullable":true},"skillId":{"type":"string","nullable":true},"prompt":{"type":"string","minLength":1,"maxLength":4000},"size":{"type":"string","pattern":"^\\d+x\\d+$"},"quality":{"type":"string","enum":["low","medium","high","xhigh","max","auto"]},"n":{"type":"integer","minimum":1,"maximum":4},"format":{"type":"string","enum":["png","jpeg","webp"]},"background":{"type":"string","enum":["transparent","opaque","auto"]},"referenceImageUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":8},"referenceImageArtifactIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":8},"provider":{"type":"string","enum":["openai","gemini"]},"model":{"type":"string","enum":["nano-banana-pro","nano-banana-2","gpt-image-2","gpt-image-2.5-flare","gpt-image-2.5-sunburst"]},"title":{"type":"string","minLength":1,"maxLength":120},"preflightJobId":{"type":"string","minLength":1,"maxLength":200},"sceneIndex":{"type":"integer","minimum":1,"maximum":99},"sceneCount":{"type":"integer","minimum":1,"maximum":99}},"required":["brainSessionId","brainTurnId","prompt"]},"MediaImageEditInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"brainTurnId":{"type":"string","minLength":1},"sessionTitle":{"type":"string","nullable":true},"skillId":{"type":"string","nullable":true},"prompt":{"type":"string","minLength":1,"maxLength":4000},"imageArtifactIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":8},"imageUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":8},"maskArtifactId":{"type":"string","minLength":1},"maskUrl":{"type":"string","format":"uri"},"size":{"type":"string","pattern":"^\\d+x\\d+$"},"quality":{"type":"string","enum":["low","medium","high","xhigh","max","auto"]},"provider":{"type":"string","enum":["openai","gemini"]},"model":{"type":"string","enum":["nano-banana-pro","nano-banana-2","gpt-image-2","gpt-image-2.5-flare","gpt-image-2.5-sunburst"]},"title":{"type":"string","minLength":1,"maxLength":120},"preflightJobId":{"type":"string","minLength":1,"maxLength":200},"sceneIndex":{"type":"integer","minimum":1,"maximum":99},"sceneCount":{"type":"integer","minimum":1,"maximum":99}},"required":["brainSessionId","brainTurnId","prompt"]},"MediaVideoGenerateInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"brainTurnId":{"type":"string","minLength":1},"sessionTitle":{"type":"string","nullable":true},"skillId":{"type":"string","nullable":true},"prompt":{"type":"string","minLength":1},"firstFrameArtifactId":{"type":"string","minLength":1},"firstFrameUrl":{"type":"string","format":"uri"},"lastFrameUrl":{"type":"string","format":"uri"},"referenceImageArtifactIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":30},"referenceImageUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":30},"referenceVideoUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"motionFidelity":{"type":"string","enum":["approximate","exact"]},"referenceAudioUrls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"sourceVideoUrl":{"type":"string","format":"uri"},"generateAudio":{"type":"boolean"},"enableWebSearch":{"type":"boolean"},"aspectRatio":{"type":"string","enum":["16:9","9:16","4:3","3:4","1:1","21:9"]},"resolution":{"type":"string","enum":["360p","480p","720p","1080p","2k","4k"]},"negativePrompt":{"type":"string"},"model":{"type":"string","enum":["veo-3.1","gemini-omni-flash","seedance-2.5","seedance-2.5-i2v","seedance-2.0-fast","seedance-2.0","seedance-2.0-edit","kling-motion-3.0-std","kling-motion-3.0-pro","higgsfield-genjutsu-motion","topview-t1","topview-t1-i2v","minimax-h3","seedance-2.5-flash"]},"durationSeconds":{"type":"integer","minimum":1,"maximum":30},"motionVideoArtifactId":{"type":"string","minLength":1},"motionVideoUrl":{"type":"string","format":"uri"},"characterOrientation":{"type":"string","enum":["image","video"]},"keepOriginalSound":{"type":"boolean"},"templateId":{"type":"string","minLength":1,"maxLength":200},"qualityRepairOfJobId":{"type":"string","minLength":1,"maxLength":200},"qualityRepairReason":{"type":"string","minLength":10,"maxLength":1000},"qualityRepairKind":{"type":"string","enum":["audio_dialogue","brand_fidelity"]},"title":{"type":"string","minLength":1,"maxLength":120},"preflightJobId":{"type":"string","minLength":1,"maxLength":200},"sceneIndex":{"type":"integer","minimum":1,"maximum":99},"sceneCount":{"type":"integer","minimum":1,"maximum":99}},"required":["brainSessionId","brainTurnId","prompt"]},"MediaVideoAnalyzeResponse":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]},"MediaVideoAnalyzeInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"brainTurnId":{"type":"string","minLength":1},"sessionTitle":{"type":"string","nullable":true},"skillId":{"type":"string","nullable":true},"prompt":{"type":"string","minLength":1,"maxLength":8000},"videoArtifactId":{"type":"string","minLength":1},"videoUrl":{"type":"string","format":"uri"},"responseFormat":{"type":"string","enum":["text","json"]},"model":{"type":"string","minLength":1},"clip":{"type":"object","properties":{"startSeconds":{"type":"number","minimum":0},"endSeconds":{"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["startSeconds","endSeconds"]},"mediaResolution":{"type":"string","enum":["low","default"]}},"required":["brainSessionId","brainTurnId","prompt"]},"MediaVideoFrameResponse":{"type":"object","properties":{"artifactId":{"type":"string"},"timestampSeconds":{"type":"number"},"settled":{"type":"boolean"},"width":{"type":"integer"},"height":{"type":"integer"},"url":{"type":"string","nullable":true}},"required":["artifactId","timestampSeconds","settled","width","height","url"]},"MediaVideoFrameInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"brainTurnId":{"type":"string","minLength":1},"sessionTitle":{"type":"string","nullable":true},"skillId":{"type":"string","nullable":true},"videoArtifactId":{"type":"string","minLength":1},"videoUrl":{"type":"string","format":"uri"},"timestampSeconds":{"type":"number","minimum":0,"maximum":3600},"position":{"type":"string","enum":["last"]},"title":{"type":"string","minLength":1,"maxLength":120}},"required":["brainSessionId","brainTurnId"]},"MediaAudioGenerateInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"brainTurnId":{"type":"string","minLength":1},"sessionTitle":{"type":"string","nullable":true},"skillId":{"type":"string","nullable":true},"model":{"type":"string"},"text":{"type":"string","minLength":1,"maxLength":8000},"voiceDescription":{"type":"string","maxLength":1000},"voiceId":{"type":"string","maxLength":100},"speakerVoiceIds":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":4},"title":{"type":"string","minLength":1,"maxLength":120},"preflightJobId":{"type":"string","minLength":1,"maxLength":200}},"required":["brainSessionId","brainTurnId","text"]},"MediaJobListResponse":{"type":"object","properties":{"jobs":{"type":"array","items":{"$ref":"#/components/schemas/MediaJobResponse"}}},"required":["jobs"]},"MediaJobEventsResponse":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/MediaJobEvent"}},"nextSequence":{"type":"integer","minimum":0}},"required":["events","nextSequence"]},"MediaJobEvent":{"type":"object","properties":{"sequence":{"type":"integer","minimum":0},"jobId":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed","canceled"]},"stage":{"type":"string","enum":["queued","dispatching","provider_processing","finalizing","completed","failed","canceled"]},"artifactId":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"occurredAt":{"type":"string","format":"date-time"}},"required":["sequence","jobId","status","stage","artifactId","error","occurredAt"]},"MediaJobCancelResponse":{"allOf":[{"$ref":"#/components/schemas/MediaJobResponse"},{"type":"object","properties":{"cancellationDisposition":{"type":"string","enum":["refunded","continuing","settled","already_terminal"]},"providerMayContinue":{"type":"boolean"}},"required":["cancellationDisposition","providerMayContinue"]}]},"MediaJobCancelInput":{"type":"object","properties":{"id":{"type":"string","minLength":1},"brainSessionId":{"type":"string","minLength":1}},"required":["id","brainSessionId"]},"MediaModelsResponse":{"type":"object","properties":{"image":{"type":"array","items":{"$ref":"#/components/schemas/MediaModel"}},"video":{"type":"array","items":{"$ref":"#/components/schemas/MediaModel"}},"audio":{"type":"array","items":{"$ref":"#/components/schemas/MediaModel"}}},"required":["image","video","audio"]},"MediaModel":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["image","video","audio"]},"providerId":{"type":"string"},"modelString":{"type":"string"},"mode":{"type":"string"},"blurb":{"type":"string"},"default":{"type":"boolean"},"params":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"pricing":{"type":"object","additionalProperties":{"nullable":true}},"sampleCreditCost":{"type":"number"},"sampleRequiredReservationCredits":{"type":"number"}},"required":["id","label","kind","providerId","modelString","mode","params","pricing","sampleCreditCost","sampleRequiredReservationCredits"]},"MediaVideoClonePassResponse":{"type":"object","properties":{"pass":{"type":"string","enum":["narrative","structure","precise","look","shot_grammar","realism"]},"label":{"type":"string"},"format":{"type":"string","enum":["text","json"]},"fileName":{"type":"string"},"body":{"type":"string"},"jsonValid":{"type":"boolean"},"json":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["pass","label","format","fileName","body","json"]},"MediaVideoClonePassInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"brainTurnId":{"type":"string","minLength":1},"skillId":{"type":"string","nullable":true},"pass":{"type":"string","enum":["narrative","structure","precise","look","shot_grammar","realism"]},"videoUrl":{"type":"string","format":"uri"},"durationSeconds":{"type":"number","minimum":0,"maximum":36000,"default":0}},"required":["brainSessionId","brainTurnId","pass","videoUrl"]},"MediaVideoCloneDeriveResponse":{"type":"object","properties":{"shotLines":{"type":"object","nullable":true,"properties":{"fileName":{"type":"string"},"markdown":{"type":"string"}},"required":["fileName","markdown"]},"firstFrame":{"type":"object","nullable":true,"properties":{"fileName":{"type":"string"},"markdown":{"type":"string"}},"required":["fileName","markdown"]}},"required":["shotLines","firstFrame"]},"MediaVideoCloneDeriveInput":{"type":"object","properties":{"structure":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"look":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"shots":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"realism":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"precise":{"type":"string","nullable":true,"maxLength":1500000},"lookReference":{"type":"object","nullable":true,"properties":{"artifactId":{"type":"string"},"timestampSeconds":{"type":"number"},"settled":{"type":"boolean"},"width":{"type":"number"},"height":{"type":"number"},"sandboxPath":{"type":"string","nullable":true}},"required":["artifactId","timestampSeconds","settled"]},"lookReferenceError":{"type":"string","nullable":true,"maxLength":2000},"keepSourceGrade":{"type":"boolean","default":false}}},"MediaPromptCheckResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"message":{"type":"string"},"fix":{"type":"string"}},"required":["code","severity","message","fix"]}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]},"message":{"type":"string"},"fix":{"type":"string"}},"required":["code","severity","message","fix"]}},"measures":{"type":"object","properties":{"lines":{"type":"number"},"coverageSeconds":{"type":"number"},"timedBeats":{"type":"number"},"beatsPerSecond":{"type":"number"},"spokenWords":{"type":"number"},"wordsPerSecond":{"type":"number"},"speaking":{"type":"boolean"}},"required":["lines","coverageSeconds","timedBeats","beatsPerSecond","spokenWords","wordsPerSecond","speaking"]},"source":{"type":"object","properties":{"subscenes":{"type":"number","nullable":true},"actionsPerSecond":{"type":"number","nullable":true},"cutsPerSecond":{"type":"number","nullable":true}},"required":["subscenes","actionsPerSecond","cutsPerSecond"]}},"required":["ok","errors","warnings","measures","source"]},"MediaPromptCheckInput":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":60000},"durationSeconds":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":36000},"negativePrompt":{"type":"string","nullable":true,"maxLength":8000},"speaking":{"type":"boolean","nullable":true},"pace":{"type":"string","enum":["fast","match-source","slow-by-request"]},"shots":{"nullable":true},"precise":{"type":"string","nullable":true,"maxLength":1500000}},"required":["prompt","durationSeconds"]},"TitleGenerateResponse":{"type":"object","properties":{"title":{"type":"string"},"model":{"type":"string"}},"required":["title","model"]},"TitleGenerateInput":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1},"brainTurnId":{"type":"string","minLength":1},"content":{"type":"string","minLength":1,"maxLength":8000},"kind":{"type":"string","enum":["chat","task","agent"]}},"required":["brainSessionId","content"]},"ReportValidationError":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR"]},"error":{"type":"string","enum":["invalid_report"]},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"},"expected":{"type":"string"},"received":{"type":"string"}},"required":["path","message"]}},"outline":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","error","message","issues","outline"]},"ReportContext":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["social_content_research","social_content_strategy","reddit_listening","x_listening","social_listening","creator_collaboration"]},"layout":{"type":"string","enum":["research","strategy_brief","reddit_listening","x_listening","social_listening","creator_collaboration"]},"title":{"type":"string"},"url":{"type":"string"},"versionNo":{"type":"integer"},"reportDate":{"type":"string"},"product":{"type":"string"},"subtitle":{"type":"string"},"findings":{"type":"array","items":{"type":"string"}},"recommendation":{"type":"string"},"formats":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"name":{"type":"string"},"desc":{"type":"string"}},"required":["tag","name","desc"]}},"videos":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","instagram","youtube","meta-ads"]},"side":{"type":"string","nullable":true,"enum":["brand","creator",null]},"url":{"type":"string"},"handle":{"type":"string"},"metric":{"type":"string"},"format":{"type":"string"},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["platform","side","url","handle","metric","format","tier"]}},"ads":{"type":"array","items":{"type":"object","properties":{"advertiser":{"type":"string"},"adId":{"type":"string","nullable":true},"query":{"type":"string","nullable":true}},"required":["advertiser","adId","query"]}},"strategies":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"title":{"type":"string"},"platform":{"type":"string","nullable":true,"enum":["tiktok","instagram","youtube","meta-ads",null]},"handle":{"type":"string"},"url":{"type":"string"},"format":{"type":"string"},"metric":{"type":"string"},"whyThisVideo":{"type":"string"},"avatar":{"type":"string"},"keep":{"type":"string"},"change":{"type":"string"},"message":{"type":"string","description":"The card's creative brief (`analyze <url>` / `Recreate the video for <product>`, ending \", with different avatars\" when the source has someone on camera) — what a video built from this card runs through the clone route."},"pageUrl":{"type":"string"},"sourceTier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["index","title","platform","handle","url","format","metric","whyThisVideo","avatar","keep","change","message","pageUrl","sourceTier"]}},"videoUrls":{"type":"array","items":{"type":"string"}},"gaps":{"type":"array","items":{"type":"string"}},"creators":{"type":"object","properties":{"criteria":{"type":"object","properties":{"segment":{"type":"string","enum":["ugc","micro","influencer","all"]},"bands":{"type":"string","enum":["5k-50k","10k-100k"]},"targetCount":{"type":"integer","minimum":1,"maximum":100},"platforms":{"type":"array","items":{"type":"string","enum":["tiktok","instagram","youtube"]},"minItems":1,"maxItems":3},"niches":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"excludedKeywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"minFollowers":{"type":"integer","minimum":0},"maxFollowers":{"type":"integer","minimum":0},"locations":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"languages":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"minAverageViews":{"type":"integer","minimum":0},"minEngagementRate":{"type":"number","minimum":0,"maximum":100},"activeWithinDays":{"type":"integer","minimum":1,"maximum":365},"requireOutlier":{"type":"boolean"},"excludeCompetitorPartners":{"type":"boolean"}},"required":["segment","targetCount","platforms","niches","keywords","excludedKeywords","locations","languages","requireOutlier","excludeCompetitorPartners"]},"productUrl":{"type":"string","nullable":true,"maxLength":4096,"pattern":"^https:\\/\\//i"},"sourceReportId":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"scannedAt":{"type":"string","format":"date-time"},"competitors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":2000},"aliases":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"sourceUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"}},"required":["name","aliases","sourceUrl"]},"maxItems":30},"searched":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"candidatesReviewed":{"type":"integer","minimum":0},"coverage":{"type":"object","properties":{"reviewedAccountUrls":{"type":"array","items":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"maxItems":10000},"gaps":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":200}},"required":["reviewedAccountUrls","gaps"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"accounts":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"handle":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"url":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"avatarUrl":{"type":"string","nullable":true,"maxLength":4096,"pattern":"^https:\\/\\//i"},"avatarThumb":{"type":"string","nullable":true},"followers":{"type":"integer","nullable":true,"minimum":0},"postCount":{"type":"integer","nullable":true,"minimum":0},"bio":{"type":"string","maxLength":4000},"location":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"language":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"observedAt":{"type":"string","format":"date-time"}},"required":["platform","handle","name","url","avatarUrl","followers","bio","location","language","observedAt"]},"minItems":1,"maxItems":6},"primaryAccountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"fit":{"type":"string","minLength":1,"maxLength":2000},"suggestedCollaboration":{"type":"string","minLength":1,"maxLength":2000},"outreachDm":{"type":"string","minLength":1,"maxLength":600},"matchedCriteria":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"unverifiedCriteria":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"pastContent":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"accountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"url":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"caption":{"type":"string","maxLength":4000},"format":{"type":"string","enum":["video","image","carousel","unknown"]},"thumbnailUrl":{"type":"string","nullable":true,"maxLength":4096,"pattern":"^https:\\/\\//i"},"thumb":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true,"format":"date-time"},"observedAt":{"type":"string","format":"date-time"},"views":{"type":"integer","nullable":true,"minimum":0},"likes":{"type":"integer","nullable":true,"minimum":0},"comments":{"type":"integer","nullable":true,"minimum":0},"outlier":{"type":"string","enum":["outlier","reference","unverified"]},"whyRelevant":{"type":"string","maxLength":2000}},"required":["platform","accountUrl","url","caption","thumbnailUrl","postedAt","observedAt","views","likes","comments","outlier","whyRelevant"]},"maxItems":20},"collaborations":{"type":"array","items":{"type":"object","properties":{"brand":{"type":"string","minLength":1,"maxLength":2000},"relationship":{"type":"string","enum":["disclosed","affiliate","inferred","mention"]},"evidenceUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"evidence":{"type":"string","minLength":1,"maxLength":2000},"observedAt":{"type":"string","format":"date-time"},"competitor":{"type":"boolean"}},"required":["brand","relationship","evidenceUrl","evidence","observedAt","competitor"]},"maxItems":30},"collaborationCoverage":{"type":"string","enum":["reviewed","limited","unavailable"]},"identityEvidence":{"type":"array","items":{"type":"object","properties":{"accountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"matchedAccountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"basis":{"type":"string","enum":["profile_link","name_and_image"]},"explanation":{"type":"string","minLength":1,"maxLength":2000},"confidence":{"type":"string","enum":["confirmed","probable"]},"imageSimilarity":{"type":"number","minimum":0,"maximum":1}},"required":["accountUrl","matchedAccountUrl","basis","explanation","confidence"]},"maxItems":15}},"required":["id","name","accounts","primaryAccountUrl","fit","suggestedCollaboration","matchedCriteria","unverifiedCriteria","pastContent","collaborations","collaborationCoverage","identityEvidence"]},"maxItems":100}},"required":["criteria","productUrl","sourceReportId","scannedAt","competitors","searched","candidatesReviewed","items"]},"locked":{"$ref":"#/components/schemas/ProductReportLocked"},"notice":{"type":"string"}},"required":["id","kind","layout","title","url","versionNo","reportDate","product","subtitle","findings","recommendation","formats","videos","ads","strategies","videoUrls","gaps"]},"AdminRequeueReadyEmailsResult":{"type":"object","properties":{"requeued":{"type":"integer","minimum":0}},"required":["requeued"]},"AdminRequeueReadyEmailsInput":{"type":"object","properties":{"batchIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":500},"userIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":500},"since":{"type":"string","format":"date-time"},"includeFailed":{"type":"boolean"}}},"InternalUserProfile":{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"username":{"type":"string"},"image":{"type":"string","nullable":true},"memberSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["type","username","image","memberSince"]},"InternalGithubOwnerProfile":{"type":"object","properties":{"type":{"type":"string","enum":["github_owner"]},"owner":{"type":"string"},"avatarUrl":{"type":"string","nullable":true},"repos":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string"},"stars":{"type":"number"},"description":{"type":"string","nullable":true}},"required":["repo","stars","description"]}}},"required":["type","owner","avatarUrl","repos"]},"InternalGithubRepoProfile":{"type":"object","properties":{"type":{"type":"string","enum":["github_repo"]},"owner":{"type":"string"},"repo":{"type":"string"},"avatarUrl":{"type":"string","nullable":true},"htmlUrl":{"type":"string","nullable":true},"stars":{"type":"number"},"forks":{"type":"number"},"license":{"type":"string","nullable":true},"description":{"type":"string","nullable":true}},"required":["type","owner","repo","avatarUrl","htmlUrl","stars","forks","license","description"]},"Username":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[a-zA-Z0-9_-]+$","description":"User's username","example":"johndoe"},"InternalEmailPreferences":{"type":"object","properties":{"deliverableReady":{"type":"boolean"}},"required":["deliverableReady"]},"InternalAgentTeamRunClaim":{"type":"object","properties":{"action":{"type":"string","enum":["launch","open","park"]},"productUrl":{"type":"string","nullable":true},"brainSessionId":{"type":"string"}},"required":["action"]}},"parameters":{}},"paths":{"/errors/report":{"post":{"tags":["Errors"],"operationId":"reportErrors","summary":"Report client errors","description":"Submit client-side errors for logging and monitoring. Used by the frontend error capture service.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorReportPayload"}}}},"responses":{"200":{"description":"Errors reported successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/users":{"get":{"tags":["Admin"],"operationId":"adminListUsers","summary":"List users","description":"List active, suspended, or all users with pagination, search, and account/session filters (admin only)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["all","unbanned","banned"],"default":"unbanned"},"required":false,"name":"access","in":"query"},{"schema":{"type":"string","enum":["user","internal","admin"]},"required":false,"name":"role","in":"query"},{"schema":{"type":"string","enum":["free","basic","standard","pro","max","enterprise","trial"]},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","enum":["active","month","year","canceling"]},"required":false,"name":"subscription","in":"query"},{"schema":{"type":"string","enum":["today","7d","30d","inactive"]},"required":false,"name":"activity","in":"query"},{"schema":{"type":"string","enum":["7d","30d","90d"]},"required":false,"name":"joined","in":"query"},{"schema":{"type":"string","enum":["0","1","2","3plus"]},"required":false,"name":"sessionCount","in":"query"},{"schema":{"type":"string","enum":["name","email","role","tier","credits","createdAt"],"default":"createdAt"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"order","in":"query"}],"responses":{"200":{"description":"Successfully retrieved user list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/users/{id}/usage":{"get":{"tags":["Admin"],"operationId":"adminGetUserUsage","summary":"Get a user's spend usage breakdown","description":"Per-user subscription status and scheduled cancellation date, plus spend (settled credit charges) over 1/3/7/30-day and all-time windows and by-day / media-type / session / model breakdowns for the requested window (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["1d","3d","7d","30d","all"],"default":"30d"},"required":false,"name":"window","in":"query"}],"responses":{"200":{"description":"Successfully retrieved user usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserUsage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/users/{id}/credit-history":{"get":{"tags":["Admin"],"operationId":"adminGetUserCreditHistory","summary":"Get a user's credit history","description":"Return the raw grant, reserve, charge, release, and refund ledger for one user, plus aggregate balances (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Successfully retrieved user credit history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserCreditHistory"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/usage":{"get":{"tags":["Admin"],"operationId":"adminGetSystemUsage","summary":"Get system-wide spend overview","description":"System-wide spend for a selected account audience over 1/3/7/30-day and all-time windows, plus by-day / model / media-type / user-type / top-user breakdowns for the requested window (admin only).","parameters":[{"schema":{"type":"string","enum":["1d","3d","7d","30d","all"],"default":"30d"},"required":false,"name":"window","in":"query"},{"schema":{"type":"string","enum":["all","internal","admin","free","basic","standard","pro","max","enterprise","suspended"],"default":"all"},"required":false,"name":"audience","in":"query"}],"responses":{"200":{"description":"Successfully retrieved system usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSystemUsage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/stats":{"get":{"tags":["Admin"],"operationId":"adminGetStats","summary":"Get admin stats","description":"Get aggregate user statistics, including live subscription, yearly subscription, and scheduled-cancellation counts (admin only)","responses":{"200":{"description":"Successfully retrieved stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminStats"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/session-count-stats":{"get":{"tags":["Admin"],"operationId":"adminGetSessionCountStats","summary":"Get user chat-session count buckets","description":"Count active user accounts with 0, 1, 2, or 3+ all-time chat sessions (admin only)","responses":{"200":{"description":"Successfully retrieved chat-session count buckets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSessionCountStats"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/growth":{"get":{"tags":["Admin"],"operationId":"adminGetGrowthMetrics","summary":"Get product growth metrics","description":"Get rolling active-user windows, acquisition, activation, returning-user, stickiness, and cohort-retention metrics (admin only).","responses":{"200":{"description":"Successfully retrieved product growth metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminGrowthMetrics"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/registration-policy":{"get":{"tags":["Admin"],"operationId":"adminGetRegistrationPolicy","summary":"Get the account-registration policy","description":"Get registration switches and blocked email domains (admin only).","responses":{"200":{"description":"Registration policy retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRegistrationPolicy"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Admin"],"operationId":"adminUpdateRegistrationPolicy","summary":"Update the account-registration policy","description":"Enable or pause new email/password registrations, Google registrations, Turnstile protection, or Sentinel enforcement (admin only).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAdminRegistrationPolicyInput"}}}},"responses":{"200":{"description":"Registration policy updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRegistrationPolicy"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/registration-policy/blocked-domains":{"post":{"tags":["Admin"],"operationId":"adminBlockEmailDomain","summary":"Block an email domain","description":"Block future registrations from an email domain and optionally suspend existing non-admin accounts from it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminBlockEmailDomainInput"}}}},"responses":{"200":{"description":"Domain blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminBlockEmailDomainResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/registration-policy/blocked-domains/{domain}":{"delete":{"tags":["Admin"],"operationId":"adminUnblockEmailDomain","summary":"Unblock an email domain","description":"Allow future registrations from an email domain. Existing suspensions are preserved for audit and manual review.","parameters":[{"schema":{"type":"string"},"required":true,"name":"domain","in":"path"}],"responses":{"200":{"description":"Domain unblocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRegistrationPolicy"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/referral-program":{"get":{"tags":["Admin"],"operationId":"adminGetReferralProgram","summary":"Get referral program configuration","responses":{"200":{"description":"Referral program configuration retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReferralProgram"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Admin"],"operationId":"adminUpdateReferralProgram","summary":"Update referral program configuration","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAdminReferralProgramInput"}}}},"responses":{"200":{"description":"Referral program configuration updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReferralProgram"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/credit-reviews":{"get":{"tags":["Admin"],"operationId":"listCreditReviews","summary":"List promotional credit claims awaiting or completing review","parameters":[{"schema":{"type":"string","enum":["pending","released","rejected"],"default":"pending"},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"}],"responses":{"200":{"description":"Credit reviews","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"amountCredits":{"type":"number"},"reasons":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["pending","approved","rejected","released"]},"createdAt":{"type":"string"},"reviewedBy":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"reviewNote":{"type":"string","nullable":true}},"required":["id","userId","email","name","kind","amountCredits","reasons","status","createdAt","reviewedBy","reviewedAt","reviewNote"]}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["items","total","page","limit"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/credit-reviews/{id}/decision":{"post":{"tags":["Admin"],"operationId":"decideCreditReview","summary":"Approve or reject a held promotional grant with an audit note","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"]},"note":{"type":"string","minLength":1,"maxLength":2000}},"required":["decision","note"]}}}},"responses":{"200":{"description":"Review recorded","content":{"application/json":{"schema":{"type":"object","properties":{"released":{"type":"boolean"}},"required":["released"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/openrouter/supplier-cost":{"get":{"tags":["Admin"],"operationId":"adminGetOpenRouterSupplierCost","summary":"Get OpenRouter supplier cost split","description":"A month of OpenRouter supplier cost from turn settle metadata: BYOK upstream charges per account, OpenRouter's BYOK fee, and OpenRouter credits (admin only).","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"required":false,"name":"month","in":"query"}],"responses":{"200":{"description":"The month's supplier cost split","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOpenRouterSupplierCost"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/media-jobs/supplier-margin":{"get":{"tags":["Admin"],"operationId":"adminGetMediaSupplierMargin","summary":"Get media credits charged against supplier cost","description":"Per provider and per catalog model, the credits media jobs were charged against what the serving provider charged us, for a UTC date range of at most 366 days (admin only).","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"The range's charge and supplier cost","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMediaSupplierMargin"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/users/{id}/credits":{"post":{"tags":["Admin"],"operationId":"adminGrantCredits","summary":"Reward credits to a user","description":"Reward credits to a user's balance (admin only). The grant is recorded in the user's credit history as an admin grant.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminGrantCreditsInput"}}}},"responses":{"200":{"description":"Credits granted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminGrantCreditsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/users/{id}/role":{"patch":{"tags":["Admin"],"operationId":"adminUpdateUserRole","summary":"Update user role","description":"Update a user's role (admin only)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRoleInput"}}}},"responses":{"200":{"description":"User role updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRoleResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/users/{id}/ban":{"patch":{"tags":["Admin"],"operationId":"adminSetUserBan","summary":"Suspend or restore a user account","description":"Suspend a user indefinitely and revoke active sessions, or restore access (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSetUserBanInput"}}}},"responses":{"200":{"description":"Account suspension state updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSetUserBanResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/users/{id}":{"delete":{"tags":["Admin"],"operationId":"adminDeleteUser","summary":"Permanently delete a user account","description":"Permanently delete a user and their account-owned data (admin only). Admins cannot delete their own account from this endpoint.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"User account deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteUserResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/users/{id}/tier":{"patch":{"tags":["Admin"],"operationId":"adminSetUserTier","summary":"Set user tier","description":"Set or clear a user's manual tier override for direct-sales / contracted accounts (admin only). `enterprise` provisions the account off-Stripe; `free` clears the override.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSetUserTierInput"}}}},"responses":{"200":{"description":"User tier updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSetUserTierResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/media-jobs":{"get":{"tags":["Admin"],"operationId":"adminListMediaJobs","summary":"List media-generation jobs","description":"List media-generation jobs across all users with status/kind/user filters, search, sort, and pagination (admin only).","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["running","completed","failed","canceled"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["image","audio","video"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string"},"required":false,"name":"userId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"downloaded","in":"query"},{"schema":{"type":"string","enum":["createdAt","status","kind"],"default":"createdAt"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"order","in":"query"}],"responses":{"200":{"description":"Successfully retrieved media jobs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMediaJobsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/media-jobs/stats":{"get":{"tags":["Admin"],"operationId":"adminGetMediaJobStats","summary":"Get media-generation job counts by status","description":"Counts of media-generation jobs grouped by status (running / completed / failed / canceled) across all users (admin only).","responses":{"200":{"description":"Successfully retrieved media job stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMediaJobStats"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/artifacts":{"get":{"tags":["Admin"],"operationId":"adminListArtifacts","summary":"List artifacts","description":"List artifacts across all users with kind/user filters (including derived audio), search, sort, and pagination (admin only).","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":48},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["audio","image","video","file","slides","doc","sheet","web","static-site","html","markdown","text","code","json","csv","tsv","pptx"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string"},"required":false,"name":"userId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["createdAt","kind"],"default":"createdAt"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"order","in":"query"}],"responses":{"200":{"description":"Successfully retrieved artifacts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminArtifactsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/artifacts/{id}/payload":{"get":{"tags":["Admin"],"operationId":"adminGetArtifactPayload","summary":"Resolve an artifact's preview URL","description":"Resolve preview metadata and presigned URLs for any user's artifact bytes; every stored artifact receives a named attachment URL and browser-previewable content also receives an inline URL (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Successfully resolved artifact payload URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminArtifactPayloadResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/wavespeed/balance":{"get":{"tags":["Admin"],"operationId":"adminGetWavespeedBalance","summary":"Get WaveSpeed account balance","description":"Get the WaveSpeed account's remaining balance in USD (admin only).","responses":{"200":{"description":"Successfully retrieved WaveSpeed balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWavespeedBalance"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/wavespeed/usage":{"get":{"tags":["Admin"],"operationId":"adminGetWavespeedUsage","summary":"Get WaveSpeed usage stats","description":"Get WaveSpeed usage stats over the last N days (default 30, max 31) — per-model breakdown, daily usage, and a summary (admin only).","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":31,"default":30},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Successfully retrieved WaveSpeed usage stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWavespeedUsage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/wavespeed/billings":{"get":{"tags":["Admin"],"operationId":"adminGetWavespeedBillings","summary":"Get WaveSpeed billing records","description":"Get paginated WaveSpeed billing records (admin only).","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["created_at ASC","created_at DESC"],"default":"created_at DESC"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"Successfully retrieved WaveSpeed billing records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminWavespeedBillings"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/fal/account":{"get":{"tags":["Admin"],"operationId":"adminGetFalAccount","summary":"Get fal account billing information","description":"Get the fal account identity and remaining credit balance through the Platform API (admin only).","responses":{"200":{"description":"Successfully retrieved fal account information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminFalAccount"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/fal/usage":{"get":{"tags":["Admin"],"operationId":"adminGetFalUsage","summary":"Get fal model usage","description":"Get fal model usage and billed cost over the last N days (default 30, max 90), grouped by endpoint and day (admin only).","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":90,"default":30},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Successfully retrieved fal model usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminFalUsage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/byteplus/billing":{"get":{"tags":["Admin"],"operationId":"adminGetByteplusBilling","summary":"Get BytePlus account billing","description":"Get the BytePlus account bill overview, daily spend, and paginated bill details for one month through the signed Billing OpenAPI (admin only).","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"required":false,"name":"period","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"pageSize","in":"query"}],"responses":{"200":{"description":"Successfully retrieved BytePlus billing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminByteplusBilling"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/promotions":{"get":{"tags":["Admin"],"operationId":"adminListPromotions","summary":"List promotion codes","description":"List first-month promotion codes with redemption counts and remaining caps (admin only). Monthly checkout discounts the first invoice; 100%-off codes also delay yearly billing by one month. Returns `configured: false` when Stripe isn't configured.","responses":{"200":{"description":"Successfully retrieved promotion codes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPromotionsListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Admin"],"operationId":"adminCreatePromotion","summary":"Create a promotion code","description":"Create a 50%, 70%, 90%, or 100%-off first-month promotion code capped to `maxRedemptions` customers (admin only). Partial discounts apply to monthly Pro; 100%-off codes also delay yearly Pro billing by one month.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreatePromotionInput"}}}},"responses":{"201":{"description":"Promotion code created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPromotion"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/promotions/{id}":{"get":{"tags":["Admin"],"operationId":"adminGetPromotion","summary":"Get a promotion code with its redemptions","description":"A single promotion code plus the users who redeemed it (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Successfully retrieved promotion detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPromotionDetailResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Admin"],"operationId":"adminUpdatePromotion","summary":"Pause or resume a promotion code","description":"Set a promotion code active (resume) or inactive (pause) (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdatePromotionInput"}}}},"responses":{"200":{"description":"Promotion code updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPromotion"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/credit-discounts":{"get":{"tags":["Admin"],"operationId":"adminListCreditDiscounts","summary":"List global and per-model credit discounts","responses":{"200":{"description":"Current credit promotion configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditDiscountConfig"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/credit-discounts/global":{"put":{"tags":["Admin"],"operationId":"adminUpdateGlobalCreditDiscount","summary":"Set the global credit discount","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditDiscountInput"}}}},"responses":{"200":{"description":"Updated credit promotion configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditDiscountConfig"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/credit-discounts/models/{modelId}":{"put":{"tags":["Admin"],"operationId":"adminUpdateModelCreditDiscount","summary":"Set a per-model credit discount override","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256},"required":true,"name":"modelId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditDiscountInput"}}}},"responses":{"200":{"description":"Updated model credit discount","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditDiscountModel"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Admin"],"operationId":"adminDeleteModelCreditDiscount","summary":"Remove a per-model override","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256},"required":true,"name":"modelId","in":"path"}],"responses":{"200":{"description":"Model now inherits the global discount","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteCreditDiscountResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/insights/subscriptions":{"get":{"tags":["Admin"],"operationId":"adminListRecentSubscriptions","summary":"New subscriptions and why each most likely happened","description":"Subscriptions started in the last `days` UTC days (default 30), newest first, with the account, plan, and a reason: the surface the web recorded when it opened the plans, or else the account's videos, downloads and reports in the day before paying (admin only). Suspended accounts are excluded.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":90},"required":false,"name":"days","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Recent subscriptions with reasons","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRecentSubscriptions"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/insights/free-trial":{"get":{"tags":["Admin"],"operationId":"adminGetFreeTrialExperiment","summary":"The free-trial A/B test: signup to paid, trial vs control","description":"Customer accounts that signed up since the `free-trial` flag last changed, split into the arm the flag's percentage bucket dealt them (targeted, staff and suspended accounts excluded), with each arm's signup credits, trials, and paid conversions (admin only).","responses":{"200":{"description":"The experiment's two arms","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminFreeTrialExperiment"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/insights/signup-credits":{"get":{"tags":["Admin"],"operationId":"adminGetSignupCreditsExperiment","summary":"The signup-credits A/B test: 10 signup credits vs none","description":"Customer accounts that signed up since the `signup-credits-ab` flag last changed, split into the arm the flag's percentage bucket dealt them (targeted, staff and suspended accounts excluded), with each arm's paid conversions, signup credits granted and used, and their vendor cost (admin only).","responses":{"200":{"description":"The experiment's two arms","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSignupCreditsExperiment"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/insights/ai-tool-free-run":{"get":{"tags":["Admin"],"operationId":"adminGetFreeRunExperiment","summary":"The AI tool pages' free run: cost against paid conversion","description":"Every account the `ai-tool-free-run` flag assigned an arm at an AI tool page's Checkout step, read live: per arm, the free-run credits granted, spent and expired, their vendor cost, the accounts that paid (at any time and within 14 days), first-month revenue, and whether the free run is paying for itself (admin only).","responses":{"200":{"description":"The free run's arms, cost and conversions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminFreeRunExperiment"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/insights/acquisition-pages":{"get":{"tags":["Admin"],"operationId":"adminGetAcquisitionPages","summary":"Which new pages bring traffic, sign-ups and paid customers","description":"Over the last `days` UTC days (7, 30 or 90; default 30): person landings on each tracked adant.ai page, customer accounts created in the window grouped by the page they first landed on, and how many of those have paid since (admin only). Staff and suspended accounts are excluded; accounts with no landing recorded count as `unrecorded`.","parameters":[{"schema":{"type":"number"},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Traffic, sign-ups and paid customers by page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAcquisitionPages"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/insights/yearly-offers":{"get":{"tags":["Admin"],"operationId":"adminGetYearlyOffers","summary":"The monthly-to-yearly offers' funnel","description":"Over the last `days` UTC days (default 30), per offer (first month credited, yearly at half price) and surface (month-one banner, cancel dialog): account-days that saw, dismissed and accepted it, and the switch invoices paid after an accept (admin only).","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":365},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Impressions, dismissals, accepts and conversions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminYearlyOfferFunnel"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/insights/cancellations":{"get":{"tags":["Admin"],"operationId":"adminGetCancellationInsights","summary":"Why paying customers cancel, and how many the save offer keeps","description":"Cancel attempts in the last `days` UTC days (7, 30 or 90; default 30) from the cancel survey and the Stripe webhook: outcomes (pending, saved, canceled, resumed), save-offer acceptance, reason and feature-group counts, plan and interval splits, Stripe's reasons for cancels that skipped the survey, and the newest `limit` rows with the account, comment, tenure and credits spent in the 30 days before the attempt (admin only).","parameters":[{"schema":{"type":"number"},"required":false,"name":"days","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Cancellation reasons and outcomes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCancellationInsights"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/insights/plugins":{"get":{"tags":["Admin"],"operationId":"adminGetPluginUsage","summary":"Claude and ChatGPT plugin usage, sign-ups and credits","description":"Over the last `days` UTC days (1, 7, 30 or 90; default 7), per plugin host (Claude, ChatGPT, other) and surface: customer accounts that connected, made tool calls and spent credits through the public MCP endpoint, counting both work a plugin started and finished agent runs from elsewhere it delivered (a saved report read through it); sign-ups created inside the plugin's OAuth connect or after landing on its page, and how many paid; top tools with failures; a daily series; and the latest 25 calls (admin only). Staff and suspended accounts are excluded.","parameters":[{"schema":{"type":"number"},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Plugin usage by host","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPluginUsage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/insights/ads":{"get":{"tags":["Admin"],"operationId":"adminGetAdsTracking","summary":"Google and Meta advertising funnel performance (admin only)","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"Read-only provider reports with independent connection status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAdsTrackingReport"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/ai-tools/free-run":{"get":{"operationId":"getAiToolFreeRunStatus","tags":["ai-tools"],"summary":"The AI tool pages' free run: mode and the caller's own","description":"Public. Without a session, only `mode`; with one, also the account's own free run once it has had one.","responses":{"200":{"description":"The free run's mode and the caller's claim","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiToolFreeRunStatus"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"claimAiToolFreeRun","tags":["ai-tools"],"summary":"Claim the account's one free run on an AI tool page","description":"Called by a tool page at the press that would open Checkout. Once per canonical mailbox, while the `ai-tool-free-run` flag is live, for a verified account that never had credits or a plan; grants the page's own price + 20% as free credits (expiring with every free grant, 30 days). 401 without a session; 400 for a page outside the AI tool, model and comparison pages.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimAiToolFreeRun"}}}},"responses":{"200":{"description":"What the claim did","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiToolFreeRunClaim"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/voice/listen":{"post":{"operationId":"openVoiceListenSession","tags":["voice"],"summary":"A one-use speech recogniser session for one dictated message","description":"Signed in or not. Soniox when the server has its key, else OpenAI's real-time transcription. The browser streams the microphone straight to the recogniser with the returned key; audio never reaches AdAnt's server. 204 when the server has no recogniser or the caller has used its allowance (signed in: 20 keys a minute, 300 a day per account; signed out: 6 a minute, 40 a day per client address, 30 a minute and 1,500 a day for all signed-out visitors together; none for a banned account): the browser's own speech recognition is used instead.","responses":{"200":{"description":"A listen session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceListenSession"}}}},"204":{"description":"No recogniser on this server"},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/voice/transcribe":{"post":{"operationId":"transcribeVoiceTake","tags":["voice"],"summary":"Write down one dictated take, in any language or a mix of them","description":"For a take the browser's own recogniser heard (no listen session), which hears one language at a time. The body is the take as a 16 kHz mono 16-bit PCM WAV, at most 90 seconds; it passes through to the transcription model and is not kept. Counts against the same allowance as listen sessions. 204 when the server has no transcriber, the body isn't such a WAV, the caller has used its allowance, or the transcriber is unavailable: the browser keeps its own recogniser's words.","parameters":[{"schema":{"type":"string","description":"Up to four likely language tags, best first, comma-separated (\"zh-CN,en-US\"); a hint only, and the first Chinese one sets Simplified or Traditional characters."},"required":false,"description":"Up to four likely language tags, best first, comma-separated (\"zh-CN,en-US\"); a hint only, and the first Chinese one sets Simplified or Traditional characters.","name":"languages","in":"query"}],"requestBody":{"required":true,"content":{"audio/wav":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"The take's words","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTranscript"}}}},"204":{"description":"Not transcribed; the browser's words stand"},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Longer than 90 seconds"},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/agents":{"get":{"tags":["Agents"],"operationId":"listAgents","responses":{"200":{"description":"Agents visible to the requester","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Agents"],"operationId":"createAgent","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentInput"}}}},"responses":{"200":{"description":"Created agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/agents/{id}":{"get":{"tags":["Agents"],"operationId":"getAgent","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Agent record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Agents"],"operationId":"updateAgent","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentInput"}}}},"responses":{"200":{"description":"Updated agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Agents"],"operationId":"deleteAgent","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/ai-traffic/stats":{"get":{"tags":["AiTraffic"],"operationId":"getAiTrafficStats","summary":"AI-agent traffic stats","description":"Aggregated AI crawler / AI referral traffic metrics (admin only)","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":90,"default":30},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Aggregated AI traffic stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiTrafficStatsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/page-attribution/signup-landing":{"post":{"operationId":"claimSignupLanding","tags":["page-attribution"],"summary":"Record the page a new account first landed on","description":"Called by Studio once a visitor is signed in, with the first adant.ai page their browser opened. Counts only for an account created within the last day; the first claim wins and nothing else changes. 401 without a session.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimSignupLanding"}}}},"responses":{"200":{"description":"What the claim did","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimSignupLandingResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/page-attribution/action":{"post":{"operationId":"reportPageAction","tags":["page-attribution"],"summary":"Count an action on an AI tool or AI model page","description":"Public and anonymous: adds one to the day's counter for this page and action. Nothing about the visitor is stored. Requests that do not look like a person's browser, or name a page outside the AI tool and AI model pages, are accepted and ignored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportPageAction"}}}},"responses":{"204":{"description":"Counted, or ignored"},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/share-links/stats":{"get":{"tags":["ShareLinks"],"operationId":"getShareLinkStats","summary":"Share-link click stats","description":"Clicks on promoters' short links, per handle (admin only)","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":90,"default":30},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Share-link click stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareLinkStatsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/auth/registration-policy":{"get":{"tags":["Auth"],"operationId":"getRegistrationPolicy","summary":"Get the public registration policy","description":"Report which account-creation methods are available and the public Turnstile site key used to protect signup.","responses":{"200":{"description":"Registration policy retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationPolicy"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/auth/username":{"get":{"tags":["Auth"],"operationId":"getUsernameInfo","summary":"Get username info","description":"Get current user's username and whether it has been set","responses":{"200":{"description":"Username info retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsernameInfo"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["Auth"],"operationId":"setUsername","summary":"Set username (one-time)","description":"Set the current user's username. This is a one-time operation - username cannot be changed after being set (npm-style).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUsernameInput"}}}},"responses":{"200":{"description":"Username update result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUsernameOutput"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/auth/username/check":{"get":{"tags":["Auth"],"operationId":"checkUsernameAvailability","summary":"Check username availability","description":"Check if a username is available for use. This endpoint is public and can be called during signup.","parameters":[{"schema":{"type":"string","minLength":3,"maxLength":39},"required":true,"name":"username","in":"query"}],"responses":{"200":{"description":"Username availability check result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckUsernameOutput"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/auth/username/suggestions":{"get":{"tags":["Auth"],"operationId":"getUsernameSuggestions","summary":"Get username suggestions","description":"Get available username suggestions based on user's email and name","responses":{"200":{"description":"Username suggestions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSuggestionsOutput"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/auth/prefs/auto-mode":{"get":{"tags":["Auth"],"operationId":"getAutoModePref","summary":"Get auto-mode preference","description":"Get the current user's Studio auto-mode (media-generation confirmation) preference. Null = never set — the client falls back to its local default (ON).","responses":{"200":{"description":"Auto-mode preference retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoModePref"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["Auth"],"operationId":"setAutoModePref","summary":"Set auto-mode preference","description":"Persist the current user's Studio auto-mode preference so it follows the account across devices.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAutoModePrefInput"}}}},"responses":{"200":{"description":"Auto-mode preference updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoModePref"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/auth/prefs/onboarding":{"get":{"tags":["Auth"],"operationId":"getOnboardingPref","summary":"Get onboarding answers","description":"Get the current user's post-signup welcome answers. Null = never answered, which is what makes the welcome show once.","responses":{"200":{"description":"Onboarding answers retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingPrefResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["Auth"],"operationId":"setOnboardingPref","summary":"Save onboarding answers","description":"Merge the current user's welcome answers into the stored record. The welcome saves after each step, so an omitted field leaves what is already stored alone; `completed` stamps the finish (or the skip).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOnboardingPrefInput"}}}},"responses":{"200":{"description":"Onboarding answers saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingPrefResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact":{"post":{"tags":["Contact"],"operationId":"submitContactMessage","summary":"Submit a contact message","description":"Submit a contact message (public, no authentication required)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactMessage"}}}},"responses":{"200":{"description":"Message submitted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages":{"get":{"tags":["Contact"],"operationId":"listContactMessages","summary":"List contact messages","description":"List contact messages with pagination, workflow filters, and free-text search across sender name, email, and body (admin only)","parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["all","open","done"],"default":"all"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"unreadOnly","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"Successfully retrieved messages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages/stats":{"get":{"tags":["Contact"],"operationId":"getContactMessageStats","summary":"Inbox triage counts","description":"Total, unread, open, and done message counts (admin only)","responses":{"200":{"description":"Inbox counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageStats"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages/bulk-status":{"patch":{"tags":["Contact"],"operationId":"bulkUpdateContactMessageStatus","summary":"Update status for several messages","description":"Apply one read/done status change to up to 100 contact messages (admin only)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageBulkStatusUpdate"}}}},"responses":{"200":{"description":"Messages updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageBulkResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages/bulk-delete":{"post":{"tags":["Contact"],"operationId":"bulkDeleteContactMessages","summary":"Delete several contact messages","description":"Delete up to 100 contact messages at once (admin only)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageBulkDelete"}}}},"responses":{"200":{"description":"Messages deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageBulkResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages/{id}/read":{"patch":{"tags":["Contact"],"operationId":"markContactMessageRead","summary":"Mark message as read","description":"Mark a contact message as read (admin only)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Message marked as read","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages/{id}/status":{"patch":{"tags":["Contact"],"operationId":"updateContactMessageStatus","summary":"Update message status","description":"Update read or done status for a contact message (admin only)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageStatusUpdate"}}}},"responses":{"200":{"description":"Message status updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages/{id}":{"delete":{"tags":["Contact"],"operationId":"deleteContactMessage","summary":"Delete a contact message","description":"Delete a contact message (admin only)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Message deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages/{id}/thread":{"get":{"tags":["Contact"],"operationId":"getContactMessageThread","summary":"Internal notes and sent replies","description":"Read the internal notes and the replies already emailed for one contact message (admin only)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Notes and replies, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageThread"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages/{id}/notes":{"post":{"tags":["Contact"],"operationId":"createContactMessageNote","summary":"Add an internal note","description":"Add an operator-only note to a contact message. Notes are never emailed (admin only)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageNoteInput"}}}},"responses":{"200":{"description":"Note created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageNote"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages/{id}/notes/{noteId}":{"delete":{"tags":["Contact"],"operationId":"deleteContactMessageNote","summary":"Delete an internal note","description":"Delete an operator-only note (admin only)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"noteId","in":"path"}],"responses":{"200":{"description":"Note deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/contact/messages/{id}/reply":{"post":{"tags":["Contact"],"operationId":"sendContactMessageReply","summary":"Email a reply to the sender","description":"Send a reply to the sender's email address and persist it on the message. Returns 503 when outbound email is not configured (admin only)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageReplyInput"}}}},"responses":{"200":{"description":"Reply sent and recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactMessageReply"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/promotional-status":{"get":{"tags":["Credit"],"operationId":"getPromotionalCreditStatus","summary":"Read the current user's promotional credit review status","responses":{"200":{"description":"Promotional credit status","content":{"application/json":{"schema":{"type":"object","properties":{"pending":{"type":"boolean"},"declined":{"type":"boolean"},"signupCredits":{"type":"integer","minimum":0},"signupCreditsOnVerify":{"type":"integer","minimum":0}},"required":["pending","declined","signupCredits","signupCreditsOnVerify"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/discord-promotion":{"get":{"tags":["Credit"],"operationId":"getDiscordPromotionStatus","summary":"Get Discord reward status","description":"Return whether the current user can connect Discord, verify membership, or has already claimed the one-time community reward.","responses":{"200":{"description":"Promotion status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscordPromotionStatus"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Discord connection, membership, or prior claim conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Discord verification rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Promotion or Discord verification unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/discord-promotion/claim":{"post":{"tags":["Credit"],"operationId":"claimDiscordPromotion","summary":"Claim Discord membership reward","description":"Verify the linked Discord account is currently a full member of the configured server and grant the one-time reward.","responses":{"200":{"description":"Promotion claimed or previously claimed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscordPromotionStatus"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Discord connection, membership, or prior claim conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Discord verification rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Promotion or Discord verification unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/referrals":{"get":{"tags":["Credit"],"operationId":"getReferralStatus","summary":"Get referral program status","description":"Return the current user's personal referral code, configured rewards, and referral results.","responses":{"200":{"description":"Referral status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralProgramStatus"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/referrals/claim":{"post":{"tags":["Credit"],"operationId":"claimReferral","summary":"Apply a referral code","description":"Attach a new account to its referrer and grant the configured join reward to both members.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimReferralInput"}}}},"responses":{"200":{"description":"Referral accepted or previously accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimReferralResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Referral is paused, self-referred, or account is ineligible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/discounts":{"get":{"tags":["Credit"],"operationId":"getCreditDiscounts","summary":"Get the active credit discounts","description":"Return the promotional credit discount in force: the global rate and any per-model overrides. Reservations and settlements apply the same rates, so clients use them to quote the credits a generation will actually take.","responses":{"200":{"description":"Discount rates retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditDiscountRates"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/balance":{"get":{"tags":["Credit"],"operationId":"getCreditBalance","summary":"Get credit balance","description":"Return the current user's credit balance, broken down by bucket.","responses":{"200":{"description":"Balance retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalance"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/history":{"get":{"tags":["Credit"],"operationId":"getCreditHistory","summary":"Get credit ledger history","description":"Return paginated ledger entries for the current user.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"History retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditHistoryResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/activity":{"get":{"tags":["Credit"],"operationId":"getCreditActivity","summary":"Get simplified credit activity","description":"Return the credit activity feed with reserve/release/settle rows collapsed into one line per chat session or per generation task.","parameters":[{"schema":{"type":"string","enum":["session","task"]},"required":false,"name":"groupBy","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Activity retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditActivityResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/sessions/{sessionId}/usage":{"get":{"tags":["Credit"],"operationId":"getCreditSessionUsage","summary":"Get per-session credit usage","description":"Return the credits the current user consumed in one chat session, split by media category (text / image / video / audio).","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"Session usage retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditSessionUsageResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/credit/usage":{"get":{"tags":["Credit"],"operationId":"getCreditUsage","summary":"Get credit usage aggregate","description":"Return credit usage aggregated by day and ledger kind.","parameters":[{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Usage retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditUsageResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/openrouter/account":{"get":{"tags":["Admin"],"operationId":"adminGetOpenRouterAccount","summary":"OpenRouter account snapshots","description":"The latest plan snapshot per environment published by `pnpm openrouter:plan --publish`: the declared config, the live account as the plan read it, and the plan. Read-only; carries no key values (admin only).","responses":{"200":{"description":"Snapshots, one per published environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenRouterAccountResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/openrouter/account/{environment}":{"put":{"tags":["Admin"],"operationId":"adminPublishOpenRouterSnapshot","summary":"Publish an OpenRouter plan snapshot","description":"Replace an environment's OpenRouter plan snapshot. Sent by `pnpm openrouter:plan --publish` with an admin API key; unknown fields and credential-shaped values are rejected (admin only).","parameters":[{"schema":{"type":"string","enum":["production","development"]},"required":true,"name":"environment","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenRouterAccountSnapshot"}}}},"responses":{"200":{"description":"The stored snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishedOpenRouterSnapshot"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/tiers":{"get":{"tags":["Admin"],"operationId":"adminListModelTiers","summary":"List model tiers with their models and LLM routes","responses":{"200":{"description":"Tiers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelTierListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/tiers/distribution":{"get":{"tags":["Admin"],"operationId":"adminTierCallDistribution","summary":"Model calls per tier by model, upstream, and route role","description":"Brain turn rows over the last 24 hours or 7 days, joined to each session's sticky tier assignment and grouped per tier by (model, upstream, role): primary, backup, fallback model, or older session (a session pinned to a model the tier no longer runs). Rows recorded before route columns existed count under their recorded provider/model as primary. 503 when brain is unreachable (admin only).","parameters":[{"schema":{"type":"string","enum":["24h","7d"],"default":"24h","description":"The window: the last 24 hours or the last 7 days."},"required":false,"description":"The window: the last 24 hours or the last 7 days.","name":"period","in":"query"}],"responses":{"200":{"description":"Call distribution per tier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TierCallDistributionResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/tiers/{tierId}":{"patch":{"tags":["Admin"],"operationId":"adminUpdateModelTier","summary":"Update a tier (label / blurb / enabled / default)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"tierId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateModelTierInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderRegistrySuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/tiers/{tierId}/model":{"put":{"tags":["Admin"],"operationId":"adminSetTierModel","summary":"Set the one model (and effort) a tier runs","description":"Applies to new sessions; running sessions keep their model. The upstream comes from the model's ordered LLM routes.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"tierId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetTierModelInput"}}}},"responses":{"200":{"description":"The tier's model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelTierEntry"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/routing":{"get":{"tags":["Admin"],"operationId":"adminGetRoutingView","summary":"Model routing matrix (LLM and media)","description":"Every model's ordered route chain, what each provider column could add (reviewed catalog routes only) or why not, and the last 24 hours of served media requests per route (admin only).","responses":{"200":{"description":"LLM and media routing tabs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingViewResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/routing/changes":{"get":{"tags":["Admin"],"operationId":"adminListRoutingChanges","summary":"Routing change history, newest first","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Applied routing changes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingChangeListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Admin"],"operationId":"adminApplyRoutingChange","summary":"Apply staged route-chain edits together, with a note","description":"Rewrites every listed model's chain in one transaction and records one routing change. Each `before` must match the live chain (409 otherwise); a model keeps at least one route.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyRoutingChangeInput"}}}},"responses":{"200":{"description":"The recorded change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingChange"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/routing/changes/{changeId}/revert":{"post":{"tags":["Admin"],"operationId":"adminRevertRoutingChange","summary":"Revert a routing change, with a note","description":"Applies the change's inverse as a new change. Refused (409) when it was already reverted or a chain it touched has changed since.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"changeId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevertRoutingChangeInput"}}}},"responses":{"200":{"description":"The revert, recorded as a change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingChange"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/media-routes":{"get":{"tags":["Admin"],"operationId":"adminListMediaRoutes","summary":"List per-model supplier routes (with the media catalog)","responses":{"200":{"description":"Routes grouped client-side by catalog model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaModelRouteListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Admin"],"operationId":"adminUpsertMediaRoute","summary":"Add a supplier route at the end of the chain, or update it (model x provider)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertMediaRouteInput"}}}},"responses":{"200":{"description":"Upserted route","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaModelRoute"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/media-routes/{routeId}":{"patch":{"tags":["Admin"],"operationId":"adminUpdateMediaRoute","summary":"Update a supplier route's enabled / model string / position","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"routeId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMediaRouteInput"}}}},"responses":{"200":{"description":"Updated route","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaModelRoute"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Admin"],"operationId":"adminDeleteMediaRoute","summary":"Remove a supplier route","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"routeId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderRegistrySuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/budgets":{"get":{"tags":["Admin"],"operationId":"adminListProviderBudgets","summary":"Provider spend against limit","description":"Each provider's latest used / limit reading from the health sweep (admin only). Only providers whose probe reads a limit appear — today OpenRouter, from the environment's own inference key; workspace budgets need the management key and are not read at runtime.","responses":{"200":{"description":"Budget readings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderBudgetListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers":{"get":{"tags":["Admin"],"operationId":"adminListProviders","summary":"List API providers","description":"All registered backend API providers with enabled state and latest health snapshot (admin only).","responses":{"200":{"description":"Providers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/{providerId}":{"patch":{"tags":["Admin"],"operationId":"adminUpdateProvider","summary":"Enable or disable a provider","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"providerId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProviderInput"}}}},"responses":{"200":{"description":"Updated provider","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/{providerId}/check":{"post":{"tags":["Admin"],"operationId":"adminCheckProvider","summary":"Probe a provider now","description":"Run the health probe immediately and persist the snapshot.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"providerId","in":"path"}],"responses":{"200":{"description":"Provider with the fresh snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/providers/{providerId}/health":{"get":{"tags":["Admin"],"operationId":"adminProviderHealthHistory","summary":"Provider health history","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"providerId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Recent snapshots, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderHealthHistoryResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/feature-flags":{"get":{"tags":["admin.featureFlags"],"operationId":"adminFeatureFlagList","summary":"List feature flags","description":"Every flag in the code catalog with its stored targeting. Admin only.","responses":{"200":{"description":"Feature flags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/feature-flags/{key}":{"patch":{"tags":["admin.featureFlags"],"operationId":"adminFeatureFlagUpdate","summary":"Update a feature flag","description":"Set a flag's global default and/or percentage rollout. Admin only.","parameters":[{"schema":{"type":"string","enum":["video-editor","content-research","social-manager","video-download-gate","onboarding","social-account-connect","report-teaser-gate","free-trial","byteplus-seedance","reddit-listening","x-listening","creator-scout-agent","meta-ads-agent","slack-next","video-diagnosis","signup-credits-ab","ai-tool-free-run"]},"required":true,"name":"key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFeatureFlagInput"}}}},"responses":{"200":{"description":"Feature flags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/feature-flags/{key}/targets":{"post":{"tags":["admin.featureFlags"],"operationId":"adminFeatureFlagAddTarget","summary":"Target an account","description":"Allow or deny one account by email. The address need not have an account yet — the target applies as soon as it does. Admin only.","parameters":[{"schema":{"type":"string","enum":["video-editor","content-research","social-manager","video-download-gate","onboarding","social-account-connect","report-teaser-gate","free-trial","byteplus-seedance","reddit-listening","x-listening","creator-scout-agent","meta-ads-agent","slack-next","video-diagnosis","signup-credits-ab","ai-tool-free-run"]},"required":true,"name":"key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFeatureFlagTargetInput"}}}},"responses":{"200":{"description":"Feature flags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/feature-flags/{key}/targets/{targetId}":{"delete":{"tags":["admin.featureFlags"],"operationId":"adminFeatureFlagRemoveTarget","summary":"Drop a target","description":"Remove one account's override for a flag. Admin only.","parameters":[{"schema":{"type":"string","enum":["video-editor","content-research","social-manager","video-download-gate","onboarding","social-account-connect","report-teaser-gate","free-trial","byteplus-seedance","reddit-listening","x-listening","creator-scout-agent","meta-ads-agent","slack-next","video-diagnosis","signup-credits-ab","ai-tool-free-run"]},"required":true,"name":"key","in":"path"},{"schema":{"type":"string"},"required":true,"name":"targetId","in":"path"}],"responses":{"200":{"description":"Feature flags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/drive/folders":{"get":{"tags":["Drive","Folders"],"operationId":"listFolders","summary":"List all folders","description":"Retrieve all folders for the authenticated user","responses":{"200":{"description":"Folder list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Drive","Folders"],"operationId":"createFolder","summary":"Create a new folder","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFolderInput"}}}},"responses":{"200":{"description":"Folder created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["Drive","Folders"],"operationId":"updateFolder","summary":"Update a folder","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFolderInput"}}}},"responses":{"200":{"description":"Folder updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Drive","Folders"],"operationId":"deleteFolder","summary":"Delete a folder","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteFolderInput"}}}},"responses":{"200":{"description":"Folder deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriveSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/drive/files":{"get":{"tags":["Drive","Files"],"operationId":"listFiles","summary":"List files","description":"Retrieve files, optionally filtered by folder","parameters":[{"schema":{"type":"string"},"required":false,"name":"folderId","in":"query"}],"responses":{"200":{"description":"File list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriveFileList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Drive","Files"],"operationId":"deleteFile","summary":"Delete a file","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteFileInput"}}}},"responses":{"200":{"description":"File deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriveSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/drive/storage":{"get":{"tags":["Drive","Storage"],"operationId":"getStorageQuota","summary":"Get storage quota","responses":{"200":{"description":"Storage quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageQuota"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/drive/upload/init":{"post":{"tags":["Drive","Files"],"operationId":"initUpload","summary":"Start a file upload","description":"Reserve a file row and return a presigned URL for the client to PUT bytes directly to storage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadInitInput"}}}},"responses":{"200":{"description":"Upload initialized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadInitResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/drive/upload/confirm":{"post":{"tags":["Drive","Files"],"operationId":"confirmUpload","summary":"Confirm a completed upload","description":"Mark the file as uploaded after the client successfully PUTs bytes to the presigned URL","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadConfirmInput"}}}},"responses":{"200":{"description":"Upload confirmed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadConfirmResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/drive/download/{fileId}":{"get":{"tags":["Drive","Files"],"operationId":"getDownload","summary":"Get a presigned download URL","parameters":[{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"Download URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/drive/files/{fileId}/make-public":{"post":{"tags":["Drive","Files"],"operationId":"makeFilePublic","summary":"Publish a drive file to the public CDN","description":"Copies the file's bytes into the public-assets bucket served by the Cloudflare custom domain (e.g. https://assets.adant.app) and returns a stable URL. The original drive row stays private; calling this multiple times mints additional public assets — there is no in-place toggle.","parameters":[{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"Public asset created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MakeFilePublicResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/subscription":{"get":{"tags":["Billing"],"operationId":"getSubscription","summary":"Get current subscription","description":"Retrieve the current user's subscription information","responses":{"200":{"description":"Successfully retrieved subscription info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionInfo"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/checkout":{"post":{"tags":["Billing"],"operationId":"createCheckoutSession","summary":"Create checkout session","description":"Create a Stripe checkout session for upgrading to Basic, Standard, Pro or Max","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutInput"}}}},"responses":{"200":{"description":"Checkout session created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/checkout/preview":{"post":{"tags":["Billing"],"operationId":"previewCheckoutPromotion","summary":"Preview a checkout promotion","description":"Validate a first-invoice promotion code and return exact upcoming charges","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewCheckoutPromotionInput"}}}},"responses":{"200":{"description":"Promotion validated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromotionCheckoutPreview"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/credit-pack-checkout":{"post":{"tags":["Billing"],"operationId":"createCreditPackCheckoutSession","summary":"Create credit pack checkout session","description":"Create a one-time Stripe Checkout session: the starter pack for any account, larger packs for an active paid plan","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCreditPackCheckoutInput"}}}},"responses":{"200":{"description":"Credit pack checkout session created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/checkout/{sessionId}/conversion":{"get":{"tags":["Billing"],"operationId":"getCheckoutConversion","summary":"Verify a completed checkout","description":"Return conversion details only when the Stripe Checkout Session is complete and belongs to the authenticated user","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"Checkout verified successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutConversion"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Checkout exists but is incomplete or unsupported","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/checkout/{sessionId}/refusal":{"get":{"tags":["Billing"],"operationId":"getCheckoutRefusal","summary":"Read whether a checkout's card was refused","description":"Return whether the webhook refused (and refunded) the card that paid this Stripe Checkout Session, which must belong to the authenticated user","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"Refusal state read successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRefusal"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/portal":{"post":{"tags":["Billing"],"operationId":"createPortalSession","summary":"Create customer portal session","description":"Create a Stripe customer portal session for managing the subscription. `intent: \"cancel\"` lands on Stripe's cancel confirmation for the current subscription instead of the portal home.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePortalInput"}}}},"responses":{"200":{"description":"Portal session created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/cancel-survey":{"post":{"tags":["Billing"],"operationId":"submitCancelSurvey","summary":"Record why the customer is canceling","description":"Record the cancel survey for the current subscription and answer the save offer it earns (half off the next month for price, quality or research answers on an eligible monthly plan) and whether to show help first. Does not cancel anything.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSurveyInput"}}}},"responses":{"200":{"description":"Survey recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelSurveyResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/cancel-survey/{cancellationId}/accept-offer":{"post":{"tags":["Billing"],"operationId":"acceptSaveOffer","summary":"Keep the plan with the save offer","description":"Apply the survey's save offer (a one-time 50% discount on the next invoice) and keep the plan. Idempotent.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"cancellationId","in":"path"}],"responses":{"200":{"description":"Offer applied; the plan continues","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveOfferQuote"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/subscription/change":{"post":{"tags":["Billing"],"operationId":"createSubscriptionChangeSession","summary":"Change an existing subscription","description":"Create a Stripe-hosted confirmation flow that prorates upgrades and schedules eligible downgrades at renewal","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionChangeInput"}}}},"responses":{"200":{"description":"Subscription change session created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/offers/yearly":{"get":{"tags":["Billing"],"operationId":"getYearlyOffers","summary":"Get yearly offers","description":"The offers that move this account's monthly subscription to a yearly term, if any.","responses":{"200":{"description":"The account's yearly offers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YearlyOffers"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/offers/yearly/event":{"post":{"tags":["Billing"],"operationId":"recordYearlyOfferEvent","summary":"Record a yearly offer impression or dismissal","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/YearlyOfferEventInput"}}}},"responses":{"200":{"description":"Recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/offers/yearly/accept":{"post":{"tags":["Billing"],"operationId":"acceptYearlyOffer","summary":"Accept a yearly offer","description":"Open Stripe's confirmation of the switch to yearly with the offer applied. 409 when the offer is no longer available.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptYearlyOfferInput"}}}},"responses":{"200":{"description":"Stripe confirmation URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/purchase-checkout":{"post":{"tags":["Billing"],"operationId":"createPurchaseCheckoutSession","summary":"Create a one-time purchase checkout session","description":"Create a one-time Stripe Checkout session for one item sold outside the plans and credit packs. Answers 404 for an item that is not for sale and 409 for one the account already has.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePurchaseCheckoutInput"}}}},"responses":{"200":{"description":"Purchase checkout session created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/billing/free-trial/end":{"post":{"tags":["Billing"],"operationId":"endFreeTrial","summary":"Start the trial's plan now","description":"End the account's free trial now: Stripe charges the trial's plan on the card it collected, and the plan (clean video downloads, its monthly credits) starts once the invoice is paid","responses":{"200":{"description":"Trial ended; the plan's first invoice is being charged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/ark-library/enrollments":{"get":{"tags":["Admin"],"operationId":"adminListArkEnrollments","summary":"List ModelArk library slots","description":"Pictures the ModelArk library has been asked to hold, newest change first, with the library quota (admin only).","parameters":[{"schema":{"type":"string","enum":["pending","processing","active","failed"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Enrollments and quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArkEnrollmentList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/ark-library/quota":{"get":{"tags":["Admin"],"operationId":"adminGetArkLibraryQuota","summary":"ModelArk library quota","description":"Asset groups and pictures used against the rights package's caps, plus enrollment counts by status (admin only).","responses":{"200":{"description":"Quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArkLibraryQuota"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/ark-library/enrollments/{imageSha256}/retry":{"post":{"tags":["Admin"],"operationId":"adminRetryArkEnrollment","summary":"Retry a failed enrollment","description":"Moves a failed picture back to pending and queues it; the picture is resubmitted (admin only).","parameters":[{"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"},"required":true,"name":"imageSha256","in":"path"}],"responses":{"200":{"description":"The enrollment after the retry was queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArkEnrollmentRow"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/ark-library/enrollments/{imageSha256}":{"delete":{"tags":["Admin"],"operationId":"adminReleaseArkEnrollment","summary":"Release a picture's ModelArk slot","description":"Deletes the picture's ModelArk asset and forgets the enrollment, freeing its slot. AdAnt's own copy of the picture is untouched; a later render re-enrolls it (admin only).","parameters":[{"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"},"required":true,"name":"imageSha256","in":"path"}],"responses":{"200":{"description":"The slot was released","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArkEnrollmentRelease"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/ark-library/backfill":{"post":{"tags":["Admin"],"operationId":"adminBackfillArkLibrary","summary":"Enroll every system avatar in ModelArk","description":"Registers every enabled system avatar's portrait and queues the ones not yet active, so the roster is ready before a user picks it. Idempotent (admin only).","responses":{"200":{"description":"What the backfill registered and queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArkLibraryBackfill"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/avatars":{"get":{"tags":["Avatars"],"operationId":"listAvatars","parameters":[{"schema":{"type":"string","enum":["system","user"]},"required":false,"name":"ownerKind","in":"query"},{"schema":{"type":"string","enum":["ai_human","animation","tvc"]},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","enum":["avatar"]},"required":false,"name":"assetType","in":"query"}],"responses":{"200":{"description":"Avatars visible to the requester","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Avatars"],"operationId":"createAvatar","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAvatarInput"}}}},"responses":{"200":{"description":"Created avatar (from an uploaded picture)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/avatars/{id}":{"get":{"tags":["Avatars"],"operationId":"getAvatar","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Avatar record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Avatars"],"operationId":"updateAvatar","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAvatarInput"}}}},"responses":{"200":{"description":"Updated avatar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Avatars"],"operationId":"deleteAvatar","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/avatars/generate":{"post":{"tags":["Avatars"],"operationId":"generateAvatar","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAvatarInput"}}}},"responses":{"200":{"description":"Generated avatar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/avatars":{"get":{"tags":["Admin"],"operationId":"adminListSystemAvatars","summary":"List system avatars","description":"List all platform-owned (system) avatars (admin only).","responses":{"200":{"description":"System avatars","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAvatarListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Admin"],"operationId":"adminCreateSystemAvatar","summary":"Create a system avatar","description":"Upload an image and create a platform-owned (system) avatar (admin only).","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/CreateSystemAvatarForm"}}}},"responses":{"200":{"description":"Created system avatar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAvatarSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/avatars/reorder":{"post":{"tags":["Admin"],"operationId":"adminReorderSystemAvatars","summary":"Reorder system avatars (one category, or globally)","description":"Rewrite system-avatar display ranks from an explicit id order. With `category`, ranks one category; without, ranks the whole system roster. Transactional: every id must be a system avatar (and match the category when given) or nothing changes (admin only).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderSystemAvatarsInput"}}}},"responses":{"200":{"description":"The reordered system-avatar roster","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAvatarListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/avatars/{id}":{"patch":{"tags":["Admin"],"operationId":"adminUpdateSystemAvatar","summary":"Update a system avatar","description":"Update a platform-owned (system) avatar's fields (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSystemAvatarInput"}}}},"responses":{"200":{"description":"Updated system avatar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAvatarSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Admin"],"operationId":"adminDeleteSystemAvatar","summary":"Permanently delete a disabled system avatar","description":"Permanently remove a platform-owned avatar and its catalog revision history from the database (admin only). The avatar must already be disabled — disable it first via PATCH /api/admin/catalog-assets/system-avatar/{id} (reversible); deleting an enabled avatar returns 400. Uploaded source and published media objects are retained in storage.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/avatars/{id}/image":{"post":{"tags":["Admin"],"operationId":"adminReplaceSystemAvatarImage","summary":"Replace a system avatar's portrait","description":"Upload a new portrait image for a system avatar (admin only). The image is published under a fresh CDN key so cached copies of the old portrait are never served.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ReplaceSystemAvatarImageForm"}}}},"responses":{"200":{"description":"System avatar with the new portrait","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAvatarSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/catalog-assets":{"get":{"tags":["Admin"],"operationId":"adminListCatalogAssets","summary":"List managed catalog assets","responses":{"200":{"description":"System avatars and video templates","content":{"application/json":{"schema":{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["system-avatar","video-template","editor-media"]},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"activeRevisionId":{"type":"string","nullable":true},"revisionCount":{"type":"integer"},"previewUrl":{"type":"string","nullable":true},"classification":{"type":"string"},"publishStatus":{"type":"string"},"updatedAt":{"type":"string"}},"required":["kind","id","name","enabled","activeRevisionId","revisionCount","previewUrl","classification","publishStatus","updatedAt"]}}},"required":["assets"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/catalog-assets/{kind}/{id}":{"patch":{"tags":["Admin"],"operationId":"adminUpdateCatalogAsset","summary":"Enable or disable a catalog asset","parameters":[{"schema":{"type":"string","enum":["system-avatar","video-template","editor-media"]},"required":true,"name":"kind","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"Updated asset","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["system-avatar","video-template","editor-media"]},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"activeRevisionId":{"type":"string","nullable":true},"revisionCount":{"type":"integer"},"previewUrl":{"type":"string","nullable":true},"classification":{"type":"string"},"publishStatus":{"type":"string"},"updatedAt":{"type":"string"}},"required":["kind","id","name","enabled","activeRevisionId","revisionCount","previewUrl","classification","publishStatus","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/catalog-assets/{kind}/{id}/revisions":{"get":{"tags":["Admin"],"operationId":"adminListCatalogAssetRevisions","summary":"List immutable revisions for a catalog asset","parameters":[{"schema":{"type":"string","enum":["system-avatar","video-template","editor-media"]},"required":true,"name":"kind","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Newest revision first","content":{"application/json":{"schema":{"type":"object","properties":{"revisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"assetKind":{"type":"string","enum":["system-avatar","video-template","editor-media"]},"assetId":{"type":"string"},"sourceKey":{"type":"string"},"sourceSha256":{"type":"string"},"sourceMime":{"type":"string"},"sourceSize":{"type":"integer"},"published":{"type":"object","properties":{"imageUrl":{"type":"string","format":"uri"},"videoUrl":{"type":"string","format":"uri"},"posterUrl":{"type":"string","nullable":true,"format":"uri"}}},"createdBy":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","assetKind","assetId","sourceKey","sourceSha256","sourceMime","sourceSize","published","createdBy","createdAt"]}}},"required":["revisions"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/catalog-assets/{kind}/{id}/activate":{"post":{"tags":["Admin"],"operationId":"adminActivateCatalogAssetRevision","summary":"Activate a previous immutable revision","parameters":[{"schema":{"type":"string","enum":["system-avatar","video-template","editor-media"]},"required":true,"name":"kind","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"revisionId":{"type":"string","minLength":1}},"required":["revisionId"]}}}},"responses":{"200":{"description":"Asset with the selected active revision","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["system-avatar","video-template","editor-media"]},"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"activeRevisionId":{"type":"string","nullable":true},"revisionCount":{"type":"integer"},"previewUrl":{"type":"string","nullable":true},"classification":{"type":"string"},"publishStatus":{"type":"string"},"updatedAt":{"type":"string"}},"required":["kind","id","name","enabled","activeRevisionId","revisionCount","previewUrl","classification","publishStatus","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/voices":{"get":{"tags":["Admin"],"operationId":"adminListSystemVoices","summary":"List system voice assets","description":"List active and inactive database-backed system voices (admin only).","responses":{"200":{"description":"System voice assets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminVoiceAssetListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/voices/{id}":{"patch":{"tags":["Admin"],"operationId":"adminUpdateSystemVoice","summary":"Enable or disable a system voice","description":"Control whether a synchronized system voice appears in the user-facing catalog (admin only).","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAdminVoiceAssetInput"}}}},"responses":{"200":{"description":"Updated system voice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminVoiceAsset"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/chat-shares":{"post":{"tags":["Chat shares"],"operationId":"shareChat","summary":"Share a conversation (or update its shared snapshot)","description":"Returns the conversation's read-only link, creating it on first use. Sharing again keeps the same URL and moves the snapshot to now.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareChatInput"}}}},"responses":{"200":{"description":"The conversation's share link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatShareLink"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/chat-shares/sessions/{sessionId}":{"get":{"tags":["Chat shares"],"operationId":"getChatShare","summary":"The caller's active share link for a conversation","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"The link, or null when the conversation is not shared","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatShareLinkResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Chat shares"],"operationId":"revokeChatShare","summary":"Stop sharing a conversation","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$"},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"The link no longer opens","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatShareSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/chat-shares/links/{token}":{"get":{"tags":["Chat shares"],"operationId":"openSharedChat","summary":"Read a shared conversation","description":"Any signed-in account holding the link can read it.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"The shared snapshot of the conversation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedConversation"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/chat-shares/links/{token}/artifacts/{artifactId}/payload":{"get":{"tags":["Chat shares"],"operationId":"sharedChatArtifactPayload","summary":"Presign one file of a shared conversation","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"token","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"artifactId","in":"path"},{"schema":{"type":"string","enum":["original","thumbnail"],"default":"original"},"required":false,"name":"variant","in":"query"}],"responses":{"200":{"description":"A short-lived URL for the file's bytes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedArtifactPayload"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/teams":{"get":{"tags":["Team"],"operationId":"listTeams","summary":"The teams the caller is on, and invitations addressed to them","responses":{"200":{"description":"Teams in the order the caller joined them","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Team"],"operationId":"createTeam","summary":"Make a new team with the caller as its owner","description":"The first team an account makes is free; another one needs Pro (403 UPGRADE_REQUIRED, feature multiple_teams).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamNameInput"}}}},"responses":{"200":{"description":"The new team","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/teams/{teamId}":{"patch":{"tags":["Team"],"operationId":"renameTeam","summary":"Rename a team the caller owns","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":true,"name":"teamId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamNameInput"}}}},"responses":{"200":{"description":"The renamed team","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/members":{"get":{"tags":["Team"],"operationId":"listTeamMembers","summary":"One team's members — the same list for everyone on it","description":"Every active member (the owner first) and every invite still waiting. Without `teamId`, the caller's first team.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":false,"name":"teamId","in":"query"}],"responses":{"200":{"description":"The team, owner first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/members/{userId}":{"delete":{"tags":["Team"],"operationId":"removeTeamMember","summary":"Remove a teammate, or leave a team (your own user id)","description":"The team's owner removes anyone else; any member removes themselves. Tasks and strategies shared between people who no longer share any team close at once.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":true,"name":"userId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":false,"name":"teamId","in":"query"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/invites":{"post":{"tags":["Team"],"operationId":"createTeamInvite","summary":"Invite an email address to a team the caller is on","description":"Any member may invite. Sends the invite email with a join link. A pending invite to the same address is returned as it is; an address already on the team is refused. Without `teamId`, the caller's first team — made for them when they have none. At most 20 invites per sender per day.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTeamInviteInput"}}}},"responses":{"200":{"description":"The pending invite","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamInvite"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/invites/{inviteId}":{"delete":{"tags":["Team"],"operationId":"revokeTeamInvite","summary":"Withdraw a pending invite (its sender or the team's owner)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":true,"name":"inviteId","in":"path"}],"responses":{"200":{"description":"The link no longer joins anyone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/invites/{token}/accept":{"post":{"tags":["Team"],"operationId":"acceptTeamInvite","summary":"Join the team an invite link names","description":"The signed-in account becomes a member of the team the invite names. An expired or withdrawn invite answers 410.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"Whose team was joined","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamJoinResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/invites/preview":{"post":{"tags":["Team"],"operationId":"previewTeamInvite","summary":"Which team an invite link names, without joining","description":"Read-only, and answered signed out too: the join page shows the team before the visitor signs up. Answers like accept — 410 for a spent or expired invite — but changes nothing.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":128}},"required":["token"]}}}},"responses":{"200":{"description":"The inviting owner, and whether the caller is already on","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamJoinResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/invitations/{inviteId}/accept":{"post":{"tags":["Team"],"operationId":"acceptTeamInvitation","summary":"Accept an invite addressed to the caller's email","description":"No link needed: the account whose address the invite went to joins from the Studio. A spent, withdrawn or expired invite answers 410.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":true,"name":"inviteId","in":"path"}],"responses":{"200":{"description":"The team joined","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamJoinResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/invitations/{inviteId}/decline":{"post":{"tags":["Team"],"operationId":"declineTeamInvitation","summary":"Decline an invite addressed to the caller's email","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":true,"name":"inviteId","in":"path"}],"responses":{"200":{"description":"Declined; the link no longer joins anyone","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/sessions/{sessionId}/participants":{"get":{"tags":["Team"],"operationId":"listSessionParticipants","summary":"Teammates on one of the caller's tasks","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"Active participants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionParticipantList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Team"],"operationId":"addSessionParticipant","summary":"Put someone the caller shares a team with on their task","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":true,"name":"sessionId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddSessionParticipantInput"}}}},"responses":{"200":{"description":"The participant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionParticipantResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/sessions/{sessionId}/people":{"get":{"tags":["Team"],"operationId":"listTaskPeople","summary":"Everyone who can open a task the caller is on","description":"The task's owner first, then the teammates on it. Answers its owner and any teammate on it — the people a message there can @mention — and 404 to anyone else.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"The owner, then the active participants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPeople"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/team/sessions/{sessionId}/participants/{userId}":{"delete":{"tags":["Team"],"operationId":"removeSessionParticipant","summary":"Take a teammate off one of the caller's tasks","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":true,"name":"sessionId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.:-]+$"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-diagnosis":{"post":{"operationId":"startVideoDiagnosis","tags":["video-diagnosis"],"summary":"Start a video diagnosis","description":"No account needed. Answers at once with the diagnosis id; poll `GET /api/video-diagnosis/{id}` for the result. The same link (and Compare with link) asked again within a day reuses that run's result, and a run still in flight is shared, so nothing is queued twice — a reused run passes none of the checks below. A new run needs a Cloudflare Turnstile token (action `video-diagnosis`, site key from `GET /api/video-diagnosis/settings`) in the `x-captcha-response` header, and the route keeps a device id in the `adant_diagnosis_device` cookie. 400 for a link that is not one TikTok video or one YouTube Short; 403 with `details.reason: \"video_diagnosis_unavailable\"` while the `video-diagnosis` feature flag is off for this caller (off by default: only allow-targeted accounts may start one before launch; an anonymous caller reads the flag's global value); 403 `turnstile_failed` for a missing or rejected token; 429 `daily_limit_reached` once the day's limit is used (`details.scope` `ip`, `device` or `account`, `details.limit`, `details.retryAt`); 503 `daily_budget_spent` or `monthly_budget_spent` once the budget is spent (`details.retryAt`), and 503 without a reason when this deployment cannot run diagnoses. Reading a diagnosis is never gated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartVideoDiagnosis"}}}},"responses":{"200":{"description":"The run: new and queued, or reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartVideoDiagnosisResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-diagnosis/settings":{"get":{"operationId":"getVideoDiagnosisSettings","tags":["video-diagnosis"],"summary":"What starting a video diagnosis needs","description":"No account needed. The Turnstile site key a start's token is issued for, and the daily limits.","responses":{"200":{"description":"The settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoDiagnosisSettings"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-diagnosis/{id}/signup":{"post":{"operationId":"claimVideoDiagnosisSignup","tags":["video-diagnosis"],"summary":"Count a new account as a diagnosis's signup","description":"Called by Studio once a viewer who pressed section 5's sign-up button is signed in. Counts the account as this diagnosis's signup when it was created within the last hour; the first claim wins and nothing else changes. 401 without a session.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"What the claim did","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimVideoDiagnosisSignup"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-diagnosis/{id}":{"get":{"operationId":"getVideoDiagnosis","tags":["video-diagnosis"],"summary":"Read a video diagnosis","description":"No account needed. The run's status, and its result once completed or its failure once failed. Section 5's full version is returned only to a signed-in caller.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoDiagnosisRun"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/products":{"get":{"tags":["Products"],"operationId":"listProducts","parameters":[{"schema":{"type":"string","enum":["system","user"]},"required":false,"name":"ownerKind","in":"query"},{"schema":{"type":"string","enum":["product"]},"required":false,"name":"assetType","in":"query"}],"responses":{"200":{"description":"Products visible to the requester","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Products"],"operationId":"createProduct","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductInput"}}}},"responses":{"200":{"description":"Created product (from uploaded pictures)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/products/lookup":{"get":{"tags":["Products"],"operationId":"lookupProduct","summary":"Find the requester's product closest to a source url","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":2048},"required":true,"name":"url","in":"query"}],"responses":{"200":{"description":"The canonical url plus the closest existing product (exact key match or same host), or null","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductLookupResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/products/import":{"post":{"tags":["Products"],"operationId":"importProduct","summary":"Create (or fill) a product from what its page says about itself","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportProductInput"}}}},"responses":{"200":{"description":"The product written from the page's title, description, gallery, icon and theme colour, plus what was found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportProductResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/products/{id}":{"get":{"tags":["Products"],"operationId":"getProduct","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Product record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Products"],"operationId":"updateProduct","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductInput"}}}},"responses":{"200":{"description":"Updated product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Products"],"operationId":"deleteProduct","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/products/{id}/brand-assets":{"post":{"tags":["Products"],"operationId":"createBrandAsset","summary":"Add a brand asset (logo, wordmark, badge) to a product","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBrandAssetInput"}}}},"responses":{"200":{"description":"The stored brand asset with a fresh presigned url","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandAssetSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/products/{id}/brand-assets/{assetId}":{"patch":{"tags":["Products"],"operationId":"updateBrandAsset","summary":"Rename, reclassify, pin a placement or toggle always-add","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"assetId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBrandAssetInput"}}}},"responses":{"200":{"description":"Updated brand asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandAssetSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Products"],"operationId":"deleteBrandAsset","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"assetId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-overlays/{artifactId}":{"get":{"tags":["Video overlays"],"operationId":"getVideoOverlay","summary":"Read a video's overlay layout with presigned layer urls","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"artifactId","in":"path"}],"responses":{"200":{"description":"The stored layout, or 404 when the video has none","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoOverlayResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["Video overlays"],"operationId":"saveVideoOverlay","summary":"Replace a video's overlay layers and re-render it","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"artifactId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveVideoOverlayInput"}}}},"responses":{"200":{"description":"The saved layout; `pending` stays true until the render lands","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoOverlayResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/capabilities":{"get":{"tags":["VideoEditor"],"operationId":"getVideoEditorCapabilities","responses":{"200":{"description":"Current editor service readiness","content":{"application/json":{"schema":{"type":"object","properties":{"api":{"type":"boolean","enum":[true]},"rollout":{"type":"object","properties":{"enabled":{"type":"boolean"},"stage":{"type":"string","enum":["off","internal","percentage","all"]}},"required":["enabled","stage"]},"persistence":{"type":"boolean"},"mediaPreparation":{"type":"boolean"},"rendering":{"type":"boolean"},"events":{"type":"boolean"},"renderReady":{"type":"boolean"},"checks":{"type":"object","properties":{"api":{"type":"object","properties":{"ready":{"type":"boolean"},"code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"checkedAt":{"type":"string"}},"required":["ready","code","message","checkedAt"]},"persistence":{"type":"object","properties":{"ready":{"type":"boolean"},"code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"checkedAt":{"type":"string"}},"required":["ready","code","message","checkedAt"]},"storage":{"type":"object","properties":{"ready":{"type":"boolean"},"code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"checkedAt":{"type":"string"}},"required":["ready","code","message","checkedAt"]},"queue":{"type":"object","properties":{"ready":{"type":"boolean"},"code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"checkedAt":{"type":"string"}},"required":["ready","code","message","checkedAt"]},"rendererBundle":{"type":"object","properties":{"ready":{"type":"boolean"},"code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"checkedAt":{"type":"string"}},"required":["ready","code","message","checkedAt"]},"chromium":{"type":"object","properties":{"ready":{"type":"boolean"},"code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"checkedAt":{"type":"string"}},"required":["ready","code","message","checkedAt"]},"codecs":{"type":"object","properties":{"ready":{"type":"boolean"},"code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"checkedAt":{"type":"string"}},"required":["ready","code","message","checkedAt"]},"mediaPreparation":{"type":"object","properties":{"ready":{"type":"boolean"},"code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"checkedAt":{"type":"string"}},"required":["ready","code","message","checkedAt"]},"events":{"type":"object","properties":{"ready":{"type":"boolean"},"code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"checkedAt":{"type":"string"}},"required":["ready","code","message","checkedAt"]}},"required":["api","persistence","storage","queue","rendererBundle","chromium","codecs","mediaPreparation","events"]},"supportedTimelineVersions":{"type":"array","items":{"type":"integer"}},"supportedManifestVersions":{"type":"array","items":{"type":"integer"}},"checkedAt":{"type":"string"},"expiresAt":{"type":"string"}},"required":["api","rollout","persistence","mediaPreparation","rendering","events","renderReady","checks","supportedTimelineVersions","supportedManifestVersions","checkedAt","expiresAt"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects":{"post":{"tags":["VideoEditor"],"operationId":"resolveVideoEditorProject","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1,"maxLength":240},"seedTimeline":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]}},"required":["brainSessionId","seedTimeline"]}}}},"responses":{"200":{"description":"Resolved project and active timeline","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"brainSessionId":{"type":"string","nullable":true},"activeTimelineId":{"type":"string"},"defaultWidth":{"type":"integer"},"defaultHeight":{"type":"integer"},"defaultFps":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","brainSessionId","activeTimelineId","defaultWidth","defaultHeight","defaultFps","createdAt","updatedAt"]},"activeTimeline":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]},"timelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]}}},"required":["project","activeTimeline","timelines"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["VideoEditor"],"operationId":"listVideoEditorProjects","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Editor projects owned by the caller, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"brainSessionId":{"type":"string","nullable":true},"activeTimelineId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"updatedAt":{"type":"string"},"edited":{"type":"boolean"},"thumbnailArtifactId":{"type":"string","nullable":true}},"required":["id","brainSessionId","activeTimelineId","name","updatedAt","edited","thumbnailArtifactId"]}}},"required":["items"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/timelines":{"post":{"tags":["VideoEditor"],"operationId":"createStandaloneVideoEditorTimeline","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120}}}}}},"responses":{"201":{"description":"The new project and its empty timeline","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"brainSessionId":{"type":"string","nullable":true},"activeTimelineId":{"type":"string"},"defaultWidth":{"type":"integer"},"defaultHeight":{"type":"integer"},"defaultFps":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","brainSessionId","activeTimelineId","defaultWidth","defaultHeight","defaultFps","createdAt","updatedAt"]},"activeTimeline":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]},"timelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]}}},"required":["project","activeTimeline","timelines"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/sessions/{sessionId}":{"get":{"tags":["VideoEditor"],"operationId":"getVideoEditorSessionProject","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"Project and active timeline for a Brain session","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"brainSessionId":{"type":"string","nullable":true},"activeTimelineId":{"type":"string"},"defaultWidth":{"type":"integer"},"defaultHeight":{"type":"integer"},"defaultFps":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","brainSessionId","activeTimelineId","defaultWidth","defaultHeight","defaultFps","createdAt","updatedAt"]},"activeTimeline":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]},"timelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]}}},"required":["project","activeTimeline","timelines"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}":{"get":{"tags":["VideoEditor"],"operationId":"getVideoEditorProject","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Project, timelines, and active timeline","content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"object","properties":{"id":{"type":"string"},"brainSessionId":{"type":"string","nullable":true},"activeTimelineId":{"type":"string"},"defaultWidth":{"type":"integer"},"defaultHeight":{"type":"integer"},"defaultFps":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","brainSessionId","activeTimelineId","defaultWidth","defaultHeight","defaultFps","createdAt","updatedAt"]},"activeTimeline":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]},"timelines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]}}},"required":["project","activeTimeline","timelines"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["VideoEditor"],"operationId":"deleteVideoEditorProject","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"The project and everything it owned were deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deletedProjectId":{"type":"string"}},"required":["deletedProjectId"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/timelines":{"post":{"tags":["VideoEditor"],"operationId":"createVideoEditorTimeline","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":240},"duplicateFromTimelineId":{"type":"string","minLength":1},"activate":{"type":"boolean"},"expectedRevision":{"type":"integer","minimum":0}},"required":["name","expectedRevision"]}}}},"responses":{"201":{"description":"Created or duplicated timeline","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/timelines/{timelineId}":{"patch":{"tags":["VideoEditor"],"operationId":"updateVideoEditorTimeline","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"timelineId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":240},"hidden":{"type":"boolean"},"active":{"type":"boolean","enum":[true]},"expectedRevision":{"type":"integer","minimum":0}},"required":["expectedRevision"]}}}},"responses":{"200":{"description":"Updated timeline","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["VideoEditor"],"operationId":"deleteVideoEditorTimeline","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"timelineId","in":"path"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"expectedRevision","in":"query"}],"responses":{"200":{"description":"Timeline deletion and active replacement","content":{"application/json":{"schema":{"type":"object","properties":{"activeTimelineId":{"type":"string"}},"required":["activeTimelineId"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/timelines/{timelineId}/commands:batch":{"post":{"tags":["VideoEditor"],"operationId":"applyVideoEditorCommandBatch","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"timelineId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"baseRevision":{"type":"integer","minimum":0},"idempotencyKey":{"type":"string","minLength":8,"maxLength":240},"commands":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["insert_item"]},"item":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"ripple":{"type":"boolean","default":false}},"required":["type","item"]},{"type":"object","properties":{"type":{"type":"string","enum":["remove_item"]},"itemId":{"type":"string","minLength":1,"maxLength":160},"ripple":{"type":"boolean","default":false}},"required":["type","itemId"]},{"type":"object","properties":{"type":{"type":"string","enum":["move_item"]},"itemId":{"type":"string","minLength":1,"maxLength":160},"toTrackId":{"type":"string","minLength":1,"maxLength":160},"toFrame":{"type":"integer","minimum":0},"ripple":{"type":"boolean","default":false}},"required":["type","itemId","toTrackId","toFrame"]},{"type":"object","properties":{"type":{"type":"string","enum":["trim_item"]},"itemId":{"type":"string","minLength":1,"maxLength":160},"edge":{"type":"string","enum":["start","end"]},"deltaFrames":{"type":"integer"}},"required":["type","itemId","edge","deltaFrames"]},{"type":"object","properties":{"type":{"type":"string","enum":["split_item"]},"itemId":{"type":"string","minLength":1,"maxLength":160},"atFrame":{"type":"integer","minimum":0},"rightItemId":{"type":"string","minLength":1,"maxLength":160}},"required":["type","itemId","atFrame","rightItemId"]},{"type":"object","properties":{"type":{"type":"string","enum":["merge_split"]},"originalItem":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"rightItemId":{"type":"string","minLength":1,"maxLength":160}},"required":["type","originalItem","rightItemId"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_track_state"]},"trackId":{"type":"string","minLength":1,"maxLength":160},"field":{"type":"string","enum":["muted","hidden","locked"]},"value":{"type":"boolean"}},"required":["type","trackId","field","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["reorder_overlay_tracks"]},"trackIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"minItems":1,"maxItems":16}},"required":["type","trackIds"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_visual_layer_order"]},"layers":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["track","graphic","caption"]},"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","nullable":true,"minimum":1,"maximum":1000000}},"required":["kind","id","zIndex"],"additionalProperties":false},"minItems":1,"maxItems":10049}},"required":["type","layers"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_format"]},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"timingStrategy":{"type":"string","enum":["preserve_time"]},"itemTimings":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":160},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"visualKeyframeOffsets":{"type":"array","items":{"type":"integer","minimum":0,"maximum":2592000},"maxItems":100},"volumeKeyframeOffsets":{"type":"array","items":{"type":"integer","minimum":0,"maximum":2592000},"maxItems":100},"fadeInFrames":{"type":"integer","nullable":true,"minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","nullable":true,"minimum":1,"maximum":2592000}},"required":["itemId","fromFrame","durationInFrames"]},"maxItems":10000},"captionTimings":{"type":"array","items":{"type":"object","properties":{"cueId":{"type":"string","minLength":1,"maxLength":160},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["cueId","fromFrame","durationInFrames"]},"maxItems":10000},"motionGraphicTimings":{"type":"array","items":{"type":"object","properties":{"placementId":{"type":"string","minLength":1,"maxLength":160},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false},"layers":{"type":"array","items":{"type":"object","properties":{"layerId":{"type":"string","minLength":1,"maxLength":160},"keyframeOffsets":{"type":"array","items":{"type":"integer","minimum":0,"maximum":2592000},"maxItems":32}},"required":["layerId"]},"minItems":1,"maxItems":32}},"required":["placementId","fromFrame","durationInFrames","layers"]},"maxItems":32}},"required":["type","width","height","fps","timingStrategy"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_background"]},"color":{"type":"string","nullable":true,"pattern":"^#[0-9a-f]{6}$/i"}},"required":["type","color"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_transcript"]},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["upsert_caption_cue"]},"cue":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]}},"required":["type","cue"]},{"type":"object","properties":{"type":{"type":"string","enum":["remove_caption_cue"]},"cueId":{"type":"string","minLength":1,"maxLength":160},"omitEmptyCollection":{"type":"boolean","default":false}},"required":["type","cueId"]},{"type":"object","properties":{"type":{"type":"string","enum":["add_overlay_track"]},"track":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]}},"required":["type","track"]},{"type":"object","properties":{"type":{"type":"string","enum":["add_audio_track"]},"track":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","enum":["audio"]},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":0}},"required":["id","label","kind","muted","hidden","locked","items"]}},"required":["type","track"]},{"type":"object","properties":{"type":{"type":"string","enum":["remove_overlay_track"]},"trackId":{"type":"string","minLength":1,"maxLength":160}},"required":["type","trackId"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_transition"]},"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"transitionType":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["type","id","fromItemId","toItemId","transitionType","durationInFrames","audioPolicy"]},{"type":"object","properties":{"type":{"type":"string","enum":["remove_transition"]},"transitionId":{"type":"string","minLength":1,"maxLength":160}},"required":["type","transitionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["restore_composition_state"]},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"captionCues":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"motionGraphics":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["type","tracks"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_visual_properties"]},"itemId":{"type":"string","minLength":1,"maxLength":160},"fit":{"type":"string","enum":["contain","cover"]},"opacity":{"type":"number","nullable":true,"minimum":0,"maximum":1},"transform":{"type":"object","nullable":true,"properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","nullable":true,"items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["type","itemId"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_playback_rate"]},"itemId":{"type":"string","minLength":1,"maxLength":160},"playbackRate":{"type":"number","minimum":0.1,"maximum":16}},"required":["type","itemId","playbackRate"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_audio_properties"]},"itemId":{"type":"string","minLength":1,"maxLength":160},"includeSourceAudio":{"type":"boolean"},"volume":{"type":"number","minimum":0,"maximum":4},"fadeInFrames":{"type":"integer","nullable":true,"minimum":1},"fadeOutFrames":{"type":"integer","nullable":true,"minimum":1},"volumeKeyframes":{"type":"array","nullable":true,"items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["type","itemId"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_audio_mix_policy"]},"peakLimit":{"type":"number","nullable":true,"minimum":0.1,"maximum":1},"normalization":{"type":"string","nullable":true,"enum":["none","peak-safe",null]}},"required":["type","peakLimit","normalization"]},{"type":"object","properties":{"type":{"type":"string","enum":["upsert_motion_graphic"]},"placement":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false}},"required":["type","placement"]},{"type":"object","properties":{"type":{"type":"string","enum":["remove_motion_graphic"]},"placementId":{"type":"string","minLength":1,"maxLength":160},"omitEmptyCollection":{"type":"boolean","default":false}},"required":["type","placementId"]}]},"minItems":1,"maxItems":100}},"required":["baseRevision","idempotencyKey","commands"]}}}},"responses":{"200":{"description":"Canonical timeline after an atomic command batch","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"hidden":{"type":"boolean"},"revision":{"type":"integer","minimum":0},"document":{"type":"object","properties":{"schemaVersion":{"type":"number","enum":[2]},"id":{"type":"string","minLength":1,"maxLength":160},"name":{"type":"string","minLength":1,"maxLength":240},"width":{"type":"integer","minimum":16,"maximum":7680},"height":{"type":"integer","minimum":16,"maximum":7680},"fps":{"type":"integer","minimum":1,"maximum":120},"backgroundColor":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"revision":{"type":"integer","minimum":0},"tracks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["primary-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["audio"]}},"required":["id","label","muted","hidden","locked","items","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":80},"muted":{"type":"boolean"},"hidden":{"type":"boolean"},"locked":{"type":"boolean"},"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["video"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"includeSourceAudio":{"type":"boolean","default":true},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["image"]},"fit":{"type":"string","enum":["contain","cover"],"default":"contain"},"opacity":{"type":"number","minimum":0,"maximum":1},"transform":{"type":"object","properties":{"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"anchorX":{"type":"number","minimum":0,"maximum":1},"anchorY":{"type":"number","minimum":0,"maximum":1},"crop":{"type":"object","properties":{"top":{"type":"number","minimum":0,"maximum":1},"right":{"type":"number","minimum":0,"maximum":1},"bottom":{"type":"number","minimum":0,"maximum":1},"left":{"type":"number","minimum":0,"maximum":1}},"required":["top","right","bottom","left"]}},"required":["positionX","positionY","scale","rotationDegrees","anchorX","anchorY","crop"]},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"positionX":{"type":"number","minimum":-2,"maximum":2},"positionY":{"type":"number","minimum":-2,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"trackId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"kind":{"type":"string","enum":["audio"]},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"playbackRate":{"type":"number","minimum":0.1,"maximum":16,"default":1},"volume":{"type":"number","minimum":0,"maximum":4,"default":1},"fadeInFrames":{"type":"integer","minimum":1,"maximum":2592000},"fadeOutFrames":{"type":"integer","minimum":1,"maximum":2592000},"volumeKeyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"volume":{"type":"number","minimum":0,"maximum":4}},"required":["frameOffset","easing","volume"]},"maxItems":100}},"required":["id","artifactId","trackId","label","fromFrame","durationInFrames","kind","sourceStartUs"]}]},"maxItems":2000},"kind":{"type":"string","enum":["overlay-video"]},"zIndex":{"type":"integer","minimum":1,"maximum":1000000}},"required":["id","label","muted","hidden","locked","items","kind","zIndex"]}]},"minItems":1,"maxItems":32},"transitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"fromItemId":{"type":"string","minLength":1,"maxLength":160},"toItemId":{"type":"string","minLength":1,"maxLength":160},"type":{"type":"string","enum":["crossfade","dip-to-black"]},"durationInFrames":{"type":"integer","minimum":1,"maximum":300},"audioPolicy":{"type":"string","enum":["crossfade","cut"]}},"required":["id","fromItemId","toItemId","type","durationInFrames","audioPolicy"]},"maxItems":1000},"transcript":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["loading","ready","error"]},"language":{"type":"string","minLength":1,"maxLength":35},"errorMessage":{"type":"string","minLength":1,"maxLength":500},"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"artifactId":{"type":"string","minLength":1,"maxLength":160},"sourceStartUs":{"type":"integer","minimum":0,"maximum":21600000000},"sourceEndUs":{"type":"integer","minimum":0,"maximum":21600000000},"speaker":{"type":"string","minLength":1,"maxLength":120},"text":{"type":"string","minLength":1,"maxLength":4000}},"required":["id","artifactId","sourceStartUs","sourceEndUs","text"]},"maxItems":10000}},"required":["status","language","segments"]},"captionCues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"sourceSegmentIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"maxItems":100},"activeLanguage":{"type":"string","minLength":1,"maxLength":35},"texts":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":2000}},"style":{"type":"object","properties":{"position":{"type":"string","enum":["top","middle","bottom"]},"align":{"type":"string","enum":["start","center","end"]},"direction":{"type":"string","enum":["auto","ltr","rtl"]},"fontScale":{"type":"number","minimum":0.5,"maximum":2}},"required":["position","align","direction","fontScale"]}},"required":["id","fromFrame","durationInFrames","sourceSegmentIds","activeLanguage","texts","style"]},"maxItems":10000},"audioMixPolicy":{"type":"object","properties":{"peakLimit":{"type":"number","minimum":0.1,"maximum":1},"normalization":{"type":"string","enum":["none","peak-safe"]}},"required":["peakLimit","normalization"]},"motionGraphics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"fromFrame":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000},"zIndex":{"type":"integer","minimum":1,"maximum":1000000},"asset":{"type":"object","properties":{"formatVersion":{"type":"number","enum":[1]},"id":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","minLength":1,"maxLength":120},"origin":{"type":"string","enum":["built-in","agent","imported"]},"generatorId":{"type":"string","minLength":1,"maxLength":120},"layers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["rectangle"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0},"borderRadius":{"type":"number","minimum":0,"maximum":1,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["ellipse"]},"fill":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"stroke":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"strokeWidth":{"type":"number","minimum":0,"maximum":20,"default":0}},"required":["id","zIndex","x","y","width","height","type","fill"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"zIndex":{"type":"integer","minimum":1,"maximum":32},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"width":{"type":"number","minimum":0.01,"maximum":2},"height":{"type":"number","minimum":0.01,"maximum":2},"opacity":{"type":"number","minimum":0,"maximum":1,"default":1},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360,"default":0},"scale":{"type":"number","minimum":0.1,"maximum":10,"default":1},"keyframes":{"type":"array","items":{"type":"object","properties":{"frameOffset":{"type":"integer","minimum":0,"maximum":2592000},"easing":{"type":"string","enum":["linear","ease-in","ease-out","ease-in-out"]},"x":{"type":"number","minimum":-1,"maximum":2},"y":{"type":"number","minimum":-1,"maximum":2},"scale":{"type":"number","minimum":0.1,"maximum":10},"rotationDegrees":{"type":"number","minimum":-360,"maximum":360},"opacity":{"type":"number","minimum":0,"maximum":1}},"required":["frameOffset","easing"],"additionalProperties":false},"maxItems":32},"type":{"type":"string","enum":["text"]},"text":{"type":"string","minLength":1,"maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-f]{6}$/i"},"fontFamily":{"type":"string","enum":["sans","serif","mono"]},"fontWeight":{"anyOf":[{"type":"number","enum":[400]},{"type":"number","enum":[500]},{"type":"number","enum":[600]},{"type":"number","enum":[700]}]},"fontScale":{"type":"number","minimum":0.25,"maximum":4},"align":{"type":"string","enum":["start","center","end"]}},"required":["id","zIndex","x","y","width","height","type","text","color","fontFamily","fontWeight","fontScale","align"],"additionalProperties":false}]},"minItems":1,"maxItems":32}},"required":["formatVersion","id","name","origin","layers"],"additionalProperties":false},"animationTiming":{"type":"object","properties":{"offsetFrames":{"type":"integer","minimum":0,"maximum":2592000},"durationInFrames":{"type":"integer","minimum":1,"maximum":2592000}},"required":["offsetFrames","durationInFrames"],"additionalProperties":false}},"required":["id","fromFrame","durationInFrames","zIndex","asset"],"additionalProperties":false},"maxItems":32}},"required":["schemaVersion","id","name","width","height","fps","revision","tracks"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","hidden","revision","document","createdAt","updatedAt"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/resources/{resourceId}":{"get":{"tags":["VideoEditor"],"operationId":"getEditorResource","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":120},"required":true,"name":"resourceId","in":"path"}],"responses":{"200":{"description":"Current enabled resource revision with fresh preview URLs","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"revisionId":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"kind":{"type":"string","enum":["video","image","audio"]},"tags":{"type":"array","items":{"type":"string"}},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":0,"exclusiveMinimum":true},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"durationUs":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"width":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"height":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"hasAudio":{"type":"boolean"},"previewUrl":{"type":"string","format":"uri"},"thumbnailUrl":{"type":"string","nullable":true,"format":"uri"},"rights":{"type":"object","properties":{"license":{"type":"string","enum":["CC0-1.0","CC-BY-4.0","AdAnt-owned"]},"attribution":{"type":"string","minLength":1,"maxLength":2000},"sourceReference":{"type":"string","minLength":1,"maxLength":2048},"licenseEvidence":{"type":"string","minLength":1,"maxLength":4000},"redistributionAllowed":{"type":"boolean","enum":[true]}},"required":["license","attribution","sourceReference","licenseEvidence","redistributionAllowed"]}},"required":["id","revisionId","label","description","kind","tags","mimeType","sizeBytes","sha256","durationUs","width","height","hasAudio","previewUrl","thumbnailUrl","rights"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Resource revision changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Resource catalog unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/resources":{"get":{"tags":["VideoEditor"],"operationId":"listEditorResources","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","enum":["video","image","audio"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":60},"required":false,"name":"tag","in":"query"},{"schema":{"type":"string","maxLength":120},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":120},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":24},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Enabled starter media and pinned revisions","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"revisionId":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"kind":{"type":"string","enum":["video","image","audio"]},"tags":{"type":"array","items":{"type":"string"}},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":0,"exclusiveMinimum":true},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"durationUs":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"width":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"height":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"hasAudio":{"type":"boolean"},"previewUrl":{"type":"string","format":"uri"},"thumbnailUrl":{"type":"string","nullable":true,"format":"uri"},"rights":{"type":"object","properties":{"license":{"type":"string","enum":["CC0-1.0","CC-BY-4.0","AdAnt-owned"]},"attribution":{"type":"string","minLength":1,"maxLength":2000},"sourceReference":{"type":"string","minLength":1,"maxLength":2048},"licenseEvidence":{"type":"string","minLength":1,"maxLength":4000},"redistributionAllowed":{"type":"boolean","enum":[true]}},"required":["license","attribution","sourceReference","licenseEvidence","redistributionAllowed"]}},"required":["id","revisionId","label","description","kind","tags","mimeType","sizeBytes","sha256","durationUs","width","height","hasAudio","previewUrl","thumbnailUrl","rights"]}},"nextCursor":{"type":"string","nullable":true}},"required":["items","nextCursor"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Resource revision changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Resource catalog unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/resources/attach":{"post":{"tags":["VideoEditor"],"operationId":"attachEditorResource","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"resourceId":{"type":"string","minLength":1,"maxLength":120},"revisionId":{"type":"string","minLength":1,"maxLength":120}},"required":["resourceId","revisionId"]}}}},"responses":{"201":{"description":"Project-owned prepared artifact pinned to a starter revision","content":{"application/json":{"schema":{"type":"object","properties":{"resourceId":{"type":"string"},"revisionId":{"type":"string"},"artifactId":{"type":"string"},"title":{"type":"string"},"mediaSource":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"artifactId":{"type":"string"},"probeVersion":{"type":"integer"},"status":{"type":"string","enum":["pending","ready","unsupported","failed"]},"metadata":{"type":"object","nullable":true,"properties":{"probeVersion":{"type":"integer"},"kind":{"type":"string","enum":["image","video","audio"]},"containerFormats":{"type":"array","items":{"type":"string"}},"durationUs":{"type":"integer","nullable":true},"sizeBytes":{"type":"integer","nullable":true},"bitRate":{"type":"integer","nullable":true},"hasVideo":{"type":"boolean"},"hasAudio":{"type":"boolean"},"videoStreams":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"audioStreams":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["probeVersion","kind","containerFormats","durationUs","sizeBytes","bitRate","hasVideo","hasAudio","videoStreams","audioStreams"]},"proxyArtifactId":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","artifactId","probeVersion","status","metadata","proxyArtifactId","errorCode","errorMessage","createdAt","updatedAt"]}},"required":["resourceId","revisionId","artifactId","title","mediaSource"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Resource revision changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Resource catalog unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/audio/import":{"post":{"tags":["VideoEditor"],"operationId":"importVideoEditorAudio","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":120}},"required":["fileId","title"]}}}},"responses":{"201":{"description":"Owned uploaded audio normalized into a prepared artifact","content":{"application/json":{"schema":{"type":"object","properties":{"artifactId":{"type":"string"},"sourceFileId":{"type":"string"},"title":{"type":"string"},"mediaSource":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"artifactId":{"type":"string"},"probeVersion":{"type":"integer"},"status":{"type":"string","enum":["pending","ready","unsupported","failed"]},"metadata":{"type":"object","nullable":true,"properties":{"probeVersion":{"type":"integer"},"kind":{"type":"string","enum":["image","video","audio"]},"containerFormats":{"type":"array","items":{"type":"string"}},"durationUs":{"type":"integer","nullable":true},"sizeBytes":{"type":"integer","nullable":true},"bitRate":{"type":"integer","nullable":true},"hasVideo":{"type":"boolean"},"hasAudio":{"type":"boolean"},"videoStreams":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"audioStreams":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["probeVersion","kind","containerFormats","durationUs","sizeBytes","bitRate","hasVideo","hasAudio","videoStreams","audioStreams"]},"proxyArtifactId":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","artifactId","probeVersion","status","metadata","proxyArtifactId","errorCode","errorMessage","createdAt","updatedAt"]}},"required":["artifactId","sourceFileId","title","mediaSource"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/media/import":{"post":{"tags":["VideoEditor"],"operationId":"importVideoEditorMedia","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileId":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":120}},"required":["fileId","title"]}}}},"responses":{"201":{"description":"Owned uploaded media normalized into a prepared artifact","content":{"application/json":{"schema":{"type":"object","properties":{"artifactId":{"type":"string"},"sourceFileId":{"type":"string"},"title":{"type":"string"},"mediaSource":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"artifactId":{"type":"string"},"probeVersion":{"type":"integer"},"status":{"type":"string","enum":["pending","ready","unsupported","failed"]},"metadata":{"type":"object","nullable":true,"properties":{"probeVersion":{"type":"integer"},"kind":{"type":"string","enum":["image","video","audio"]},"containerFormats":{"type":"array","items":{"type":"string"}},"durationUs":{"type":"integer","nullable":true},"sizeBytes":{"type":"integer","nullable":true},"bitRate":{"type":"integer","nullable":true},"hasVideo":{"type":"boolean"},"hasAudio":{"type":"boolean"},"videoStreams":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"audioStreams":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["probeVersion","kind","containerFormats","durationUs","sizeBytes","bitRate","hasVideo","hasAudio","videoStreams","audioStreams"]},"proxyArtifactId":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","artifactId","probeVersion","status","metadata","proxyArtifactId","errorCode","errorMessage","createdAt","updatedAt"]}},"required":["artifactId","sourceFileId","title","mediaSource"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/media/{artifactId}/prepare":{"post":{"tags":["VideoEditor"],"operationId":"prepareVideoEditorMedia","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"artifactId","in":"path"}],"responses":{"202":{"description":"Existing or newly requested media preparation","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"artifactId":{"type":"string"},"probeVersion":{"type":"integer"},"status":{"type":"string","enum":["pending","ready","unsupported","failed"]},"metadata":{"type":"object","nullable":true,"properties":{"probeVersion":{"type":"integer"},"kind":{"type":"string","enum":["image","video","audio"]},"containerFormats":{"type":"array","items":{"type":"string"}},"durationUs":{"type":"integer","nullable":true},"sizeBytes":{"type":"integer","nullable":true},"bitRate":{"type":"integer","nullable":true},"hasVideo":{"type":"boolean"},"hasAudio":{"type":"boolean"},"videoStreams":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"audioStreams":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["probeVersion","kind","containerFormats","durationUs","sizeBytes","bitRate","hasVideo","hasAudio","videoStreams","audioStreams"]},"proxyArtifactId":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","artifactId","probeVersion","status","metadata","proxyArtifactId","errorCode","errorMessage","createdAt","updatedAt"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/timelines/{timelineId}/renders":{"post":{"tags":["VideoEditor"],"operationId":"createVideoEditorRender","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"timelineId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"resolution":{"type":"string","enum":["source","720p","1080p"],"default":"source"},"fps":{"anyOf":[{"type":"string","enum":["source"]},{"type":"number","enum":[24]},{"type":"number","enum":[30]},{"type":"number","enum":[60]}],"default":"source"},"quality":{"type":"string","enum":["draft","standard","high"],"default":"standard"},"includeAudio":{"type":"boolean","default":true},"burnCaptions":{"type":"boolean","default":true},"filename":{"type":"string","minLength":1,"maxLength":120,"default":"video-export.mp4"}}}}}},"responses":{"202":{"description":"Queued render with a frozen manifest","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"timelineId":{"type":"string","nullable":true},"requestedRevision":{"type":"integer","minimum":0},"manifestVersion":{"type":"integer","nullable":true},"compositionVersion":{"type":"integer","nullable":true},"rendererVersion":{"type":"string","nullable":true},"status":{"type":"string","enum":["queued","running","completed","failed","canceled"]},"stage":{"type":"string"},"progress":{"type":"integer","minimum":0,"maximum":100},"attemptCount":{"type":"integer","minimum":0},"artifactId":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"settings":{"type":"object","properties":{"resolution":{"type":"string","enum":["source","720p","1080p"]},"width":{"type":"integer","minimum":0,"exclusiveMinimum":true},"height":{"type":"integer","minimum":0,"exclusiveMinimum":true},"fps":{"type":"integer","minimum":0,"exclusiveMinimum":true},"quality":{"type":"string","enum":["draft","standard","high"]},"crf":{"anyOf":[{"type":"number","enum":[18]},{"type":"number","enum":[23]},{"type":"number","enum":[28]}]},"includeAudio":{"type":"boolean"},"burnCaptions":{"type":"boolean"},"filename":{"type":"string"},"container":{"type":"string","enum":["mp4"]},"videoCodec":{"type":"string","enum":["h264"]},"audioCodec":{"type":"string","enum":["aac"]}},"required":["resolution","width","height","fps","quality","crf","includeAudio","burnCaptions","filename","container","videoCodec","audioCodec"]},"resourceCredits":{"type":"array","nullable":true,"items":{"type":"object","properties":{"license":{"type":"string","enum":["CC0-1.0","CC-BY-4.0","AdAnt-owned"]},"attribution":{"type":"string","minLength":1,"maxLength":2000},"sourceReference":{"type":"string","minLength":1,"maxLength":2048},"resourceId":{"type":"string","minLength":1,"maxLength":120},"revisionId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240}},"required":["license","attribution","sourceReference","resourceId","revisionId","label"]}},"result":{"type":"object","properties":{"durationUs":{"type":"integer","nullable":true,"minimum":0},"sizeBytes":{"type":"integer","nullable":true,"minimum":0},"state":{"type":"string","enum":["pending","available","expired","none"]}},"required":["durationUs","sizeBytes","state"]},"retriedFromRenderId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true}},"required":["id","projectId","timelineId","requestedRevision","manifestVersion","compositionVersion","rendererVersion","status","stage","progress","attemptCount","artifactId","errorCode","errorMessage","settings","result","retriedFromRenderId","createdAt","updatedAt","startedAt","completedAt"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/renders":{"get":{"tags":["VideoEditor"],"operationId":"listVideoEditorRenders","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Cursor-paginated render history","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"timelineId":{"type":"string","nullable":true},"requestedRevision":{"type":"integer","minimum":0},"manifestVersion":{"type":"integer","nullable":true},"compositionVersion":{"type":"integer","nullable":true},"rendererVersion":{"type":"string","nullable":true},"status":{"type":"string","enum":["queued","running","completed","failed","canceled"]},"stage":{"type":"string"},"progress":{"type":"integer","minimum":0,"maximum":100},"attemptCount":{"type":"integer","minimum":0},"artifactId":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"settings":{"type":"object","properties":{"resolution":{"type":"string","enum":["source","720p","1080p"]},"width":{"type":"integer","minimum":0,"exclusiveMinimum":true},"height":{"type":"integer","minimum":0,"exclusiveMinimum":true},"fps":{"type":"integer","minimum":0,"exclusiveMinimum":true},"quality":{"type":"string","enum":["draft","standard","high"]},"crf":{"anyOf":[{"type":"number","enum":[18]},{"type":"number","enum":[23]},{"type":"number","enum":[28]}]},"includeAudio":{"type":"boolean"},"burnCaptions":{"type":"boolean"},"filename":{"type":"string"},"container":{"type":"string","enum":["mp4"]},"videoCodec":{"type":"string","enum":["h264"]},"audioCodec":{"type":"string","enum":["aac"]}},"required":["resolution","width","height","fps","quality","crf","includeAudio","burnCaptions","filename","container","videoCodec","audioCodec"]},"resourceCredits":{"type":"array","nullable":true,"items":{"type":"object","properties":{"license":{"type":"string","enum":["CC0-1.0","CC-BY-4.0","AdAnt-owned"]},"attribution":{"type":"string","minLength":1,"maxLength":2000},"sourceReference":{"type":"string","minLength":1,"maxLength":2048},"resourceId":{"type":"string","minLength":1,"maxLength":120},"revisionId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240}},"required":["license","attribution","sourceReference","resourceId","revisionId","label"]}},"result":{"type":"object","properties":{"durationUs":{"type":"integer","nullable":true,"minimum":0},"sizeBytes":{"type":"integer","nullable":true,"minimum":0},"state":{"type":"string","enum":["pending","available","expired","none"]}},"required":["durationUs","sizeBytes","state"]},"retriedFromRenderId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true}},"required":["id","projectId","timelineId","requestedRevision","manifestVersion","compositionVersion","rendererVersion","status","stage","progress","attemptCount","artifactId","errorCode","errorMessage","settings","result","retriedFromRenderId","createdAt","updatedAt","startedAt","completedAt"]}},"nextCursor":{"type":"string","nullable":true}},"required":["items","nextCursor"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/renders/{renderId}":{"get":{"tags":["VideoEditor"],"operationId":"getVideoEditorRender","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"renderId","in":"path"}],"responses":{"200":{"description":"Render stage, result, and structured failure","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"timelineId":{"type":"string","nullable":true},"requestedRevision":{"type":"integer","minimum":0},"manifestVersion":{"type":"integer","nullable":true},"compositionVersion":{"type":"integer","nullable":true},"rendererVersion":{"type":"string","nullable":true},"status":{"type":"string","enum":["queued","running","completed","failed","canceled"]},"stage":{"type":"string"},"progress":{"type":"integer","minimum":0,"maximum":100},"attemptCount":{"type":"integer","minimum":0},"artifactId":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"settings":{"type":"object","properties":{"resolution":{"type":"string","enum":["source","720p","1080p"]},"width":{"type":"integer","minimum":0,"exclusiveMinimum":true},"height":{"type":"integer","minimum":0,"exclusiveMinimum":true},"fps":{"type":"integer","minimum":0,"exclusiveMinimum":true},"quality":{"type":"string","enum":["draft","standard","high"]},"crf":{"anyOf":[{"type":"number","enum":[18]},{"type":"number","enum":[23]},{"type":"number","enum":[28]}]},"includeAudio":{"type":"boolean"},"burnCaptions":{"type":"boolean"},"filename":{"type":"string"},"container":{"type":"string","enum":["mp4"]},"videoCodec":{"type":"string","enum":["h264"]},"audioCodec":{"type":"string","enum":["aac"]}},"required":["resolution","width","height","fps","quality","crf","includeAudio","burnCaptions","filename","container","videoCodec","audioCodec"]},"resourceCredits":{"type":"array","nullable":true,"items":{"type":"object","properties":{"license":{"type":"string","enum":["CC0-1.0","CC-BY-4.0","AdAnt-owned"]},"attribution":{"type":"string","minLength":1,"maxLength":2000},"sourceReference":{"type":"string","minLength":1,"maxLength":2048},"resourceId":{"type":"string","minLength":1,"maxLength":120},"revisionId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240}},"required":["license","attribution","sourceReference","resourceId","revisionId","label"]}},"result":{"type":"object","properties":{"durationUs":{"type":"integer","nullable":true,"minimum":0},"sizeBytes":{"type":"integer","nullable":true,"minimum":0},"state":{"type":"string","enum":["pending","available","expired","none"]}},"required":["durationUs","sizeBytes","state"]},"retriedFromRenderId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true}},"required":["id","projectId","timelineId","requestedRevision","manifestVersion","compositionVersion","rendererVersion","status","stage","progress","attemptCount","artifactId","errorCode","errorMessage","settings","result","retriedFromRenderId","createdAt","updatedAt","startedAt","completedAt"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/renders/{renderId}:cancel":{"post":{"tags":["VideoEditor"],"operationId":"cancelVideoEditorRender","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"renderId","in":"path"}],"responses":{"200":{"description":"Render after requesting cancellation","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"timelineId":{"type":"string","nullable":true},"requestedRevision":{"type":"integer","minimum":0},"manifestVersion":{"type":"integer","nullable":true},"compositionVersion":{"type":"integer","nullable":true},"rendererVersion":{"type":"string","nullable":true},"status":{"type":"string","enum":["queued","running","completed","failed","canceled"]},"stage":{"type":"string"},"progress":{"type":"integer","minimum":0,"maximum":100},"attemptCount":{"type":"integer","minimum":0},"artifactId":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"settings":{"type":"object","properties":{"resolution":{"type":"string","enum":["source","720p","1080p"]},"width":{"type":"integer","minimum":0,"exclusiveMinimum":true},"height":{"type":"integer","minimum":0,"exclusiveMinimum":true},"fps":{"type":"integer","minimum":0,"exclusiveMinimum":true},"quality":{"type":"string","enum":["draft","standard","high"]},"crf":{"anyOf":[{"type":"number","enum":[18]},{"type":"number","enum":[23]},{"type":"number","enum":[28]}]},"includeAudio":{"type":"boolean"},"burnCaptions":{"type":"boolean"},"filename":{"type":"string"},"container":{"type":"string","enum":["mp4"]},"videoCodec":{"type":"string","enum":["h264"]},"audioCodec":{"type":"string","enum":["aac"]}},"required":["resolution","width","height","fps","quality","crf","includeAudio","burnCaptions","filename","container","videoCodec","audioCodec"]},"resourceCredits":{"type":"array","nullable":true,"items":{"type":"object","properties":{"license":{"type":"string","enum":["CC0-1.0","CC-BY-4.0","AdAnt-owned"]},"attribution":{"type":"string","minLength":1,"maxLength":2000},"sourceReference":{"type":"string","minLength":1,"maxLength":2048},"resourceId":{"type":"string","minLength":1,"maxLength":120},"revisionId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240}},"required":["license","attribution","sourceReference","resourceId","revisionId","label"]}},"result":{"type":"object","properties":{"durationUs":{"type":"integer","nullable":true,"minimum":0},"sizeBytes":{"type":"integer","nullable":true,"minimum":0},"state":{"type":"string","enum":["pending","available","expired","none"]}},"required":["durationUs","sizeBytes","state"]},"retriedFromRenderId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true}},"required":["id","projectId","timelineId","requestedRevision","manifestVersion","compositionVersion","rendererVersion","status","stage","progress","attemptCount","artifactId","errorCode","errorMessage","settings","result","retriedFromRenderId","createdAt","updatedAt","startedAt","completedAt"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/renders/{renderId}:retry":{"post":{"tags":["VideoEditor"],"operationId":"retryVideoEditorRender","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"renderId","in":"path"}],"responses":{"202":{"description":"New render attempt from the frozen manifest","content":{"application/json":{"schema":{"type":"object","properties":{"render":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"timelineId":{"type":"string","nullable":true},"requestedRevision":{"type":"integer","minimum":0},"manifestVersion":{"type":"integer","nullable":true},"compositionVersion":{"type":"integer","nullable":true},"rendererVersion":{"type":"string","nullable":true},"status":{"type":"string","enum":["queued","running","completed","failed","canceled"]},"stage":{"type":"string"},"progress":{"type":"integer","minimum":0,"maximum":100},"attemptCount":{"type":"integer","minimum":0},"artifactId":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"settings":{"type":"object","properties":{"resolution":{"type":"string","enum":["source","720p","1080p"]},"width":{"type":"integer","minimum":0,"exclusiveMinimum":true},"height":{"type":"integer","minimum":0,"exclusiveMinimum":true},"fps":{"type":"integer","minimum":0,"exclusiveMinimum":true},"quality":{"type":"string","enum":["draft","standard","high"]},"crf":{"anyOf":[{"type":"number","enum":[18]},{"type":"number","enum":[23]},{"type":"number","enum":[28]}]},"includeAudio":{"type":"boolean"},"burnCaptions":{"type":"boolean"},"filename":{"type":"string"},"container":{"type":"string","enum":["mp4"]},"videoCodec":{"type":"string","enum":["h264"]},"audioCodec":{"type":"string","enum":["aac"]}},"required":["resolution","width","height","fps","quality","crf","includeAudio","burnCaptions","filename","container","videoCodec","audioCodec"]},"resourceCredits":{"type":"array","nullable":true,"items":{"type":"object","properties":{"license":{"type":"string","enum":["CC0-1.0","CC-BY-4.0","AdAnt-owned"]},"attribution":{"type":"string","minLength":1,"maxLength":2000},"sourceReference":{"type":"string","minLength":1,"maxLength":2048},"resourceId":{"type":"string","minLength":1,"maxLength":120},"revisionId":{"type":"string","minLength":1,"maxLength":160},"label":{"type":"string","minLength":1,"maxLength":240}},"required":["license","attribution","sourceReference","resourceId","revisionId","label"]}},"result":{"type":"object","properties":{"durationUs":{"type":"integer","nullable":true,"minimum":0},"sizeBytes":{"type":"integer","nullable":true,"minimum":0},"state":{"type":"string","enum":["pending","available","expired","none"]}},"required":["durationUs","sizeBytes","state"]},"retriedFromRenderId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true}},"required":["id","projectId","timelineId","requestedRevision","manifestVersion","compositionVersion","rendererVersion","status","stage","progress","attemptCount","artifactId","errorCode","errorMessage","settings","result","retriedFromRenderId","createdAt","updatedAt","startedAt","completedAt"]},"retriedFromRenderId":{"type":"string"}},"required":["render","retriedFromRenderId"]}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-editor/projects/{projectId}/events":{"get":{"tags":["VideoEditor"],"operationId":"streamVideoEditorEvents","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"projectId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Authenticated resumable project invalidation stream","content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Request validation or editor command error","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/ApiError"}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Editor revision or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Editor capability unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/connections":{"get":{"tags":["Social publishing"],"operationId":"listSocialConnections","responses":{"200":{"description":"Connected social accounts","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"availablePlatforms":{"type":"array","items":{"type":"string","enum":["tiktok","instagram"]}},"connectAvailable":{"type":"boolean"},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"displayName":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","reconnect"]},"createdAt":{"type":"string"}},"required":["id","platform","displayName","avatarUrl","scopes","status","createdAt"]}}},"required":["configured","availablePlatforms","connectAvailable","connections"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/tiktok/connect":{"post":{"tags":["Social publishing"],"operationId":"beginTikTokOAuth","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"returnTo":{"type":"string","maxLength":500,"default":"/home/settings?tab=social"},"account":{"type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"TikTok authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/tiktok/callback":{"post":{"tags":["Social publishing"],"operationId":"completeTikTokOAuth","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"state":{"type":"string","minLength":1}},"required":["code","state"]}}}},"responses":{"200":{"description":"Connected TikTok account","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"displayName":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","reconnect"]},"createdAt":{"type":"string"}},"required":["id","platform","displayName","avatarUrl","scopes","status","createdAt"]},"returnTo":{"type":"string"}},"required":["connection","returnTo"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/instagram/accounts":{"get":{"tags":["Social publishing"],"operationId":"listInstagramAccountOptions","responses":{"200":{"description":"Instagram accounts the user can pick to connect","content":{"application/json":{"schema":{"type":"object","properties":{"fromFacebook":{"type":"boolean"},"accounts":{"type":"array","items":{"type":"object","properties":{"handle":{"type":"string"},"pageName":{"type":"string","nullable":true},"connected":{"type":"boolean"}},"required":["handle","pageName","connected"]}}},"required":["fromFacebook","accounts"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/instagram/connect":{"post":{"tags":["Social publishing"],"operationId":"beginInstagramOAuth","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"returnTo":{"type":"string","maxLength":500,"default":"/home/settings?tab=social"},"account":{"type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"Instagram authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/instagram/callback":{"post":{"tags":["Social publishing"],"operationId":"completeInstagramOAuth","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"state":{"type":"string","minLength":1}},"required":["code","state"]}}}},"responses":{"200":{"description":"Connected Instagram account","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"displayName":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","reconnect"]},"createdAt":{"type":"string"}},"required":["id","platform","displayName","avatarUrl","scopes","status","createdAt"]},"returnTo":{"type":"string"}},"required":["connection","returnTo"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/connections/{id}":{"delete":{"tags":["Social publishing"],"operationId":"disconnectSocialAccount","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Disconnected","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/connections/{id}/tiktok/creator-info":{"get":{"tags":["Social publishing"],"operationId":"getTikTokCreatorInfo","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Current TikTok posting options","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"nickname":{"type":"string"},"avatarUrl":{"type":"string"},"privacyLevelOptions":{"type":"array","items":{"type":"string"}},"commentDisabled":{"type":"boolean"},"duetDisabled":{"type":"boolean"},"stitchDisabled":{"type":"boolean"},"maxVideoPostDurationSec":{"type":"number"}},"required":["username","nickname","avatarUrl","privacyLevelOptions","commentDisabled","duetDisabled","stitchDisabled","maxVideoPostDurationSec"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/posts":{"get":{"tags":["Social publishing"],"operationId":"listSocialPosts","responses":{"200":{"description":"Scheduled and recent posts","content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"videoSource":{"type":"string","enum":["artifact","drive"]},"artifactId":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string"},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandContent":{"type":"boolean"},"isAigc":{"type":"boolean"},"shareToFeed":{"type":"boolean"},"scheduledAt":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["scheduled","uploading","processing","in_user_inbox","posted","failed","cancelled","awaiting_reconnect"]},"publishId":{"type":"string","nullable":true},"platformPostIds":{"type":"array","items":{"type":"string"}},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","connectionId","videoSource","artifactId","platform","mode","caption","privacyLevel","disableComment","disableDuet","disableStitch","brandOrganic","brandContent","isAigc","shareToFeed","scheduledAt","timezone","status","publishId","platformPostIds","lastError","createdAt","updatedAt"]}}},"required":["posts"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Social publishing"],"operationId":"createSocialPost","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string","minLength":1},"videoSource":{"type":"string","enum":["artifact","drive"],"default":"artifact"},"artifactId":{"type":"string","minLength":1},"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string","maxLength":2200,"default":""},"durationSeconds":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean","default":true},"disableDuet":{"type":"boolean","default":true},"disableStitch":{"type":"boolean","default":true},"brandOrganic":{"type":"boolean","default":false},"brandContent":{"type":"boolean","default":false},"isAigc":{"type":"boolean","default":false},"shareToFeed":{"type":"boolean","default":true},"scheduledAt":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"consent":{"type":"boolean","enum":[true]}},"required":["connectionId","artifactId","mode","scheduledAt","timezone","consent"]}}}},"responses":{"200":{"description":"Scheduled post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"videoSource":{"type":"string","enum":["artifact","drive"]},"artifactId":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string"},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandContent":{"type":"boolean"},"isAigc":{"type":"boolean"},"shareToFeed":{"type":"boolean"},"scheduledAt":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["scheduled","uploading","processing","in_user_inbox","posted","failed","cancelled","awaiting_reconnect"]},"publishId":{"type":"string","nullable":true},"platformPostIds":{"type":"array","items":{"type":"string"}},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","connectionId","videoSource","artifactId","platform","mode","caption","privacyLevel","disableComment","disableDuet","disableStitch","brandOrganic","brandContent","isAigc","shareToFeed","scheduledAt","timezone","status","publishId","platformPostIds","lastError","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/posts/{id}":{"patch":{"tags":["Social publishing"],"operationId":"updateSocialPost","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string","maxLength":2200},"durationSeconds":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandContent":{"type":"boolean"},"isAigc":{"type":"boolean"},"shareToFeed":{"type":"boolean"},"scheduledAt":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Updated scheduled post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"videoSource":{"type":"string","enum":["artifact","drive"]},"artifactId":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string"},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandContent":{"type":"boolean"},"isAigc":{"type":"boolean"},"shareToFeed":{"type":"boolean"},"scheduledAt":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["scheduled","uploading","processing","in_user_inbox","posted","failed","cancelled","awaiting_reconnect"]},"publishId":{"type":"string","nullable":true},"platformPostIds":{"type":"array","items":{"type":"string"}},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","connectionId","videoSource","artifactId","platform","mode","caption","privacyLevel","disableComment","disableDuet","disableStitch","brandOrganic","brandContent","isAigc","shareToFeed","scheduledAt","timezone","status","publishId","platformPostIds","lastError","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/posts/{id}/cancel":{"post":{"tags":["Social publishing"],"operationId":"cancelSocialPost","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Cancelled post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"videoSource":{"type":"string","enum":["artifact","drive"]},"artifactId":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string"},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandContent":{"type":"boolean"},"isAigc":{"type":"boolean"},"shareToFeed":{"type":"boolean"},"scheduledAt":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["scheduled","uploading","processing","in_user_inbox","posted","failed","cancelled","awaiting_reconnect"]},"publishId":{"type":"string","nullable":true},"platformPostIds":{"type":"array","items":{"type":"string"}},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","connectionId","videoSource","artifactId","platform","mode","caption","privacyLevel","disableComment","disableDuet","disableStitch","brandOrganic","brandContent","isAigc","shareToFeed","scheduledAt","timezone","status","publishId","platformPostIds","lastError","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/social/captions/suggest":{"post":{"tags":["Social publishing"],"operationId":"suggestSocialCaption","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","instagram"]},"videoSource":{"type":"string","enum":["artifact","drive"],"default":"artifact"},"artifactId":{"type":"string","minLength":1},"avoid":{"type":"string","maxLength":2200}},"required":["platform","artifactId"]}}}},"responses":{"200":{"description":"A suggested caption for the video on that platform","content":{"application/json":{"schema":{"type":"object","properties":{"caption":{"type":"string"}},"required":["caption"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/scheduled-tasks":{"get":{"tags":["Scheduled tasks"],"operationId":"listScheduledTasks","summary":"List the caller's scheduled agent tasks","responses":{"200":{"description":"Scheduled tasks, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening","social_management"]},"agentKey":{"type":"string"},"instruction":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]}},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"lastRunStatus":{"type":"string","nullable":true,"enum":["queued","running","succeeded","failed","canceled",null]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","category","agentKey","instruction","mentions","schedule","notifyEmails","enabled","nextRunAt","lastRunAt","lastRunStatus","createdAt","updatedAt"]}}},"required":["tasks"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Scheduled tasks"],"operationId":"createScheduledTask","summary":"Schedule an agent task at a recurring cadence","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening"]},"instruction":{"type":"string","minLength":1,"maxLength":8000},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]},"maxItems":10,"default":[]},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string","maxLength":254,"format":"email"},"maxItems":5,"default":[]},"enabled":{"type":"boolean","default":true}},"required":["title","category","instruction","schedule"]}}}},"responses":{"201":{"description":"The scheduled task","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening","social_management"]},"agentKey":{"type":"string"},"instruction":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]}},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"lastRunStatus":{"type":"string","nullable":true,"enum":["queued","running","succeeded","failed","canceled",null]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","category","agentKey","instruction","mentions","schedule","notifyEmails","enabled","nextRunAt","lastRunAt","lastRunStatus","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/scheduled-tasks/runs":{"get":{"tags":["Scheduled tasks"],"operationId":"listScheduledTaskRuns","summary":"List runs across the caller's tasks inside a time window","parameters":[{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Runs whose slot falls inside the window","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"taskId":{"type":"string"},"trigger":{"type":"string","enum":["schedule","manual"]},"scheduledFor":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"brainSessionId":{"type":"string","nullable":true},"turnId":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"notifiedAt":{"type":"string","nullable":true},"notifyError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","taskId","trigger","scheduledFor","status","startedAt","finishedAt","brainSessionId","turnId","summary","error","notifiedAt","notifyError","createdAt","updatedAt"]}}},"required":["runs"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/scheduled-tasks/{id}":{"get":{"tags":["Scheduled tasks"],"operationId":"getScheduledTask","summary":"Read one scheduled task with its recent runs","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The task and its most recent runs","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening","social_management"]},"agentKey":{"type":"string"},"instruction":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]}},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"lastRunStatus":{"type":"string","nullable":true,"enum":["queued","running","succeeded","failed","canceled",null]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"taskId":{"type":"string"},"trigger":{"type":"string","enum":["schedule","manual"]},"scheduledFor":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"brainSessionId":{"type":"string","nullable":true},"turnId":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"notifiedAt":{"type":"string","nullable":true},"notifyError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","taskId","trigger","scheduledFor","status","startedAt","finishedAt","brainSessionId","turnId","summary","error","notifiedAt","notifyError","createdAt","updatedAt"]}}},"required":["id","title","category","agentKey","instruction","mentions","schedule","notifyEmails","enabled","nextRunAt","lastRunAt","lastRunStatus","createdAt","updatedAt","runs"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Scheduled tasks"],"operationId":"updateScheduledTask","summary":"Change a task's instruction, cadence, recipients, or pause it","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening"]},"instruction":{"type":"string","minLength":1,"maxLength":8000},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]},"maxItems":10},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string","maxLength":254,"format":"email"},"maxItems":5},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The updated task","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening","social_management"]},"agentKey":{"type":"string"},"instruction":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]}},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"lastRunStatus":{"type":"string","nullable":true,"enum":["queued","running","succeeded","failed","canceled",null]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","category","agentKey","instruction","mentions","schedule","notifyEmails","enabled","nextRunAt","lastRunAt","lastRunStatus","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"The run in progress could not be stopped, so the task was not changed. Retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Scheduled tasks"],"operationId":"deleteScheduledTask","summary":"Delete a scheduled task and its run history","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"The run in progress could not be stopped, so the task was not changed. Retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/scheduled-tasks/{id}/run":{"post":{"tags":["Scheduled tasks"],"operationId":"runScheduledTaskNow","summary":"Start a run immediately, outside the cadence","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"The queued run","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"taskId":{"type":"string"},"trigger":{"type":"string","enum":["schedule","manual"]},"scheduledFor":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"brainSessionId":{"type":"string","nullable":true},"turnId":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"notifiedAt":{"type":"string","nullable":true},"notifyError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","taskId","trigger","scheduledFor","status","startedAt","finishedAt","brainSessionId","turnId","summary","error","notifiedAt","notifyError","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/scheduled-tasks/stats":{"get":{"tags":["Admin"],"operationId":"adminGetScheduledTaskStats","summary":"Scheduled-task adoption metrics","description":"Tasks scheduled (today, all-time, enabled, by category, 30-day trend) and successful runs, across every live account (admin only).","responses":{"200":{"description":"Scheduled-task metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminScheduledTaskStats"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/scheduled-tasks/recent":{"get":{"tags":["Admin"],"operationId":"adminListRecentScheduledTasks","summary":"Recently scheduled tasks and who scheduled them","description":"Tasks created in the last `days` UTC days (default today), newest first, with the scheduling account, plus the window's total and the number of distinct accounts (admin only). Suspended accounts are excluded.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":90},"required":false,"name":"days","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Recently scheduled tasks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRecentScheduledTasks"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/meta-ads/connection":{"get":{"tags":["Meta Ads"],"operationId":"getMetaAdsConnection","responses":{"200":{"description":"The Meta ads connection","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"connection":{"$ref":"#/components/schemas/MetaAdsConnection"}},"required":["configured","connection"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Meta Ads"],"operationId":"selectMetaAdsAssets","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adAccountId":{"type":"string","pattern":"^act_\\d+$"},"pageId":{"type":"string","pattern":"^\\d+$"},"instagramUserId":{"type":"string","nullable":true,"pattern":"^\\d+$"}},"required":["adAccountId","pageId","instagramUserId"]}}}},"responses":{"200":{"description":"The chosen ad account, Page and Instagram account","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/MetaAdsConnection"}},"required":["connection"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Meta Ads"],"operationId":"disconnectMetaAds","responses":{"200":{"description":"Disconnected","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/meta-ads/oauth/begin":{"post":{"tags":["Meta Ads"],"operationId":"beginMetaAdsOAuth","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"returnTo":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"Facebook Login URL","content":{"application/json":{"schema":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"expiresInMinutes":{"type":"number"}},"required":["authorizationUrl","expiresInMinutes"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/meta-ads/oauth/complete":{"post":{"tags":["Meta Ads"],"operationId":"completeMetaAdsOAuth","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":2000},"state":{"type":"string","minLength":1,"maxLength":200}},"required":["code","state"]}}}},"responses":{"200":{"description":"Connected","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"$ref":"#/components/schemas/MetaAdsConnection"},"returnTo":{"type":"string"}},"required":["connection","returnTo"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/meta-ads/assets":{"get":{"tags":["Meta Ads"],"operationId":"listMetaAdsAssets","responses":{"200":{"description":"Ad accounts and Pages to choose","content":{"application/json":{"schema":{"type":"object","properties":{"adAccounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"},"accountStatus":{"type":"number"},"timezone":{"type":"string","nullable":true}},"required":["id","name","currency","accountStatus","timezone"]}},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"instagram":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"username":{"type":"string","nullable":true}},"required":["id","username"]}},"required":["id","name","instagram"]}}},"required":["adAccounts","pages"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/status":{"get":{"operationId":"getAdsAgentStatus","tags":["ads-agent"],"summary":"The Meta ads connection and what is still missing","description":"Requires a Brain session token and the meta-ads-agent feature flag.","responses":{"200":{"description":"Connection status","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"connection":{"$ref":"#/components/schemas/MetaAdsConnection"},"ready":{"type":"boolean"},"missing":{"type":"array","items":{"type":"string"}},"maxDailyBudget":{"type":"number"}},"required":["configured","connection","ready","missing","maxDailyBudget"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"setAdsAgentStatus","tags":["ads-agent"],"summary":"Turn a campaign, ad set or ad ACTIVE or PAUSED","description":"Requires a Brain session token and the meta-ads-agent feature flag. ACTIVE starts spending the user's ad budget.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"objectType":{"type":"string","enum":["campaign","adset","ad"]},"objectId":{"type":"string","pattern":"^\\d+$"},"status":{"type":"string","enum":["ACTIVE","PAUSED"]}},"required":["objectType","objectId","status"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"objectType":{"type":"string","enum":["campaign","adset","ad"]},"objectId":{"type":"string","pattern":"^\\d+$"},"status":{"type":"string","enum":["ACTIVE","PAUSED"]},"updated":{"type":"boolean","enum":[true]}},"required":["objectType","objectId","status","updated"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/connect":{"post":{"operationId":"connectAdsAgentAccount","tags":["ads-agent"],"summary":"Begin connecting a Meta ad account","description":"Requires a Brain session token and the meta-ads-agent feature flag. Answers the Facebook Login URL; the user opens it themselves.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"returnTo":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"Facebook Login URL","content":{"application/json":{"schema":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"expiresInMinutes":{"type":"number"}},"required":["authorizationUrl","expiresInMinutes"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/creatives":{"get":{"operationId":"listAdsAgentCreatives","tags":["ads-agent"],"summary":"Library videos and Instagram posts that can run as ads","description":"Requires a Brain session token and the meta-ads-agent feature flag.","responses":{"200":{"description":"Creatives","content":{"application/json":{"schema":{"type":"object","properties":{"libraryVideos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["artifact","drive","upload"]},"title":{"type":"string"},"detail":{"type":"string"},"createdAt":{"type":"string"},"durationSeconds":{"type":"number","nullable":true},"generated":{"type":"boolean"}},"required":["id","source","title","detail","createdAt","durationSeconds","generated"]}},"instagramPosts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"caption":{"type":"string"},"mediaType":{"type":"string"},"productType":{"type":"string","nullable":true},"permalink":{"type":"string","nullable":true},"thumbnailUrl":{"type":"string","nullable":true},"timestamp":{"type":"string","nullable":true},"likeCount":{"type":"number","nullable":true},"commentsCount":{"type":"number","nullable":true}},"required":["id","caption","mediaType","productType","permalink","thumbnailUrl","timestamp","likeCount","commentsCount"]}},"instagramError":{"type":"string","nullable":true}},"required":["libraryVideos","instagramPosts","instagramError"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/videos/{id}":{"get":{"operationId":"getAdsAgentVideo","tags":["ads-agent"],"summary":"Whether an uploaded video is ready","description":"Requires a Brain session token and the meta-ads-agent feature flag.","parameters":[{"schema":{"type":"string","pattern":"^\\d+$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The video on Meta","content":{"application/json":{"schema":{"type":"object","properties":{"metaVideoId":{"type":"string"},"status":{"type":"string"},"ready":{"type":"boolean"},"thumbnailUrl":{"type":"string","nullable":true},"error":{"type":"string","nullable":true}},"required":["metaVideoId","status","ready","thumbnailUrl","error"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/campaigns":{"get":{"operationId":"listAdsAgentCampaigns","tags":["ads-agent"],"summary":"Campaigns in the chosen ad account with delivery","description":"Requires a Brain session token and the meta-ads-agent feature flag.","parameters":[{"schema":{"type":"string","enum":["today","yesterday","last_7d","last_14d","last_30d","maximum"],"default":"last_7d"},"required":false,"name":"datePreset","in":"query"}],"responses":{"200":{"description":"Campaigns","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string"},"datePreset":{"type":"string","enum":["today","yesterday","last_7d","last_14d","last_30d","maximum"]},"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"objective":{"type":"string"},"status":{"type":"string"},"effectiveStatus":{"type":"string"},"dailyBudget":{"type":"number","nullable":true},"createdAt":{"type":"string","nullable":true},"insights":{"type":"object","nullable":true,"properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"type":"number"},"clicks":{"type":"number"},"ctr":{"type":"number","nullable":true},"cpc":{"type":"number","nullable":true},"cpm":{"type":"number","nullable":true},"linkClicks":{"type":"number"},"landingPageViews":{"type":"number"},"videoViews":{"type":"number"},"postEngagement":{"type":"number"}},"required":["spend","impressions","reach","clicks","ctr","cpc","cpm","linkClicks","landingPageViews","videoViews","postEngagement"]}},"required":["id","name","objective","status","effectiveStatus","dailyBudget","createdAt","insights"]}}},"required":["currency","datePreset","campaigns"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/campaigns/{id}/ads":{"get":{"operationId":"listAdsAgentCampaignAds","tags":["ads-agent"],"summary":"A campaign's ads with their copy and delivery","description":"Requires a Brain session token and the meta-ads-agent feature flag.","parameters":[{"schema":{"type":"string","pattern":"^\\d+$"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["today","yesterday","last_7d","last_14d","last_30d","maximum"],"default":"last_7d"},"required":false,"name":"datePreset","in":"query"}],"responses":{"200":{"description":"Ads","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string"},"datePreset":{"type":"string","enum":["today","yesterday","last_7d","last_14d","last_30d","maximum"]},"ads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"effectiveStatus":{"type":"string"},"adSetId":{"type":"string"},"adSetDailyBudget":{"type":"number","nullable":true},"creative":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"body":{"type":"string","nullable":true},"callToAction":{"type":"string","nullable":true},"thumbnailUrl":{"type":"string","nullable":true}},"required":["id","title","body","callToAction","thumbnailUrl"]},"insights":{"type":"object","nullable":true,"properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"type":"number"},"clicks":{"type":"number"},"ctr":{"type":"number","nullable":true},"cpc":{"type":"number","nullable":true},"cpm":{"type":"number","nullable":true},"linkClicks":{"type":"number"},"landingPageViews":{"type":"number"},"videoViews":{"type":"number"},"postEngagement":{"type":"number"}},"required":["spend","impressions","reach","clicks","ctr","cpc","cpm","linkClicks","landingPageViews","videoViews","postEngagement"]}},"required":["id","name","status","effectiveStatus","adSetId","adSetDailyBudget","creative","insights"]}}},"required":["currency","datePreset","ads"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/identities":{"get":{"operationId":"listAdsAgentIdentities","tags":["ads-agent"],"summary":"The Pages (with their Instagram accounts) ads can run as","description":"Requires a Brain session token and the meta-ads-agent feature flag.","responses":{"200":{"description":"Identities","content":{"application/json":{"schema":{"type":"object","properties":{"identities":{"type":"array","items":{"type":"object","properties":{"pageId":{"type":"string"},"pageName":{"type":"string"},"instagramUserId":{"type":"string","nullable":true},"instagramUsername":{"type":"string","nullable":true},"isDefault":{"type":"boolean"}},"required":["pageId","pageName","instagramUserId","instagramUsername","isDefault"]}}},"required":["identities"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/campaigns/{id}/summary":{"get":{"operationId":"getAdsAgentCampaignSummary","tags":["ads-agent"],"summary":"A campaign's ad sets and ads as Meta holds them, for review","description":"Requires a Brain session token and the meta-ads-agent feature flag.","parameters":[{"schema":{"type":"string","pattern":"^\\d+$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Campaign summary","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"objective":{"type":"string"},"status":{"type":"string"},"effectiveStatus":{"type":"string"},"currency":{"type":"string"},"adAccountId":{"type":"string"},"adAccountName":{"type":"string","nullable":true},"adSets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"effectiveStatus":{"type":"string"},"dailyBudget":{"type":"number","nullable":true},"endTime":{"type":"string","nullable":true},"countries":{"type":"array","items":{"type":"string"}},"ageMin":{"type":"number","nullable":true},"ageMax":{"type":"number","nullable":true},"optimizationGoal":{"type":"string","nullable":true}},"required":["id","name","status","effectiveStatus","dailyBudget","endTime","countries","ageMin","ageMax","optimizationGoal"]}},"ads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"effectiveStatus":{"type":"string"},"adSetId":{"type":"string"},"title":{"type":"string","nullable":true},"body":{"type":"string","nullable":true},"callToAction":{"type":"string","nullable":true},"thumbnailUrl":{"type":"string","nullable":true}},"required":["id","name","status","effectiveStatus","adSetId","title","body","callToAction","thumbnailUrl"]}},"dailySpendCap":{"type":"number"},"adsManagerUrl":{"type":"string"}},"required":["id","name","objective","status","effectiveStatus","currency","adAccountId","adAccountName","adSets","ads","dailySpendCap","adsManagerUrl"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/report":{"get":{"operationId":"getAdsAgentReport","tags":["ads-agent"],"summary":"Every ad on the account with its status and numbers","description":"Requires a Brain session token and the meta-ads-agent feature flag.","parameters":[{"schema":{"type":"string","enum":["today","yesterday","last_7d","last_14d","last_30d","maximum"],"default":"last_7d"},"required":false,"name":"datePreset","in":"query"}],"responses":{"200":{"description":"Status report","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["meta"]},"currency":{"type":"string"},"datePreset":{"type":"string","enum":["today","yesterday","last_7d","last_14d","last_30d","maximum"]},"generatedAt":{"type":"string"},"adAccountId":{"type":"string"},"adAccountName":{"type":"string","nullable":true},"totals":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"type":"number"},"clicks":{"type":"number"},"linkClicks":{"type":"number"},"ctr":{"type":"number","nullable":true},"cpc":{"type":"number","nullable":true},"cpm":{"type":"number","nullable":true}},"required":["spend","impressions","reach","clicks","linkClicks","ctr","cpc","cpm"]},"counts":{"type":"object","properties":{"running":{"type":"number"},"paused":{"type":"number"},"inReview":{"type":"number"},"issues":{"type":"number"}},"required":["running","paused","inReview","issues"]},"rows":{"type":"array","items":{"type":"object","properties":{"adId":{"type":"string"},"adName":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"adSetId":{"type":"string"},"status":{"type":"string"},"effectiveStatus":{"type":"string"},"dailyBudget":{"type":"number","nullable":true},"thumbnailUrl":{"type":"string","nullable":true},"insights":{"type":"object","nullable":true,"properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"type":"number"},"clicks":{"type":"number"},"ctr":{"type":"number","nullable":true},"cpc":{"type":"number","nullable":true},"cpm":{"type":"number","nullable":true},"linkClicks":{"type":"number"},"landingPageViews":{"type":"number"},"videoViews":{"type":"number"},"postEngagement":{"type":"number"}},"required":["spend","impressions","reach","clicks","ctr","cpc","cpm","linkClicks","landingPageViews","videoViews","postEngagement"]}},"required":["adId","adName","campaignId","campaignName","adSetId","status","effectiveStatus","dailyBudget","thumbnailUrl","insights"]}},"adsManagerUrl":{"type":"string"}},"required":["platform","currency","datePreset","generatedAt","adAccountId","adAccountName","totals","counts","rows","adsManagerUrl"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/competitor-ads":{"post":{"operationId":"searchAdsAgentCompetitorAds","tags":["ads-agent"],"summary":"Competitors' active ads from the Meta Ad Library, with their copy","description":"Requires a Brain session token and the meta-ads-agent feature flag. Billed in credits like a content-research collection.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queries":{"type":"array","items":{"type":"string","minLength":2,"maxLength":100},"minItems":1,"maxItems":5},"limitPerQuery":{"type":"integer","minimum":1,"maximum":20}},"required":["queries"]}}}},"responses":{"200":{"description":"Competitor ads","content":{"application/json":{"schema":{"type":"object","properties":{"ads":{"type":"array","items":{"type":"object","properties":{"advertiser":{"type":"string","nullable":true},"bodyText":{"type":"string"},"startedAt":{"type":"string","nullable":true},"daysRunning":{"type":"number","nullable":true},"isActive":{"type":"boolean","nullable":true},"publisherPlatforms":{"type":"array","items":{"type":"string"}},"thumbnailUrl":{"type":"string","nullable":true},"format":{"type":"string","enum":["video","image","other"]},"url":{"type":"string"}},"required":["advertiser","bodyText","startedAt","daysRunning","isActive","publisherPlatforms","thumbnailUrl","format","url"]}},"creditsCharged":{"type":"number"},"gaps":{"type":"array","items":{"type":"string"}}},"required":["ads","creditsCharged","gaps"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/videos":{"post":{"operationId":"uploadAdsAgentVideo","tags":["ads-agent"],"summary":"Upload a library video into the ad account","description":"Requires a Brain session token and the meta-ads-agent feature flag. Waits up to 90 seconds for Meta to process it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"videoSource":{"type":"string","enum":["artifact","drive","upload"]},"videoId":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":200}},"required":["videoSource","videoId"]}}}},"responses":{"200":{"description":"The video on Meta","content":{"application/json":{"schema":{"type":"object","properties":{"metaVideoId":{"type":"string"},"status":{"type":"string"},"ready":{"type":"boolean"},"thumbnailUrl":{"type":"string","nullable":true},"error":{"type":"string","nullable":true}},"required":["metaVideoId","status","ready","thumbnailUrl","error"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/launch":{"post":{"operationId":"launchAdsAgentCampaign","tags":["ads-agent"],"summary":"Create a campaign, ad set, creative and ad — all paused","description":"Requires a Brain session token and the meta-ads-agent feature flag.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"objective":{"type":"string","enum":["OUTCOME_TRAFFIC","OUTCOME_AWARENESS"]},"dailyBudget":{"type":"number","minimum":0,"exclusiveMinimum":true},"targeting":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"},"minItems":1,"maxItems":25},"ageMin":{"type":"integer","minimum":18,"maximum":65},"ageMax":{"type":"integer","minimum":18,"maximum":65}},"required":["countries"]},"creative":{"oneOf":[{"type":"object","properties":{"source":{"type":"string","enum":["meta_video"]},"metaVideoId":{"type":"string","pattern":"^\\d+$"}},"required":["source","metaVideoId"]},{"type":"object","properties":{"source":{"type":"string","enum":["instagram"]},"mediaId":{"type":"string","pattern":"^\\d+$"}},"required":["source","mediaId"]},{"type":"object","properties":{"source":{"type":"string","enum":["library"]},"videoSource":{"type":"string","enum":["artifact","drive","upload"]},"videoId":{"type":"string","minLength":1,"maxLength":200}},"required":["source","videoSource","videoId"]}]},"copy":{"type":"object","properties":{"primaryText":{"type":"string","minLength":1,"maxLength":2200},"headline":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","maxLength":255},"callToAction":{"type":"string","enum":["LEARN_MORE","SHOP_NOW","SIGN_UP","DOWNLOAD","GET_OFFER","ORDER_NOW","BOOK_NOW","CONTACT_US","SUBSCRIBE","WATCH_MORE"]},"linkUrl":{"type":"string","format":"uri"}},"required":["primaryText","headline","callToAction","linkUrl"]},"identity":{"type":"object","properties":{"pageId":{"type":"string","pattern":"^\\d+$"},"instagramUserId":{"type":"string","nullable":true,"pattern":"^\\d+$"}},"required":["pageId","instagramUserId"]},"endTime":{"type":"string","format":"date-time"}},"required":["name","objective","dailyBudget","targeting","creative","copy"]}}}},"responses":{"200":{"description":"The paused campaign","content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":"string"},"adSetId":{"type":"string"},"creativeId":{"type":"string"},"adId":{"type":"string"},"status":{"type":"string","enum":["PAUSED"]},"adsManagerUrl":{"type":"string"}},"required":["campaignId","adSetId","creativeId","adId","status","adsManagerUrl"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/variants":{"post":{"operationId":"addAdsAgentVariant","tags":["ads-agent"],"summary":"Add a paused ad with new copy or creative to an ad set","description":"Requires a Brain session token and the meta-ads-agent feature flag.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adSetId":{"type":"string","pattern":"^\\d+$"},"name":{"type":"string","minLength":1,"maxLength":200},"creative":{"oneOf":[{"type":"object","properties":{"source":{"type":"string","enum":["meta_video"]},"metaVideoId":{"type":"string","pattern":"^\\d+$"}},"required":["source","metaVideoId"]},{"type":"object","properties":{"source":{"type":"string","enum":["instagram"]},"mediaId":{"type":"string","pattern":"^\\d+$"}},"required":["source","mediaId"]},{"type":"object","properties":{"source":{"type":"string","enum":["library"]},"videoSource":{"type":"string","enum":["artifact","drive","upload"]},"videoId":{"type":"string","minLength":1,"maxLength":200}},"required":["source","videoSource","videoId"]}]},"copy":{"type":"object","properties":{"primaryText":{"type":"string","minLength":1,"maxLength":2200},"headline":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","maxLength":255},"callToAction":{"type":"string","enum":["LEARN_MORE","SHOP_NOW","SIGN_UP","DOWNLOAD","GET_OFFER","ORDER_NOW","BOOK_NOW","CONTACT_US","SUBSCRIBE","WATCH_MORE"]},"linkUrl":{"type":"string","format":"uri"}},"required":["primaryText","headline","callToAction","linkUrl"]}},"required":["adSetId","name","creative","copy"]}}}},"responses":{"200":{"description":"The paused ad","content":{"application/json":{"schema":{"type":"object","properties":{"creativeId":{"type":"string"},"adId":{"type":"string"},"status":{"type":"string","enum":["PAUSED"]}},"required":["creativeId","adId","status"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/campaigns/{id}/go-live":{"post":{"operationId":"goLiveAdsAgentCampaign","tags":["ads-agent"],"summary":"Turn a paused campaign on: its ads, ad sets, then the campaign","description":"Requires a Brain session token and the meta-ads-agent feature flag. Starts spending the user's ad budget; refused above the daily ceiling.","parameters":[{"schema":{"type":"string","pattern":"^\\d+$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dailyBudget":{"type":"number","minimum":0,"exclusiveMinimum":true}}}}}},"responses":{"200":{"description":"The campaign is on","content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":"string"},"status":{"type":"string","enum":["ACTIVE"]},"activated":{"type":"object","properties":{"adSets":{"type":"array","items":{"type":"string"}},"ads":{"type":"array","items":{"type":"string"}}},"required":["adSets","ads"]},"dailySpendCap":{"type":"number"},"currency":{"type":"string"},"adsManagerUrl":{"type":"string"}},"required":["campaignId","status","activated","dailySpendCap","currency","adsManagerUrl"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ads/budget":{"post":{"operationId":"setAdsAgentBudget","tags":["ads-agent"],"summary":"Change an ad set's daily budget","description":"Requires a Brain session token and the meta-ads-agent feature flag.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adSetId":{"type":"string","pattern":"^\\d+$"},"dailyBudget":{"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["adSetId","dailyBudget"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"adSetId":{"type":"string","pattern":"^\\d+$"},"dailyBudget":{"type":"number","minimum":0,"exclusiveMinimum":true},"currency":{"type":"string"},"updated":{"type":"boolean","enum":[true]}},"required":["adSetId","dailyBudget","currency","updated"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/accounts":{"get":{"operationId":"listSocialAgentAccounts","tags":["social-agent"],"summary":"Connected social accounts with live creator settings","description":"Requires a Brain session token and the social-manager feature flag.","responses":{"200":{"description":"Connected accounts","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"type":"boolean"},"availablePlatforms":{"type":"array","items":{"type":"string","enum":["tiktok","instagram"]}},"connectAvailable":{"type":"boolean"},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"displayName":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","reconnect"]},"createdAt":{"type":"string"},"creator":{"type":"object","nullable":true,"properties":{"username":{"type":"string"},"nickname":{"type":"string"},"avatarUrl":{"type":"string"},"privacyLevelOptions":{"type":"array","items":{"type":"string"}},"commentDisabled":{"type":"boolean"},"duetDisabled":{"type":"boolean"},"stitchDisabled":{"type":"boolean"},"maxVideoPostDurationSec":{"type":"number"}},"required":["username","nickname","avatarUrl","privacyLevelOptions","commentDisabled","duetDisabled","stitchDisabled","maxVideoPostDurationSec"]},"creatorError":{"type":"string","nullable":true},"postDefaults":{"type":"object","nullable":true,"properties":{"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"shareToFeed":{"type":"boolean"}},"required":["privacyLevel","disableComment","disableDuet","disableStitch","shareToFeed"]}},"required":["id","platform","displayName","avatarUrl","scopes","status","createdAt","creator","creatorError","postDefaults"]}}},"required":["configured","availablePlatforms","connectAvailable","connections"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/accounts/connect":{"post":{"operationId":"connectSocialAgentAccount","tags":["social-agent"],"summary":"Begin connecting a TikTok or Instagram account","description":"Requires a Brain session token and the social-manager feature flag. Answers the platform's authorization URL; the user opens it themselves and lands on `returnTo` once the platform hands the account back. Connecting is in beta: an account outside it is refused (403) and the listing says so first (`connectAvailable: false`).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","instagram"]},"returnTo":{"type":"string","maxLength":2000,"default":"/home/settings?tab=social"},"account":{"type":"string","maxLength":200}},"required":["platform"]}}}},"responses":{"200":{"description":"Where the user authorizes the connection","content":{"application/json":{"schema":{"type":"object","properties":{"authorizationUrl":{"type":"string"},"expiresInMinutes":{"type":"number"}},"required":["authorizationUrl","expiresInMinutes"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/accounts/{id}":{"delete":{"operationId":"disconnectSocialAgentAccount","tags":["social-agent"],"summary":"Disconnect a social account the user confirmed in chat","description":"Requires a Brain session token and the social-manager feature flag.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Disconnected","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/videos":{"get":{"operationId":"listSocialAgentVideos","tags":["social-agent"],"summary":"Library videos that can be scheduled to a social account","description":"Requires a Brain session token and the social-manager feature flag.","responses":{"200":{"description":"Publishable videos, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"videos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["artifact","drive"]},"title":{"type":"string"},"detail":{"type":"string"},"createdAt":{"type":"string"},"durationSeconds":{"type":"number","nullable":true},"generated":{"type":"boolean"}},"required":["id","source","title","detail","createdAt","durationSeconds","generated"]}}},"required":["videos"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/posts":{"get":{"operationId":"listSocialAgentPosts","tags":["social-agent"],"summary":"Scheduled and recent social posts","description":"Requires a Brain session token and the social-manager feature flag.","responses":{"200":{"description":"Posts","content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"videoSource":{"type":"string","enum":["artifact","drive"]},"artifactId":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string"},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandContent":{"type":"boolean"},"isAigc":{"type":"boolean"},"shareToFeed":{"type":"boolean"},"scheduledAt":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["scheduled","uploading","processing","in_user_inbox","posted","failed","cancelled","awaiting_reconnect"]},"publishId":{"type":"string","nullable":true},"platformPostIds":{"type":"array","items":{"type":"string"}},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","connectionId","videoSource","artifactId","platform","mode","caption","privacyLevel","disableComment","disableDuet","disableStitch","brandOrganic","brandContent","isAigc","shareToFeed","scheduledAt","timezone","status","publishId","platformPostIds","lastError","createdAt","updatedAt"]}}},"required":["posts"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"scheduleSocialAgentPost","tags":["social-agent"],"summary":"Schedule a post the user confirmed in chat","description":"Requires a Brain session token and the social-manager feature flag. `consent` is the user's click on the in-chat confirmation card; a post with the same account, video, and time already scheduled is refused (409).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string","minLength":1},"videoSource":{"type":"string","enum":["artifact","drive"],"default":"artifact"},"artifactId":{"type":"string","minLength":1},"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string","maxLength":2200,"default":""},"durationSeconds":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean","default":true},"disableDuet":{"type":"boolean","default":true},"disableStitch":{"type":"boolean","default":true},"brandOrganic":{"type":"boolean","default":false},"brandContent":{"type":"boolean","default":false},"isAigc":{"type":"boolean","default":false},"shareToFeed":{"type":"boolean","default":true},"scheduledAt":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100},"consent":{"type":"boolean","enum":[true]}},"required":["connectionId","artifactId","mode","scheduledAt","timezone","consent"]}}}},"responses":{"200":{"description":"Scheduled post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"videoSource":{"type":"string","enum":["artifact","drive"]},"artifactId":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string"},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandContent":{"type":"boolean"},"isAigc":{"type":"boolean"},"shareToFeed":{"type":"boolean"},"scheduledAt":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["scheduled","uploading","processing","in_user_inbox","posted","failed","cancelled","awaiting_reconnect"]},"publishId":{"type":"string","nullable":true},"platformPostIds":{"type":"array","items":{"type":"string"}},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","connectionId","videoSource","artifactId","platform","mode","caption","privacyLevel","disableComment","disableDuet","disableStitch","brandOrganic","brandContent","isAigc","shareToFeed","scheduledAt","timezone","status","publishId","platformPostIds","lastError","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/posts/{id}":{"patch":{"operationId":"updateSocialAgentPost","tags":["social-agent"],"summary":"Edit a scheduled post the user confirmed in chat","description":"Requires a Brain session token and the social-manager feature flag. Changes the caption, the time, or the platform options of a post that is still scheduled; the video and the account are fixed.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string","maxLength":2200},"durationSeconds":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandContent":{"type":"boolean"},"isAigc":{"type":"boolean"},"shareToFeed":{"type":"boolean"},"scheduledAt":{"type":"string","format":"date-time"},"timezone":{"type":"string","minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Updated scheduled post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"videoSource":{"type":"string","enum":["artifact","drive"]},"artifactId":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string"},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandContent":{"type":"boolean"},"isAigc":{"type":"boolean"},"shareToFeed":{"type":"boolean"},"scheduledAt":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["scheduled","uploading","processing","in_user_inbox","posted","failed","cancelled","awaiting_reconnect"]},"publishId":{"type":"string","nullable":true},"platformPostIds":{"type":"array","items":{"type":"string"}},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","connectionId","videoSource","artifactId","platform","mode","caption","privacyLevel","disableComment","disableDuet","disableStitch","brandOrganic","brandContent","isAigc","shareToFeed","scheduledAt","timezone","status","publishId","platformPostIds","lastError","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/posts/{id}/cancel":{"post":{"operationId":"cancelSocialAgentPost","tags":["social-agent"],"summary":"Cancel a scheduled post","description":"Requires a Brain session token and the social-manager feature flag.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Cancelled post","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"videoSource":{"type":"string","enum":["artifact","drive"]},"artifactId":{"type":"string"},"platform":{"type":"string","enum":["tiktok","instagram"]},"mode":{"type":"string","enum":["inbox","direct","reel"]},"caption":{"type":"string"},"privacyLevel":{"type":"string","nullable":true},"disableComment":{"type":"boolean"},"disableDuet":{"type":"boolean"},"disableStitch":{"type":"boolean"},"brandOrganic":{"type":"boolean"},"brandContent":{"type":"boolean"},"isAigc":{"type":"boolean"},"shareToFeed":{"type":"boolean"},"scheduledAt":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["scheduled","uploading","processing","in_user_inbox","posted","failed","cancelled","awaiting_reconnect"]},"publishId":{"type":"string","nullable":true},"platformPostIds":{"type":"array","items":{"type":"string"}},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","connectionId","videoSource","artifactId","platform","mode","caption","privacyLevel","disableComment","disableDuet","disableStitch","brandOrganic","brandContent","isAigc","shareToFeed","scheduledAt","timezone","status","publishId","platformPostIds","lastError","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/tasks":{"get":{"operationId":"listSocialAgentTasks","tags":["social-agent"],"summary":"The user's scheduled agent tasks","description":"Requires a Brain session token and the social-manager feature flag; 503 when scheduled tasks are disabled on this deployment.","responses":{"200":{"description":"Scheduled tasks, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening","social_management"]},"agentKey":{"type":"string"},"instruction":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]}},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"lastRunStatus":{"type":"string","nullable":true,"enum":["queued","running","succeeded","failed","canceled",null]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","category","agentKey","instruction","mentions","schedule","notifyEmails","enabled","nextRunAt","lastRunAt","lastRunStatus","createdAt","updatedAt"]}}},"required":["tasks"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createSocialAgentTask","tags":["social-agent"],"summary":"Schedule an agent task the user confirmed in chat","description":"Requires a Brain session token and the social-manager feature flag; 503 when scheduled tasks are disabled on this deployment.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening"]},"instruction":{"type":"string","minLength":1,"maxLength":8000},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]},"maxItems":10,"default":[]},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string","maxLength":254,"format":"email"},"maxItems":5,"default":[]},"enabled":{"type":"boolean","default":true}},"required":["title","category","instruction","schedule"]}}}},"responses":{"201":{"description":"The scheduled task","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening","social_management"]},"agentKey":{"type":"string"},"instruction":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]}},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"lastRunStatus":{"type":"string","nullable":true,"enum":["queued","running","succeeded","failed","canceled",null]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","category","agentKey","instruction","mentions","schedule","notifyEmails","enabled","nextRunAt","lastRunAt","lastRunStatus","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/tasks/preview":{"post":{"operationId":"previewSocialAgentTask","tags":["social-agent"],"summary":"How a proposed cadence reads and when it would first run","description":"Requires a Brain session token and the social-manager feature flag; 503 when scheduled tasks are disabled on this deployment. Validates the rule the way a create would and answers the plain-language cadence, the normalized schedule, and the first slot — what the in-chat confirmation card shows before anything is saved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening"]},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]}},"required":["category","schedule"]}}}},"responses":{"200":{"description":"The cadence as the calendar would describe it","content":{"application/json":{"schema":{"type":"object","properties":{"agentLabel":{"type":"string"},"description":{"type":"string"},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"nextRunAt":{"type":"string"}},"required":["agentLabel","description","schedule","nextRunAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/tasks/{id}":{"get":{"operationId":"getSocialAgentTask","tags":["social-agent"],"summary":"One scheduled task with its recent runs","description":"Requires a Brain session token and the social-manager feature flag; 503 when scheduled tasks are disabled on this deployment.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The task and its recent runs","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening","social_management"]},"agentKey":{"type":"string"},"instruction":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]}},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"lastRunStatus":{"type":"string","nullable":true,"enum":["queued","running","succeeded","failed","canceled",null]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"taskId":{"type":"string"},"trigger":{"type":"string","enum":["schedule","manual"]},"scheduledFor":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"brainSessionId":{"type":"string","nullable":true},"turnId":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"notifiedAt":{"type":"string","nullable":true},"notifyError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","taskId","trigger","scheduledFor","status","startedAt","finishedAt","brainSessionId","turnId","summary","error","notifiedAt","notifyError","createdAt","updatedAt"]}}},"required":["id","title","category","agentKey","instruction","mentions","schedule","notifyEmails","enabled","nextRunAt","lastRunAt","lastRunStatus","createdAt","updatedAt","runs"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"updateSocialAgentTask","tags":["social-agent"],"summary":"Change a scheduled task (instruction, cadence, recipients, pause)","description":"Requires a Brain session token and the social-manager feature flag; 503 when scheduled tasks are disabled on this deployment.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening"]},"instruction":{"type":"string","minLength":1,"maxLength":8000},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]},"maxItems":10},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string","maxLength":254,"format":"email"},"maxItems":5},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The updated task","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"category":{"type":"string","enum":["content_strategy","social_video","social_manager","reddit_listening","x_listening","social_management"]},"agentKey":{"type":"string"},"instruction":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["avatar","product","productImage","brandAsset","template","voice","strategy","artifact","file"]},"id":{"type":"string","minLength":1,"maxLength":256},"name":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","minLength":1,"maxLength":32},"source":{"type":"string","enum":["file","artifact","drive"]}},"required":["type","id","name","slug"]}},"schedule":{"type":"object","properties":{"frequency":{"type":"string","enum":["daily","weekly","biweekly","monthly"]},"daysOfWeek":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"maxItems":7,"default":[]},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31,"default":null},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":64},"anchorDate":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":null}},"required":["frequency","time","timezone"]},"notifyEmails":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"lastRunStatus":{"type":"string","nullable":true,"enum":["queued","running","succeeded","failed","canceled",null]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","category","agentKey","instruction","mentions","schedule","notifyEmails","enabled","nextRunAt","lastRunAt","lastRunStatus","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Scheduled tasks are disabled on this deployment, or the run in progress could not be stopped and the task was not changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"deleteSocialAgentTask","tags":["social-agent"],"summary":"Delete a scheduled task","description":"Requires a Brain session token and the social-manager feature flag; 503 when scheduled tasks are disabled on this deployment.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Scheduled tasks are disabled on this deployment, or the run in progress could not be stopped and the task was not changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/social/tasks/{id}/run":{"post":{"operationId":"runSocialAgentTaskNow","tags":["social-agent"],"summary":"Start a run of a scheduled task now, outside its cadence","description":"Requires a Brain session token and the social-manager feature flag; 503 when scheduled tasks are disabled on this deployment.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"The queued run","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"taskId":{"type":"string"},"trigger":{"type":"string","enum":["schedule","manual"]},"scheduledFor":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"brainSessionId":{"type":"string","nullable":true},"turnId":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"notifiedAt":{"type":"string","nullable":true},"notifyError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","taskId","trigger","scheduledFor","status","startedAt","finishedAt","brainSessionId","turnId","summary","error","notifiedAt","notifyError","createdAt","updatedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-templates/submissions":{"post":{"tags":["VideoTemplates"],"operationId":"createTemplateSubmission","summary":"Submit a generated video as a public template","description":"Offer one of your generated videos to the curated public template roster. The clip is normalized and queued for admin review; approval runs the analysis flow that classifies and publishes it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateSubmissionInput"}}}},"responses":{"200":{"description":"The queued submission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateSubmission"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["VideoTemplates"],"operationId":"listTemplateSubmissions","summary":"List my template submissions","description":"The caller's own template submissions with their review state, newest first.","responses":{"200":{"description":"The caller's submissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateSubmissionListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-templates":{"get":{"tags":["VideoTemplates"],"operationId":"listVideoTemplates","parameters":[{"schema":{"type":"string","enum":["ugc","animation","tvc"]},"required":false,"name":"type","in":"query"}],"responses":{"200":{"description":"Published video templates","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTemplateListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-templates/{id}":{"get":{"tags":["VideoTemplates"],"operationId":"getVideoTemplate","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Video template with full metadata and examples","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTemplateDetail"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/video-templates/{id}/generations":{"get":{"tags":["VideoTemplates"],"operationId":"listVideoTemplateGenerations","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The caller's own generations created from this template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTemplateGenerationsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/{id}/examples":{"post":{"tags":["Admin"],"operationId":"adminAddVideoTemplateExample","summary":"Add an example output","description":"Upload a curated example video generated from this template (admin only).","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/AddTemplateExampleForm"}}}},"responses":{"200":{"description":"Template with the example appended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTemplateDetail"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/{id}/examples/{index}":{"delete":{"tags":["Admin"],"operationId":"adminRemoveVideoTemplateExample","summary":"Remove an example output","description":"Drop one curated example by its list index (admin only).","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d+$"},"required":true,"name":"index","in":"path"}],"responses":{"200":{"description":"Template with the example removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTemplateDetail"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/submissions":{"get":{"tags":["Admin"],"operationId":"adminListTemplateSubmissions","summary":"List template submissions","description":"The template review queue, newest first, optionally narrowed to one review state (admin only).","parameters":[{"schema":{"type":"string","enum":["pending","approved","rejected"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Submissions awaiting or past review","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTemplateSubmissionListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/submissions/{id}":{"get":{"tags":["Admin"],"operationId":"adminGetTemplateSubmission","summary":"Get one template submission","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"One submission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTemplateSubmission"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/submissions/{id}/approve":{"post":{"tags":["Admin"],"operationId":"adminApproveTemplateSubmission","summary":"Approve a template submission","description":"Approve a submitted clip and start the analysis flow: Gemini video understanding classifies it (UGC / Animation / TVC — several may apply), generates its metadata document, and publishes it as a template. Supplying `categories` overrides the model's verdict.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveTemplateSubmissionInput"}}}},"responses":{"200":{"description":"The approved submission with its flow state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTemplateSubmission"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/submissions/{id}/reject":{"post":{"tags":["Admin"],"operationId":"adminRejectTemplateSubmission","summary":"Reject a template submission","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectTemplateSubmissionInput"}}}},"responses":{"200":{"description":"The rejected submission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTemplateSubmission"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/submissions/{id}/retry":{"post":{"tags":["Admin"],"operationId":"adminRetryTemplateSubmission","summary":"Re-run the approval flow","description":"Re-run analysis and publication for an approved submission whose flow failed. Idempotent: an already-published submission has its template refreshed rather than duplicated.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The submission with the flow re-queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTemplateSubmission"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/submissions/{id}/template":{"get":{"tags":["Admin"],"operationId":"adminGetSubmissionTemplate","summary":"Get the template a submission produced","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The published template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTemplateDetail"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates":{"get":{"tags":["Admin"],"operationId":"adminListVideoTemplates","summary":"List video templates","description":"List every video template, drafts included (admin only).","responses":{"200":{"description":"All video templates","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminVideoTemplateListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Admin"],"operationId":"adminCreateVideoTemplate","summary":"Create a video template","description":"Upload a reference video + its analysis metadata.json; the video is transcoded to browser-safe mp4 and a poster is extracted. Inserts as a draft (admin only).","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/CreateVideoTemplateForm"}}}},"responses":{"200":{"description":"Created video template (draft)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTemplateDetail"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/reorder":{"post":{"tags":["Admin"],"operationId":"adminReorderVideoTemplates","summary":"Reorder templates (one rail, or globally)","description":"Rewrite curated ranks from an explicit id order (drag-and-drop). With `type`, ranks one rail; without, ranks the whole roster globally. Transactional: every id must exist (and match the type when given) or nothing changes (admin only).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderVideoTemplatesInput"}}}},"responses":{"200":{"description":"The reordered rail (drafts included)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminVideoTemplateListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/{id}":{"patch":{"tags":["Admin"],"operationId":"adminUpdateVideoTemplate","summary":"Update a video template","description":"Edit fields / replace the metadata document / toggle publish (admin only).","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVideoTemplateInput"}}}},"responses":{"200":{"description":"Updated video template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTemplateDetail"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Admin"],"operationId":"adminDeleteVideoTemplate","summary":"Disable a video template","description":"Disable a video template without deleting its row, source, or CDN media (admin only).","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTemplateSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/video-templates/{id}/video":{"post":{"tags":["Admin"],"operationId":"adminReplaceVideoTemplateVideo","summary":"Replace the reference video","description":"Upload a new reference video for an existing template; it is transcoded, a fresh poster is extracted, and both publish under NEW CDN keys (the CDN caches aggressively — same-url swaps serve stale for hours). The old objects are deleted (admin only).","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/ReplaceTemplateVideoForm"}}}},"responses":{"200":{"description":"Template with the replaced video + poster urls","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoTemplateDetail"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports":{"get":{"tags":["Reports"],"operationId":"listProductReports","summary":"List the caller's product reports","description":"One entry per report lineage (user × product), pointing at its latest version.","responses":{"200":{"description":"Report lineages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/{reportId}":{"get":{"tags":["Reports"],"operationId":"getProductReport","summary":"Get a product report (latest version)","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"}],"responses":{"200":{"description":"Latest version with presigned asset URLs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportView"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Reports"],"operationId":"deleteProductReport","summary":"Delete a product report, or drop a shared one","description":"The owner deletes the lineage and every version, which also removes it from the libraries it was shared into. A recipient removes only their own copy — the original is untouched.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/{reportId}/versions/{versionNo}":{"get":{"tags":["Reports"],"operationId":"getProductReportVersion","summary":"Get a pinned version of a product report","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":true,"name":"versionNo","in":"path"}],"responses":{"200":{"description":"The requested version with presigned asset URLs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportView"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Reports"],"operationId":"deleteProductReportVersion","summary":"Delete one version of a product report","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":true,"name":"versionNo","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/{reportId}/versions/{versionNo}/pdf":{"get":{"tags":["Reports"],"operationId":"getProductReportPdf","summary":"Export a report version as PDF","description":"Renders the version's PDF on the server the first time it is asked for and caches it beside the version's assets; returns a short-lived download URL.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":true,"name":"versionNo","in":"path"}],"responses":{"200":{"description":"A presigned download URL for the PDF","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportPdf"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/{reportId}/opened":{"post":{"tags":["Reports"],"operationId":"markProductReportOpened","summary":"Stamp the first-open receipt for a version","description":"Called by the report page on mount. Explicit so plain reads (SDK, preloads) never clear the unread state; a no-op once stamped.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkReportOpenedInput"}}}},"responses":{"200":{"description":"Receipt stamped (or already present)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/{reportId}/handoffs":{"post":{"tags":["Reports"],"operationId":"recordProductReportHandoff","summary":"Record a strategy leaving the report for Studio","description":"Called on the click, before the project exists. Anyone who can read the report may record one; the row is the admin overview's strategy → video funnel and is never edited.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordReportHandoffInput"}}}},"responses":{"200":{"description":"Handoff recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/{reportId}/shares":{"get":{"tags":["Reports"],"operationId":"listProductReportShares","summary":"List the accounts a report is shared with","description":"Owner only. Each entry carries the recipient, the note they were sent, and when they last opened the report.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"}],"responses":{"200":{"description":"Active share grants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportShareList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Reports"],"operationId":"shareProductReport","summary":"Share a report with another AdAnt account","description":"Owner only — sharing is one level deep, so a recipient cannot pass the report on. The recipient sees the identical report in their Social Strategy tab, credited to the owner, and can start projects from it.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareProductReportInput"}}}},"responses":{"200":{"description":"The grant that was created (or revived)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportShareRecipient"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/{reportId}/shares/team":{"post":{"tags":["Reports"],"operationId":"shareProductReportWithTeam","summary":"Share a report with picked teammates","description":"Owner only. Grants read access to the active members of the owner's team named in `userIds`; anyone else is skipped with a reason. The recipient sees the report in their Social Strategy tab, credited to the owner by name.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareProductReportWithTeamInput"}}}},"responses":{"200":{"description":"The grants made and the picks skipped","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportTeamShareResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/{reportId}/shares/{shareId}":{"delete":{"tags":["Reports"],"operationId":"revokeProductReportShare","summary":"Stop sharing a report with one account","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"shareId","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/links/{token}/redeem":{"post":{"tags":["Reports"],"operationId":"redeemProductReportLink","summary":"Claim a link for the signed-in account","description":"Runs the link's mode with the caller as its target and answers with the report to open. Idempotent: a second claim returns the first result rather than a second copy.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"The report the caller should land on","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemProductReportLinkResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/{reportId}/links":{"post":{"tags":["Reports"],"operationId":"createProductReportLink","summary":"Create a shareable link for a report","description":"Owner only. A link reaches people who have no AdAnt account yet: they sign in through it and the link's `mode` runs with them as its target — `share` grants read access (they cannot pass it on), `push` hands them an owned copy. Claiming is idempotent per account. The URL is returned here and stays readable on the list; revoke it to cut access.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductReportLinkInput"}}}},"responses":{"200":{"description":"The link, with its URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportLink"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["Reports"],"operationId":"listProductReportLinks","summary":"List a report's shareable links","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"}],"responses":{"200":{"description":"Live links, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportLinkList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/reports/{reportId}/links/{linkId}":{"delete":{"tags":["Reports"],"operationId":"revokeProductReportLink","summary":"Turn off a shareable link","description":"Accounts that already claimed it keep what they were given; nobody new can claim it.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"linkId","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports":{"get":{"tags":["Admin"],"operationId":"adminListProductReports","summary":"List a user's product reports","description":"List the report lineages (latest-version summaries) of one user (admin only).","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"userId","in":"query"}],"responses":{"200":{"description":"The user's report lineages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReportList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/all":{"get":{"tags":["Admin"],"operationId":"adminListAllProductReports","summary":"List product reports across all users","description":"Paginated cross-user report lineages, newest activity first, with a search filter over title / product / owner / requester (admin only).","parameters":[{"schema":{"type":"integer","minimum":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"One page of report lineages","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAllReportsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/stats":{"get":{"tags":["Admin"],"operationId":"adminGetProductReportStats","summary":"Report generation and strategy handoff metrics","description":"Reports generated by users (today, all-time, 30-day trend), how many the Content Strategy agent made, and strategies handed off into Studio to become videos (admin only). Suspended accounts are excluded.","responses":{"200":{"description":"Report funnel metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReportStats"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/handoffs":{"get":{"tags":["Admin"],"operationId":"adminListReportHandoffs","summary":"Recent strategy handoffs and who clicked them","description":"Strategies carried out of reports into Studio in the last `days` UTC days (default today), newest first, with the clicking account, the report and the strategy, plus the window's total and distinct accounts (admin only). Suspended accounts are excluded.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":90},"required":false,"name":"days","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["social_video","content_strategy"]},"required":false,"name":"destination","in":"query"}],"responses":{"200":{"description":"Recent strategy handoffs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReportHandoffsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/{reportId}/requester":{"patch":{"tags":["Admin"],"operationId":"adminSetProductReportRequester","summary":"Assign who requested a product report","description":"Sets admin-only requester attribution on a stored report. This does not change ownership, grant access, copy assets, or notify the assigned account (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSetReportRequesterInput"}}}},"responses":{"200":{"description":"The updated requester attribution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSetReportRequesterResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/{reportId}/view":{"get":{"tags":["Admin"],"operationId":"adminGetProductReportView","summary":"Render-ready view of a user's report","description":"The full report exactly as the owner sees it — presigned thumbnails, deck downloads, version list — plus the owner. Never stamps the first-open receipt (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"versionNo","in":"query"}],"responses":{"200":{"description":"The report view with its owner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReportViewResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/{reportId}/shares":{"post":{"tags":["Admin"],"operationId":"adminShareProductReport","summary":"Send an existing report to one or more users","description":"Grants read access to a report that is already stored, so the recipients see it in their Social Strategy tab exactly as it is — no bundle upload, no re-uploaded thumbnails. Credited to the AdAnt team unless `viaTeam` is false. Recipients cannot share it on (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminShareReportInput"}}}},"responses":{"200":{"description":"The grants created, plus anyone skipped","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminShareReportResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["Admin"],"operationId":"adminListProductReportShares","summary":"List who a report is shared with","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"}],"responses":{"200":{"description":"Active share grants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReportShareList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/{reportId}/push":{"post":{"tags":["Admin"],"operationId":"adminPushStoredProductReport","summary":"Hand a stored report to users, who then own it","description":"Copies a report AdAnt already holds into each target account: a new lineage they OWN, with its own copies of every thumbnail and deck under their prefix. They can share it on, push over it, or delete it, and the source owner no longer affects them. Nothing is uploaded, so no asset can go missing — prefer this over the bundle push at `/push`, which exists for a report AdAnt does not hold yet. A target that already has this product gets a new version (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPushStoredReportInput"}}}},"responses":{"200":{"description":"The lineages created, plus anyone skipped","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPushStoredReportResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/{reportId}/repair-thumbnails":{"post":{"tags":["Admin"],"operationId":"adminRepairProductReportThumbnails","summary":"Fill the thumbnails a stored version left blank","description":"Runs the save's own derivation — the post URL or the Ad Library id of every card still without an image — over a stored version and fills those cards in place: same version number, same decks, same links; only `thumb` keys that were null change. Defaults to the latest version; `versionNo` picks one, `allVersions` walks the lineage. Each derived cover is one supplier request where the platform needs one (Instagram, Meta ads); YouTube and TikTok cost nothing.","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRepairThumbnailsInput"}}}},"responses":{"200":{"description":"What each repaired version had, got, and still lacks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRepairThumbnailsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/{reportId}/links":{"post":{"tags":["Admin"],"operationId":"adminCreateProductReportLink","summary":"Create a shareable link for a report","description":"The delivery for a recipient who has no AdAnt account yet — a push and a share both need an account id, a link does not. They sign in through the URL and the link's mode runs with them as its target: `push` gives them an owned copy, `share` read access. Credited to the AdAnt team unless `viaTeam` is false (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreateReportLinkInput"}}}},"responses":{"200":{"description":"The link, with its URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportLink"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["Admin"],"operationId":"adminListProductReportLinks","summary":"List a report's shareable links","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"}],"responses":{"200":{"description":"Live links, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReportLinkList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/{reportId}/links/{linkId}":{"delete":{"tags":["Admin"],"operationId":"adminRevokeProductReportLink","summary":"Turn off a shareable link","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"linkId","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/{reportId}/shares/{shareId}":{"delete":{"tags":["Admin"],"operationId":"adminRevokeProductReportShare","summary":"Revoke one share grant","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"shareId","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductReportSuccess"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/{reportId}/versions":{"get":{"tags":["Admin"],"operationId":"adminListProductReportVersions","summary":"List a report's versions","description":"Every version of one lineage — source, push note, pusher, and the first-open receipt (admin only).","parameters":[{"schema":{"type":"string"},"required":true,"name":"reportId","in":"path"}],"responses":{"200":{"description":"The lineage's versions, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReportVersionsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/reports/push":{"post":{"tags":["Admin"],"operationId":"adminPushProductReport","summary":"Push a product report to a user","description":"Upload a report bundle (report_data.json + thumbnails + optional deck PDF/HTML) and append it to the user's report library as a new lineage or a new version, with source \"team\" (admin only).","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/AdminPushReportForm"}}}},"responses":{"200":{"description":"The stored version","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPushReportResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/apiKey.list":{"get":{"tags":["v1.apiKey"],"operationId":"v1ApiKeyList","summary":"List API keys","description":"List all API keys for the authenticated user.","responses":{"200":{"description":"API keys retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/apiKey.create":{"post":{"tags":["v1.apiKey"],"operationId":"v1ApiKeyCreate","summary":"Create API key","description":"Create a new API key with optional expiration and scoped permissions.","x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyInput"}}}},"responses":{"200":{"description":"API key created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/apiKey.update":{"post":{"tags":["v1.apiKey"],"operationId":"v1ApiKeyUpdate","summary":"Update API key","description":"Update the name of an existing API key.","x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateApiKeyInput"}}}},"responses":{"200":{"description":"API key updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/apiKey.delete":{"post":{"tags":["v1.apiKey"],"operationId":"v1ApiKeyDelete","summary":"Delete API key","description":"Revoke and delete an API key.","x-required-scope":"delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteApiKeyInput"}}}},"responses":{"200":{"description":"API key deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cliToken.create":{"post":{"tags":["v1.apiKey"],"operationId":"v1CliTokenCreate","summary":"Create CLI login token","description":"Issue a short-lived CLI login token. Called from the browser after the user signs in.","x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCliTokenInput"}}}},"responses":{"200":{"description":"CLI token created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCliTokenResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/cliToken.exchange":{"post":{"tags":["v1.apiKey"],"operationId":"v1CliTokenExchange","summary":"Exchange CLI token for API key","description":"Exchange a CLI login token for an API key. Public route — no auth required.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeCliTokenInput"}}}},"responses":{"200":{"description":"API key issued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeCliTokenResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/brainSession.token":{"post":{"tags":["v1.apiKey"],"operationId":"v1BrainSessionTokenCreate","summary":"Issue a brain-session token","description":"Mint a short-lived brain-session token (bst_*) for the authenticated user, scoped for media generation. Any authenticated credential (sk_* api key or session cookie) may mint — the media scopes are granted *into* the token, not required to call this route. The returned token is bound to a single brainSessionId and must be sent as `Authorization: Bearer bst_…` on `/v1/media.*` calls whose request body carries the same brainSessionId.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueBrainSessionTokenInput"}}}},"responses":{"200":{"description":"Brain-session token issued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueBrainSessionTokenResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/localToken.list":{"get":{"tags":["v1.apiKey"],"operationId":"v1LocalTokenList","summary":"List active plugin sessions","description":"List active device-bound local plugin sessions for the authenticated user.","responses":{"200":{"description":"Active plugin sessions retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocalTokenListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/localToken.revoke":{"post":{"tags":["v1.apiKey"],"operationId":"v1LocalTokenRevoke","summary":"Revoke a plugin session","description":"Immediately revoke one device-bound local plugin session owned by the authenticated user.","x-required-scope":"delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeLocalTokenInput"}}}},"responses":{"200":{"description":"Plugin session revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/credit.reserve":{"post":{"tags":["v1.credit"],"operationId":"v1CreditReserve","summary":"Reserve credits for an operation","description":"Atomic pre-authorization. Throws 402 INSUFFICIENT_CREDITS on shortfall. Idempotent on operationId.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditReserveInput"}}}},"responses":{"200":{"description":"Reservation created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditReserveResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/credit.settle":{"post":{"tags":["v1.credit"],"operationId":"v1CreditSettle","summary":"Settle a reservation against actual cost","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditSettleInput"}}}},"responses":{"200":{"description":"Reservation settled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditSettleResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/credit.refund":{"post":{"tags":["v1.credit"],"operationId":"v1CreditRefund","summary":"Refund a reservation (technical failure)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditRefundInput"}}}},"responses":{"200":{"description":"Reservation refunded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditRefundResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/credit.balance":{"post":{"tags":["v1.credit"],"operationId":"v1CreditBalance","summary":"Read a user's available credit balance","description":"Returns the user's available balance in display credits for agent reporting.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalanceInput"}}}},"responses":{"200":{"description":"Current balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalance"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/features":{"get":{"tags":["v1.features"],"operationId":"v1FeatureList","summary":"List feature flags","description":"Resolved feature-flag values for the authenticated user. Flags absent from the response are off.","responses":{"200":{"description":"Feature flags resolved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagValues"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/favorite.list":{"get":{"tags":["v1.skillList"],"operationId":"v1FavoriteList","summary":"List favorites","description":"List all skills the authenticated user has favorited.","responses":{"200":{"description":"Favorites retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/favorite.add":{"post":{"tags":["v1.skillList"],"operationId":"v1FavoriteAdd","summary":"Add favorite","x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFavoriteInput"}}}},"responses":{"200":{"description":"Favorited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/favorite.remove":{"post":{"tags":["v1.skillList"],"operationId":"v1FavoriteRemove","summary":"Remove favorite","x-required-scope":"delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveFavoriteInput"}}}},"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/favorite.batchCheck":{"post":{"tags":["v1.skillList"],"operationId":"v1FavoriteBatchCheck","summary":"Batch check favorites","description":"Returns a map of skillId → boolean. Empty object if unauthenticated.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1BatchCheckFavoritesInput"}}}},"responses":{"200":{"description":"Map of skillId to favorited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteBatchCheckResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skillList.list":{"post":{"tags":["v1.skillList"],"operationId":"v1SkillListList","summary":"List user skill lists","description":"List all skill lists for a user. Public lists visible to everyone; private only to the owner.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1SkillListListInput"}}}},"responses":{"200":{"description":"Skill lists retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skillList.get":{"post":{"tags":["v1.skillList"],"operationId":"v1SkillListGet","summary":"Get skill list","description":"Get a skill list with its items.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1SkillListGetInput"}}}},"responses":{"200":{"description":"Skill list detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListDetail"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skillList.checkSkill":{"post":{"tags":["v1.skillList"],"operationId":"v1SkillListCheckSkill","summary":"Check whether lists contain a skill","description":"Returns a map of listId → boolean indicating whether each list contains the given skill.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1CheckSkillInListsInput"}}}},"responses":{"200":{"description":"Map of listId to contains","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteBatchCheckResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skillList.create":{"post":{"tags":["v1.skillList"],"operationId":"v1SkillListCreate","summary":"Create skill list","x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1SkillListCreateInput"}}}},"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListDetail"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skillList.update":{"post":{"tags":["v1.skillList"],"operationId":"v1SkillListUpdate","summary":"Update skill list","x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1SkillListUpdateInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skillList.delete":{"post":{"tags":["v1.skillList"],"operationId":"v1SkillListDelete","summary":"Delete skill list","x-required-scope":"delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1SkillListDeleteInput"}}}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skillList.addItem":{"post":{"tags":["v1.skillList"],"operationId":"v1SkillListAddItem","summary":"Add item to skill list","x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1SkillListAddItemInput"}}}},"responses":{"200":{"description":"Item added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListItem"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skillList.removeItem":{"post":{"tags":["v1.skillList"],"operationId":"v1SkillListRemoveItem","summary":"Remove item from skill list","x-required-scope":"delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1SkillListRemoveItemInput"}}}},"responses":{"200":{"description":"Item removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/me":{"get":{"tags":["v1.skill"],"operationId":"v1Me","summary":"Get current user","description":"Resolve the authenticated user's id and username.","responses":{"200":{"description":"Current user info (or null if unauthenticated)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponseData"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.explore":{"get":{"tags":["v1.skill"],"operationId":"v1SkillExplore","summary":"Explore public skills","description":"Public, paginated browse of all skills. No auth required.","parameters":[{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["downloads","recent","name","stars"],"default":"downloads"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["user","github"]},"required":false,"name":"namespace","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Paginated list of public skills","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExploreResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.listMine":{"get":{"tags":["v1.skill"],"operationId":"v1SkillListMine","summary":"List my skills","description":"List all skills owned by the authenticated user.","responses":{"200":{"description":"List of skills","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.list":{"post":{"tags":["v1.skill"],"operationId":"v1SkillList","summary":"List a user's skills","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ListUserSkillsInput"}}}},"responses":{"200":{"description":"List of user's skills","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.detail":{"post":{"tags":["v1.skill"],"operationId":"v1SkillDetail","summary":"Get skill detail","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1SkillDetailInput"}}}},"responses":{"200":{"description":"Skill metadata + SKILL.md from latest version","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillDetailResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.listVersions":{"post":{"tags":["v1.skill"],"operationId":"v1SkillListVersions","summary":"List skill versions","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ListVersionsInput"}}}},"responses":{"200":{"description":"Versions in publish order","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillVersion"}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.getVersion":{"post":{"tags":["v1.skill"],"operationId":"v1SkillGetVersion","summary":"Get skill version","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1GetVersionInput"}}}},"responses":{"200":{"description":"Version metadata + download URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillVersionWithDownload"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.stats":{"post":{"tags":["v1.skill"],"operationId":"v1SkillStats","summary":"Get skill download stats","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1SkillStatsInput"}}}},"responses":{"200":{"description":"Download statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillStatsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.publish":{"post":{"tags":["v1.skill"],"operationId":"v1SkillPublish","summary":"Publish skill","description":"Publish a new skill or a new version of an existing skill.","security":[{"bearerAuth":[]}],"x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishSkillInput"}}}},"responses":{"200":{"description":"Skill published","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishSkillResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.delete":{"post":{"tags":["v1.skill"],"operationId":"v1SkillDelete","summary":"Delete skill","description":"Delete a skill and all its versions. Requires `delete` scope on the API key.","security":[{"bearerAuth":[]}],"x-required-scope":"delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1DeleteSkillInput"}}}},"responses":{"200":{"description":"Skill deleted","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SuccessResponse"},{"description":"Operation success indicator"}]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.deleteVersion":{"post":{"tags":["v1.skill"],"operationId":"v1SkillDeleteVersion","summary":"Delete skill version","description":"Delete a specific version. Only allowed within 72 hours of publish; after that, deprecate instead.","security":[{"bearerAuth":[]}],"x-required-scope":"delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1DeleteVersionInput"}}}},"responses":{"200":{"description":"Version deleted","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SuccessResponse"},{"description":"Operation success indicator"}]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.deprecate":{"post":{"tags":["v1.skill"],"operationId":"v1SkillDeprecate","summary":"Deprecate skill version","security":[{"bearerAuth":[]}],"x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1DeprecateVersionInput"}}}},"responses":{"200":{"description":"Version deprecated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillVersion"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.undeprecate":{"post":{"tags":["v1.skill"],"operationId":"v1SkillUndeprecate","summary":"Remove deprecation","security":[{"bearerAuth":[]}],"x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1UndeprecateVersionInput"}}}},"responses":{"200":{"description":"Deprecation removed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillVersion"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.changeAccess":{"post":{"tags":["v1.skill"],"operationId":"v1SkillChangeAccess","summary":"Change skill visibility","description":"Change visibility. Public→private is irreversible and rejected, similar to npm.","security":[{"bearerAuth":[]}],"x-required-scope":"write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ChangeAccessInput"}}}},"responses":{"200":{"description":"Visibility updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeAccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.download":{"get":{"tags":["v1.skill"],"operationId":"v1SkillDownload","summary":"Download skill version","description":"Returns a zip body when format=zip; otherwise redirects to a presigned tgz URL. Use as a direct browser link with query params.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"username","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"name","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"version","in":"query"},{"schema":{"type":"string","enum":["tgz","zip"],"default":"tgz"},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"Zip body"},"302":{"description":"Redirect to presigned tgz URL"},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.github.list":{"post":{"tags":["v1.skill.github"],"operationId":"v1GithubSkillList","summary":"List indexed skills in a GitHub repo","description":"Public, no auth required.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1GithubRepoListInput"}}}},"responses":{"200":{"description":"Skills in the repo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.github.detail":{"post":{"tags":["v1.skill.github"],"operationId":"v1GithubSkillDetail","summary":"Get GitHub skill detail","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1GithubSkillDetailInput"}}}},"responses":{"200":{"description":"Skill metadata + GitHub repo info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillDetailResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.github.listVersions":{"post":{"tags":["v1.skill.github"],"operationId":"v1GithubSkillListVersions","summary":"List GitHub skill versions","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1GithubListVersionsInput"}}}},"responses":{"200":{"description":"Versions in publish order","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillVersion"}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.github.getVersion":{"post":{"tags":["v1.skill.github"],"operationId":"v1GithubSkillGetVersion","summary":"Get GitHub skill version","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1GithubGetVersionInput"}}}},"responses":{"200":{"description":"Version metadata + download URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillVersionWithDownload"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.github.stats":{"post":{"tags":["v1.skill.github"],"operationId":"v1GithubSkillStats","summary":"Get GitHub skill download stats","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1GithubSkillStatsInput"}}}},"responses":{"200":{"description":"Download statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillStatsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/skill.github.download":{"get":{"tags":["v1.skill.github"],"operationId":"v1GithubSkillDownload","summary":"Download GitHub skill version","description":"Returns a zip body when format=zip; otherwise redirects to a presigned tgz URL. Use as a direct browser link with query params.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"owner","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"repo","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"name","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"version","in":"query"},{"schema":{"type":"string","enum":["tgz","zip"],"default":"tgz"},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"Zip body"},"302":{"description":"Redirect to presigned tgz URL"},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/artifact.list":{"get":{"tags":["v1.artifact"],"operationId":"v1ArtifactList","summary":"List artifacts","description":"List artifacts owned by the authenticated user, newest first. Optional `sessionId` narrows to a single chat session; with `family=true` it also lists what that task's threads made, each tagged with `threadSessionId` and `threadAgentKey`.","parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"sessionId","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"family","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Paginated artifact list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactListPage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/artifact.get":{"get":{"tags":["v1.artifact"],"operationId":"v1ArtifactGet","summary":"Get an artifact","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"query"}],"responses":{"200":{"description":"Artifact metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifact"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/artifact.checkpoints":{"get":{"tags":["v1.artifact"],"operationId":"v1ArtifactCheckpoints","summary":"List the checkpoint chain that contains an artifact","description":"Walks the chain of artifacts linked by `metadata.previousArtifactId` (used by the slides skill's Save Point switcher). Returns a single-element list when the artifact has no chain neighbours.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"query"}],"responses":{"200":{"description":"Ordered checkpoint chain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactCheckpointsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/artifact.payload":{"get":{"tags":["v1.artifact"],"operationId":"v1ArtifactPayload","summary":"Resolve an artifact payload URL","description":"Returns a presigned URL for bytes-backed artifacts, or the absolute URL for `kind=web`. `variant=thumbnail` resolves the small derivative instead, and 404s when the row has none. `variant=download` mints an attachment URL at `quality` (default: the largest the caller's plan includes). A video's clean bytes — any rung without the watermark, up to the original — are a paid-plan entitlement; every plan may download the watermarked `preview` (the mark burned in, shorter side capped at 540). A request above the plan's ceiling answers `403 UPGRADE_REQUIRED` (details carry `requestedQuality`); a rendition not built yet answers `409 PREVIEW_PENDING` and starts the build. `variant=original` stays a playback URL for every plan — the watermarked preview for a plan without the clean bytes. A `kind=file` artifact carrying video bytes has no renditions and refuses a Free plan's download with `403 UPGRADE_REQUIRED`.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"query"},{"schema":{"type":"string","enum":["original","thumbnail","download"],"default":"original"},"required":false,"name":"variant","in":"query"},{"schema":{"type":"string","enum":["540","720","1080","preview","original"]},"required":false,"name":"quality","in":"query"}],"responses":{"200":{"description":"Payload URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactPayloadResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/artifact.renditions":{"get":{"tags":["v1.artifact"],"operationId":"v1ArtifactRenditions","summary":"List the download sizes for an artifact","description":"The download ladder for one artifact under the caller's plan: the source dimensions; for a plan without the clean bytes the watermarked `preview` first; every clean rendition smaller than the source plus the original; whether each is built, and which the plan includes. Non-video artifacts list only the original.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"query"}],"responses":{"200":{"description":"Download ladder","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactRenditionsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/artifact.download":{"post":{"tags":["v1.artifact"],"operationId":"v1ArtifactDownload","summary":"Record an explicit artifact download","description":"Records a user-initiated download without conflating it with preview or playback payload resolution.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactGetQuery"}}}},"responses":{"200":{"description":"Download recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactDownloadResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/artifact.create":{"post":{"tags":["v1.artifact"],"operationId":"v1ArtifactCreate","summary":"Create an artifact (brain ingest)","description":"Brain calls this with a per-session `bst_*` bearer token after uploading bytes to R2. Idempotent on `id`. Any other credential — a session cookie, an `sk_*` key — is refused with 403: the row's `payloadRef` and `kind` decide which bytes the video plan gate serves, so only the server-minted brain token may write them. Metadata keys the server owns (`renditions`, `renditionStatus`, `thumbnailRef`, `blurhash`, `dimensionsSource`, `durationSource`, `previewRef`, `previewStatus`) are dropped from the caller's metadata.","x-required-scope":"artifact:write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateArtifactInput"}}}},"responses":{"200":{"description":"Artifact created (or returned existing on retry)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifact"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/artifact.rename":{"patch":{"tags":["v1.artifact"],"operationId":"v1ArtifactRename","summary":"Rename an artifact","description":"Update one artifact's display title (owner-scoped). Brain calls this via the rename_artifact tool so the agent can name a deliverable in the user's language after the fact.","x-required-scope":"artifact:write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameArtifactInput"}}}},"responses":{"200":{"description":"The updated artifact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifact"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/artifact.sessionTitle":{"patch":{"tags":["v1.artifact"],"operationId":"v1ArtifactSessionTitle","summary":"Sync the denormalized session title","description":"Brain calls this when a chat is renamed so Library cards reflect the new title. Best-effort consistency.","x-required-scope":"artifact:write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchArtifactSessionTitleInput"}}}},"responses":{"200":{"description":"Update count","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchArtifactSessionTitleResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/artifact.deleteBySession":{"post":{"tags":["v1.artifact"],"operationId":"v1ArtifactDeleteBySession","summary":"Delete all artifacts in a session","description":"Delete every artifact owned by the authenticated user that belongs to `brainSessionId`, reclaiming each artifact's R2 object on a best-effort basis. Idempotent — re-running after a partial failure returns `deletedCount: 0` rather than erroring.","x-required-scope":"artifact:write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactDeleteBySessionInput"}}}},"responses":{"200":{"description":"Delete counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactDeleteBySessionResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/files/create-upload":{"post":{"tags":["v1.files"],"operationId":"v1FilesCreateUpload","summary":"Create a presigned upload","description":"Begin a file upload. Returns a presigned PUT URL; upload the raw file bytes to it (with the matching `Content-Type`), then call `POST /v1/files/complete` with the returned `id` to finalize. No file row exists until the upload is completed.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileCreateUploadInput"}}}},"responses":{"200":{"description":"Presigned upload slot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileCreateUploadResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/files/complete":{"post":{"tags":["v1.files"],"operationId":"v1FilesCompleteUpload","summary":"Complete a presigned upload","description":"Finalize an upload started with `POST /v1/files/create-upload`. The server verifies the uploaded object in R2 (size/type read back from storage) and creates the file row. Returns the new file's metadata; the `id` can be attached to a brain session.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileCompleteUploadInput"}}}},"responses":{"200":{"description":"Finalized file metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResource"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/files":{"get":{"tags":["v1.files"],"operationId":"v1FilesList","summary":"List files","description":"List workspace files owned by the authenticated user, newest first. Pass `limit` (max 200) to page; follow `next_cursor`. Without `limit` every file is returned.","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Paginated file list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileList"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/files/{fileId}/content":{"get":{"tags":["v1.files"],"operationId":"v1FilesGetContent","summary":"Get a presigned download URL for a file","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"Presigned download URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileContentResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/files/{fileId}":{"delete":{"tags":["v1.files"],"operationId":"v1FilesDelete","summary":"Delete a file","description":"Delete a file. Fails with 409 if the file is currently attached to any brain session.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"File deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilesSuccessResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/files/from-asset":{"post":{"tags":["v1.files"],"operationId":"v1FilesFromAsset","summary":"Mount an existing asset as a workspace file","description":"Copy an existing asset — a Drive file or a brain-produced artifact — into the workspace file registry so it can be attached to a brain session. Bytes are copied within R2 (no re-upload). Returns the new file's metadata; the `id` can be passed to the session resources endpoint.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileFromAssetInput"}}}},"responses":{"200":{"description":"The new workspace file copied from the asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResource"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/publicAsset.create-upload":{"post":{"tags":["v1.publicAsset"],"operationId":"v1PublicAssetCreateUpload","summary":"Create a public asset upload slot","description":"Server allocates an id, mints a presigned PUT URL into the public bucket, and returns the final unauthenticated CDN URL. PUT the bytes directly to `uploadUrl` — once that succeeds the `url` is live forever.","x-required-scope":"public-asset:write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicAssetUploadInput"}}}},"responses":{"200":{"description":"Upload slot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicAssetUploadResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/publicAsset.list":{"get":{"tags":["v1.publicAsset"],"operationId":"v1PublicAssetList","summary":"List public assets","parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Paginated list, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAssetListPage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/publicAsset.delete":{"post":{"tags":["v1.publicAsset"],"operationId":"v1PublicAssetDelete","summary":"Delete a public asset","description":"Removes the bytes from R2 and the row from the database. Idempotent: deleting a non-existent id returns `{ deleted: false }`.","x-required-scope":"public-asset:write","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePublicAssetInput"}}}},"responses":{"200":{"description":"Delete result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePublicAssetResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.voice.list":{"get":{"tags":["v1.media"],"operationId":"v1MediaVoiceList","summary":"List the rich database-backed system voice catalog","parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","maxLength":100},"required":false,"name":"language","in":"query"},{"schema":{"type":"string","maxLength":100},"required":false,"name":"accent","in":"query"},{"schema":{"type":"string","maxLength":50},"required":false,"name":"gender","in":"query"},{"schema":{"type":"string","maxLength":1000},"required":false,"name":"ages","in":"query"},{"schema":{"type":"string","maxLength":1000},"required":false,"name":"useCases","in":"query"},{"schema":{"type":"string","maxLength":1000},"required":false,"name":"traits","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"recommended","in":"query"}],"responses":{"200":{"description":"System voices and available filter facets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceCatalogListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/product.lookup":{"post":{"tags":["v1.product"],"summary":"Find the caller's product closest to a source url","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ProductLookupInput"}}}},"responses":{"200":{"description":"Canonical url plus the closest existing product, if any.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductLookupResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/product.list":{"post":{"tags":["v1.product"],"summary":"Compact list of the caller's products and their brand assets","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ProductListInput"}}}},"responses":{"200":{"description":"Products newest first (card fields only).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ProductListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/product.createUpload":{"post":{"tags":["v1.product"],"summary":"Presigned PUT slot for a product picture or brand asset","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ProductCreateUploadInput"}}}},"responses":{"200":{"description":"Staged key + presigned PUT url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ProductCreateUploadResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/product.upsert":{"post":{"tags":["v1.product"],"summary":"Create or update a product from staged uploads","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1ProductUpsertInput"}}}},"responses":{"200":{"description":"The created or updated product.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/brandAsset.search":{"post":{"tags":["v1.product"],"summary":"Search the caller's brand assets by label / product name","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1BrandAssetSearchInput"}}}},"responses":{"200":{"description":"Matching brand assets, always-add first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1BrandAssetSearchResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/videoOverlay.createUpload":{"post":{"tags":["v1.videoOverlay"],"summary":"Presigned PUT for one overlay layer image","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1VideoOverlayCreateUploadInput"}}}},"responses":{"200":{"description":"Layer id, key and upload url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1VideoOverlayCreateUploadResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/videoOverlay.attach":{"post":{"tags":["v1.videoOverlay"],"summary":"Record the overlay layout a composited video was built from","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1VideoOverlayAttachInput"}}}},"responses":{"200":{"description":"The stored layout with presigned urls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoOverlayResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/avatar.save":{"post":{"tags":["v1.asset"],"summary":"File one of the caller's image artifacts as their own avatar","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1AvatarSaveInput"}}}},"responses":{"200":{"description":"The saved avatar (or the one this artifact already made).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1AvatarSaveResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/videoAnalysis.cached":{"post":{"operationId":"getCachedVideoAnalysis","tags":["v1.videoAnalysis"],"summary":"Clone-analysis passes already made for a public video","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"link":{"type":"string","minLength":1,"maxLength":2048},"passes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["narrative","structure","precise","look","shot_grammar","realism"]},"digest":{"type":"string","minLength":1,"maxLength":64}},"required":["id","digest"]},"minItems":1,"maxItems":6}},"required":["link","passes"]}}}},"responses":{"200":{"description":"The usable cached passes; empty when there are none","content":{"application/json":{"schema":{"type":"object","properties":{"passes":{"type":"object","additionalProperties":{"type":"string"}}},"required":["passes"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/avatar.list":{"post":{"tags":["v1.asset"],"summary":"List avatars visible to the current user for agent casting","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarListInput"}}}},"responses":{"200":{"description":"System avatars plus the caller's own saved avatars.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/avatar.match":{"post":{"tags":["v1.asset"],"summary":"Rank every visible avatar against a casting request","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarMatchInput"}}}},"responses":{"200":{"description":"The 0–6 best-fitting avatars (server-side ranking over the full roster), best first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarMatchResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/template.list":{"post":{"tags":["v1.asset"],"summary":"List the published video-template roster as compact entries","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateListInput"}}}},"responses":{"200":{"description":"Compact published templates (card fields + matching signals, no analysis blob) for agent-side ranking.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/template.match":{"post":{"tags":["v1.asset"],"summary":"Score the published template roster against a video request","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateMatchInput"}}}},"responses":{"200":{"description":"The 0–4 templates that clear the relevance bar (server-side LLM scoring), best first. Empty when none fit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateMatchResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/asset.retrieve":{"post":{"tags":["v1.asset"],"summary":"Resolve a mentioned asset to its media url(s) and metadata","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetRetrieveInput"}}}},"responses":{"200":{"description":"The asset's image url(s) and descriptive metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetRetrieveResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/tier.list":{"get":{"tags":["v1.tier"],"operationId":"v1TierList","summary":"List the model tiers available in the composer","responses":{"200":{"description":"Enabled tiers, in display order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicTierListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.plan.preflight":{"post":{"tags":["v1.media"],"operationId":"v1MediaPlanPreflight","summary":"Quote and atomically reserve every job in a media plan","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaPlanPreflightInput"}}}},"responses":{"200":{"description":"Complete plan quoted and reserved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaPlanPreflightResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.plan.for_job":{"get":{"tags":["v1.media"],"operationId":"v1MediaPlanForJob","summary":"The preflighted plan a pending plan item's job id belongs to, with its estimated total","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"jobId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"brainSessionId","in":"query"}],"responses":{"200":{"description":"The plan, or null when the id is not a plan item whose reservation is still pending","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaPlanForJobResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.plan.release":{"post":{"tags":["v1.media"],"operationId":"v1MediaPlanRelease","summary":"Release an unsubmitted media-plan item's credit hold","description":"Refunds the pending reservation media.plan.preflight made for one plan item, only while no generate call has adopted it and no job row owns its id. Never cancels or modifies a job. 404 when the id is not a plan item of this user and session.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaPlanReleaseInput"}}}},"responses":{"200":{"description":"What happened to the plan item's hold","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaPlanReleaseResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.image.generate":{"post":{"tags":["v1.media"],"operationId":"v1MediaImageGenerate","summary":"Generate an image (async, poll via media.job.get)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaImageGenerateInput"}}}},"responses":{"200":{"description":"Image job started (running) or completed inline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.image.edit":{"post":{"tags":["v1.media"],"operationId":"v1MediaImageEdit","summary":"Edit an existing image (async, poll via media.job.get)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaImageEditInput"}}}},"responses":{"200":{"description":"Image-edit job started (running) or completed inline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.video.generate":{"post":{"tags":["v1.media"],"operationId":"v1MediaVideoGenerate","summary":"Generate a video (Gemini Veo 3.1) — async, poll via media.job.get","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaVideoGenerateInput"}}}},"responses":{"200":{"description":"Video job started (status `running`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.video.analyze":{"post":{"tags":["v1.media"],"operationId":"v1MediaVideoAnalyze","summary":"Analyze a video artifact and return a scene breakdown (Gemini)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaVideoAnalyzeInput"}}}},"responses":{"200":{"description":"Analysis text","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaVideoAnalyzeResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.video.frame":{"post":{"tags":["v1.media"],"operationId":"v1MediaVideoFrame","summary":"Freeze one still of a video as an image artifact (the first settled frame by default) — a look reference for image generation; no credits","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaVideoFrameInput"}}}},"responses":{"200":{"description":"The persisted frame artifact and the instant it froze","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaVideoFrameResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.audio.generate":{"post":{"tags":["v1.media"],"operationId":"v1MediaAudioGenerate","summary":"Synthesize a voice track (MiniMax Speech 2.8 by default; Fish Audio Drama 3 / S2 Pro and Eleven v4 / v4 Turbo / v3 by model)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAudioGenerateInput"}}}},"responses":{"200":{"description":"Voice synthesized (file artifact)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.job.get":{"get":{"tags":["v1.media"],"operationId":"v1MediaJobGet","summary":"Get the status of a media generation job","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"brainSessionId","in":"query"}],"responses":{"200":{"description":"Job status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.job.list":{"get":{"tags":["v1.media"],"operationId":"v1MediaJobList","summary":"List owned media jobs, optionally scoped to a Brain session","parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"brainSessionId","in":"query"},{"schema":{"type":"string","enum":["running","completed","failed","canceled"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Owned media jobs newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobListResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.job.events":{"get":{"tags":["v1.media"],"operationId":"v1MediaJobEvents","summary":"Read durable media lifecycle events after a session cursor","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"brainSessionId","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"afterSequence","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Ordered lifecycle events and the next cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobEventsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.job.cancel":{"post":{"tags":["v1.media"],"operationId":"v1MediaJobCancel","summary":"Cancel an owned media job","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobCancelInput"}}}},"responses":{"200":{"description":"Cancellation result and accounting disposition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobCancelResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.models":{"get":{"tags":["v1.media"],"operationId":"v1MediaModels","summary":"List available media models (catalog) grouped by kind","responses":{"200":{"description":"Catalog of image/video/audio models","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaModelsResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.video.clonePass":{"post":{"operationId":"v1MediaVideoClonePass","tags":["v1.media"],"summary":"Run one clone-analysis pass over a video on AdAnt's servers","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaVideoClonePassInput"}}}},"responses":{"200":{"description":"Run one clone-analysis pass over a video on AdAnt's servers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaVideoClonePassResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.video.cloneDerive":{"post":{"operationId":"v1MediaVideoCloneDerive","tags":["v1.media"],"summary":"Build the shot lines and first-frame prompt from clone-analysis passes","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaVideoCloneDeriveInput"}}}},"responses":{"200":{"description":"Build the shot lines and first-frame prompt from clone-analysis passes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaVideoCloneDeriveResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/media.prompt.check":{"post":{"operationId":"v1MediaPromptCheck","tags":["v1.media"],"summary":"Check a video render prompt against the source's shots and pace","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaPromptCheckInput"}}}},"responses":{"200":{"description":"Check a video render prompt against the source's shots and pace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaPromptCheckResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/title.generate":{"post":{"tags":["v1.title"],"operationId":"v1TitleGenerate","summary":"Generate a concise title for a chat/task session or agent","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TitleGenerateInput"}}}},"responses":{"200":{"description":"Generated title","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TitleGenerateResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/collect":{"post":{"operationId":"collectContentResearch","tags":["research"],"summary":"Collect social evidence for a cloud research session","description":"Requires a Brain session token and the content-research feature flag. Repeated identical operation keys return the saved result; a key whose collection is still running answers 202 with the operation to poll.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotency_key":{"type":"string","minLength":1,"maxLength":128},"tiktok":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":8},"instagram":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":8},"youtube":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":8},"metaAds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":8},"accounts":{"type":"object","properties":{"tiktok":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"minItems":1,"maxItems":5},"instagram":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"minItems":1,"maxItems":5},"youtube":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"minItems":1,"maxItems":5}},"additionalProperties":false},"postedWithinDays":{"type":"integer","minimum":1,"maximum":365},"recency":{"type":"string","enum":["fresh","recent"]},"excludeRecommended":{"type":"boolean"},"sort":{"type":"string","enum":["relevance","most-liked","newest"]},"limitPerQuery":{"type":"integer","minimum":5,"maximum":60}},"required":["idempotency_key"]}}}},"responses":{"200":{"description":"Persisted research result","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"202":{"description":"The collection under this key is still running; poll the operation","content":{"application/json":{"schema":{"type":"object","properties":{"operationId":{"type":"string"},"status":{"type":"string","enum":["running"]},"result":{"nullable":true}},"required":["operationId","status","result"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/analyze":{"post":{"operationId":"analyzeContentResearchCandidates","tags":["research"],"summary":"Queue video analysis of research candidates","description":"Requires a Brain session token and the content-research feature flag. Downloads each candidate on the server (a Meta ad creative from its CDN URL, the others through the extractor), stores it as a private analysis reference, and analyzes it; poll the returned operation for progress and evidence. Repeated identical operation keys return the same operation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["analysis","metadata"]},"recent":{"type":"integer","minimum":1,"maximum":12},"idempotency_key":{"type":"string","minLength":1,"maxLength":128},"collectOperationId":{"type":"string","minLength":1,"maxLength":128},"candidateIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"minItems":1,"maxItems":12},"candidates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"url":{"type":"string","format":"uri"},"platform":{"type":"string","enum":["tiktok","instagram","youtube","meta-ads"]},"videoUrl":{"type":"string","format":"uri"}},"required":["id","url","platform"]},"minItems":1,"maxItems":12},"questions":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300},"maxItems":8},"concurrency":{"type":"integer","minimum":1,"maximum":4},"maxAttempts":{"type":"integer","minimum":1,"maximum":12}},"required":["idempotency_key"]}}}},"responses":{"200":{"description":"Persisted research result","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/operations/{operationId}":{"get":{"operationId":"getContentResearchOperation","tags":["research"],"summary":"Read a research operation's status and result","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"operationId","in":"path"}],"responses":{"200":{"description":"Persisted research result","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/operations":{"get":{"operationId":"findContentResearchOperationByKey","tags":["research"],"summary":"Read the research operation a key of this session claimed","description":"Requires a Brain session token. The same answer as the operation poll, found by the idempotency key the caller sent in this session instead of the operation id — how the brain watches a collection's progress while the request that runs it is still open. 404 until that request has claimed the key.","parameters":[{"schema":{"type":"string","enum":["collect","analyze","profile","creators"]},"required":true,"name":"kind","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"key","in":"query"}],"responses":{"200":{"description":"Persisted research result","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/creators":{"post":{"operationId":"scoutContentResearchCreators","tags":["research"],"summary":"Scout collaboration creators using profile and authored-content criteria","description":"Requires a Brain session token and the creator-scout-agent feature flag. Defaults to 40 creators mixed across UGC (<5K followers), micro (5K–50K) and influencer (50K+) tiers, discovered from niche keywords and their outlier videos. Reuse the same operation key and arguments after interruption; a running operation answers 202 and can be polled. Returns creator observations with identity and brand evidence, explicit gaps and actual usage. Does not contact creators or modify the source strategy.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotency_key":{"type":"string","minLength":1,"maxLength":128},"criteria":{"type":"object","properties":{"segment":{"type":"string","enum":["ugc","micro","influencer","all"],"default":"all"},"bands":{"type":"string","enum":["5k-50k","10k-100k"]},"targetCount":{"type":"integer","minimum":1,"maximum":100,"default":40},"platforms":{"type":"array","items":{"type":"string","enum":["tiktok","instagram","youtube"]},"minItems":1,"maxItems":3,"default":["tiktok","instagram","youtube"]},"niches":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30,"default":[]},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30,"default":[]},"excludedKeywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30,"default":[]},"minFollowers":{"type":"integer","minimum":0},"maxFollowers":{"type":"integer","minimum":0},"locations":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30,"default":[]},"languages":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30,"default":[]},"minAverageViews":{"type":"integer","minimum":0},"minEngagementRate":{"type":"number","minimum":0,"maximum":100},"activeWithinDays":{"type":"integer","minimum":1,"maximum":365},"requireOutlier":{"type":"boolean","default":false},"excludeCompetitorPartners":{"type":"boolean","default":false}},"default":{}},"queries":{"type":"object","properties":{"tiktok":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":8},"instagram":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":8},"youtube":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":8}}},"seeds":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"handle":{"type":"string","minLength":1,"maxLength":128},"id":{"type":"string","minLength":1,"maxLength":128}},"required":["platform","handle"]},"maxItems":50},"sourceReportId":{"type":"string","minLength":1,"maxLength":128},"competitors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"aliases":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"maxItems":20},"sourceUrls":{"type":"array","items":{"type":"string","pattern":"^https:\\/\\/"},"minItems":1,"maxItems":10}},"required":["name","aliases","sourceUrls"]},"maxItems":20,"default":[]}},"required":["idempotency_key","queries"]}}}},"responses":{"200":{"description":"Persisted creator scouting result","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"202":{"description":"Scouting is still running; poll this operation","content":{"application/json":{"schema":{"type":"object","properties":{"operationId":{"type":"string"},"status":{"type":"string","enum":["running"]},"result":{"nullable":true}},"required":["operationId","status","result"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/profile":{"post":{"operationId":"profileContentResearchBrand","tags":["research"],"summary":"Queue a brand profile of a product or brand URL","description":"Read a product or brand URL on the server: Shopify products.json when the site is a store, the entry page and a few of its own pages by static fetch, Parallel Extract or a rendered read (ScreenshotOne; a marketplace listing is read rendered, gallery included), the logo and product pictures stored as the caller's image artifacts, a screenshot of the entry page, and one extraction pass. When it completes, the profiled product lands in the caller's product library (created, or an existing entry for the same page filled in) unless `save_to_library` is false. Requires a Brain session token; unlike the other research routes it is open to every account, not only the content-research rollout, because the creation agents' brand kit is this job. Queues a profile job and returns its operation for polling; a repeat of the same key returns the same operation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotency_key":{"type":"string","minLength":1,"maxLength":128},"url":{"type":"string","maxLength":2000,"pattern":"^https?:\\/\\/"},"notes":{"type":"string","minLength":1,"maxLength":2000},"save_to_library":{"type":"boolean"}},"required":["idempotency_key","url"]}}}},"responses":{"200":{"description":"Persisted research result","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/report":{"post":{"operationId":"saveContentResearchReport","tags":["research"],"summary":"Save a cloud research report to Social Strategy","description":"Requires a Brain session token and the content-research feature flag, or the creator-scout-agent flag for a creator collaboration report. The authenticated account owns the saved report.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotency_key":{"type":"string","minLength":1,"maxLength":128},"data":{"type":"object","properties":{"layout":{"type":"string","enum":["research","strategy_brief","reddit_listening","x_listening","social_listening","creator_collaboration"]},"cover":{"type":"object","properties":{"clientName":{"type":"string","minLength":1},"reportSubtitle":{"type":"string","nullable":true},"clientContact":{"type":"string","nullable":true},"reportDate":{"type":"string","nullable":true}},"required":["clientName"],"additionalProperties":{"nullable":true}},"exec":{"type":"object","additionalProperties":{"nullable":true}},"landscape":{"type":"object","additionalProperties":{"nullable":true}},"competitive":{"type":"object","additionalProperties":{"nullable":true}},"platforms":{"type":"object","properties":{"tiktok":{"type":"object","properties":{"brand_headline":{"type":"string","nullable":true},"brand_intro":{"type":"string","nullable":true},"brand_videos":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1},"thumb":{"type":"string","nullable":true},"handle":{"type":"string","nullable":true},"metric":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["url"],"additionalProperties":{"nullable":true}}},"brand_empty_note":{"type":"string","nullable":true},"creator_headline":{"type":"string","nullable":true},"creator_intro":{"type":"string","nullable":true},"creator_videos":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1},"thumb":{"type":"string","nullable":true},"handle":{"type":"string","nullable":true},"metric":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["url"],"additionalProperties":{"nullable":true}}},"creator_empty_note":{"type":"string","nullable":true}},"additionalProperties":{"nullable":true}},"instagram":{"type":"object","properties":{"brand_headline":{"type":"string","nullable":true},"brand_intro":{"type":"string","nullable":true},"brand_videos":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1},"thumb":{"type":"string","nullable":true},"handle":{"type":"string","nullable":true},"metric":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["url"],"additionalProperties":{"nullable":true}}},"brand_empty_note":{"type":"string","nullable":true},"creator_headline":{"type":"string","nullable":true},"creator_intro":{"type":"string","nullable":true},"creator_videos":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1},"thumb":{"type":"string","nullable":true},"handle":{"type":"string","nullable":true},"metric":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["url"],"additionalProperties":{"nullable":true}}},"creator_empty_note":{"type":"string","nullable":true}},"additionalProperties":{"nullable":true}},"youtube":{"type":"object","properties":{"brand_headline":{"type":"string","nullable":true},"brand_intro":{"type":"string","nullable":true},"brand_videos":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1},"thumb":{"type":"string","nullable":true},"handle":{"type":"string","nullable":true},"metric":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["url"],"additionalProperties":{"nullable":true}}},"brand_empty_note":{"type":"string","nullable":true},"creator_headline":{"type":"string","nullable":true},"creator_intro":{"type":"string","nullable":true},"creator_videos":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1},"thumb":{"type":"string","nullable":true},"handle":{"type":"string","nullable":true},"metric":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"observedAt":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true},"tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]}},"required":["url"],"additionalProperties":{"nullable":true}}},"creator_empty_note":{"type":"string","nullable":true}},"additionalProperties":{"nullable":true}}},"additionalProperties":{"nullable":true}},"meta_ads":{"type":"object","properties":{"headline":{"type":"string","nullable":true},"intro":{"type":"string","nullable":true},"ads":{"type":"array","items":{"type":"object","properties":{"advertiser":{"type":"string","minLength":1},"ad_id":{"anyOf":[{"type":"string"},{"type":"number"}]},"query":{"type":"string","nullable":true},"thumb":{"type":"string","nullable":true}},"required":["advertiser"],"additionalProperties":{"nullable":true}}},"empty_note":{"type":"string","nullable":true}},"additionalProperties":{"nullable":true}},"formats":{"type":"object","additionalProperties":{"nullable":true}},"strategies":{"type":"object","properties":{"headline":{"type":"string","nullable":true},"intro":{"type":"string","nullable":true},"closingHeadline":{"type":"string","nullable":true},"closingCopy":{"type":"string","nullable":true},"items":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1},"platform":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"metric":{"type":"string","nullable":true},"posted":{"type":"string","nullable":true},"handle":{"type":"string","nullable":true},"url":{"type":"string","minLength":1},"thumb":{"type":"string","nullable":true},"why_this_video":{"type":"string","nullable":true},"avatar":{"type":"string","nullable":true},"product":{"type":"string","nullable":true},"keep":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"change":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"hook_to_keep":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"what_to_change":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"style":{"type":"string","nullable":true},"overlays":{"type":"array","items":{"type":"string"}},"message":{"type":"string","nullable":true},"hook":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"script":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"cta":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"audience":{"type":"string","nullable":true},"observedAt":{"type":"string","nullable":true},"source_tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]},"analysisArtifactId":{"type":"string","nullable":true}},"required":["title","url"],"additionalProperties":{"nullable":true}},"minItems":1},"reserves":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1},"platform":{"type":"string","nullable":true},"format":{"type":"string","nullable":true},"metric":{"type":"string","nullable":true},"posted":{"type":"string","nullable":true},"handle":{"type":"string","nullable":true},"url":{"type":"string","minLength":1},"thumb":{"type":"string","nullable":true},"why_this_video":{"type":"string","nullable":true},"avatar":{"type":"string","nullable":true},"product":{"type":"string","nullable":true},"keep":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"change":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"hook_to_keep":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"what_to_change":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"style":{"type":"string","nullable":true},"overlays":{"type":"array","items":{"type":"string"}},"message":{"type":"string","nullable":true},"hook":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"script":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"cta":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":12}]},"audience":{"type":"string","nullable":true},"observedAt":{"type":"string","nullable":true},"source_tier":{"type":"string","nullable":true,"enum":["outlier","reference","unverified",null]},"analysisArtifactId":{"type":"string","nullable":true}},"required":["url"],"additionalProperties":{"nullable":true}}}},"required":["items"],"additionalProperties":{"nullable":true}},"reddit":{"type":"object","properties":{"window":{"type":"string","enum":["day","week","month"]},"scannedAt":{"type":"string"},"stats":{"type":"object","properties":{"scannedPosts":{"type":"integer","minimum":0},"candidates":{"type":"integer","minimum":0},"brand":{"type":"integer","minimum":0,"default":0},"competitor":{"type":"integer","minimum":0,"default":0},"need":{"type":"integer","minimum":0,"default":0}},"required":["scannedPosts","candidates"],"additionalProperties":{"nullable":true}},"audience":{"type":"object","properties":{"icp":{"type":"string","minLength":1},"useCases":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"capability":{"type":"string","minLength":1},"detail":{"type":"string"}},"required":["name","capability"],"additionalProperties":{"nullable":true}},"maxItems":12,"default":[]}},"required":["icp"],"additionalProperties":{"nullable":true}},"pulse":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"summary":{"type":"string","minLength":1},"tone":{"type":"string","enum":["positive","mixed","negative","neutral"],"default":"mixed"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"}},"required":["label","url"]},"maxItems":8,"default":[]}},"required":["name","summary"],"additionalProperties":{"nullable":true}},"maxItems":20,"default":[]},"threads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"subreddit":{"type":"string"},"title":{"type":"string","minLength":1},"excerpt":{"type":"string","default":""},"author":{"type":"string","default":""},"postedAt":{"type":"string","nullable":true},"score":{"type":"number","default":0},"numComments":{"type":"number","default":0},"bucket":{"type":"string","enum":["brand","competitor","need"]},"postType":{"type":"string"},"matched":{"type":"array","items":{"type":"string"},"default":[]},"thumb":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","gallery","crosspost","video","link"],"default":"text"},"verdict":{"type":"string","enum":["reply","help","skip"]},"why":{"type":"string","default":""},"risk":{"type":"string","default":""},"reply":{"type":"string","maxLength":4000,"default":""},"changed":{"type":"boolean"},"useCase":{"type":"string","nullable":true}},"required":["id","url","subreddit","title","bucket","verdict"],"additionalProperties":{"nullable":true}},"minItems":1,"maxItems":30},"revision":{"type":"object","properties":{"feedback":{"type":"string","minLength":1},"changes":{"type":"array","items":{"type":"string"},"maxItems":20,"default":[]}},"required":["feedback"]}},"required":["window","scannedAt","stats","threads"],"additionalProperties":{"nullable":true}},"creators":{"type":"object","properties":{"criteria":{"type":"object","properties":{"segment":{"type":"string","enum":["ugc","micro","influencer","all"],"default":"all"},"bands":{"type":"string","enum":["5k-50k","10k-100k"]},"targetCount":{"type":"integer","minimum":1,"maximum":100,"default":40},"platforms":{"type":"array","items":{"type":"string","enum":["tiktok","instagram","youtube"]},"minItems":1,"maxItems":3,"default":["tiktok","instagram","youtube"]},"niches":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30,"default":[]},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30,"default":[]},"excludedKeywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30,"default":[]},"minFollowers":{"type":"integer","minimum":0},"maxFollowers":{"type":"integer","minimum":0},"locations":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30,"default":[]},"languages":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30,"default":[]},"minAverageViews":{"type":"integer","minimum":0},"minEngagementRate":{"type":"number","minimum":0,"maximum":100},"activeWithinDays":{"type":"integer","minimum":1,"maximum":365},"requireOutlier":{"type":"boolean","default":false},"excludeCompetitorPartners":{"type":"boolean","default":false}}},"productUrl":{"type":"string","nullable":true,"maxLength":4096,"pattern":"^https:\\/\\//i"},"sourceReportId":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"scannedAt":{"type":"string","format":"date-time"},"competitors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":2000},"aliases":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"sourceUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"}},"required":["name","aliases","sourceUrl"]},"maxItems":30},"searched":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"candidatesReviewed":{"type":"integer","minimum":0},"coverage":{"type":"object","properties":{"reviewedAccountUrls":{"type":"array","items":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"maxItems":10000},"gaps":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":200}},"required":["reviewedAccountUrls","gaps"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"accounts":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"handle":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"url":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"avatarUrl":{"type":"string","nullable":true,"maxLength":4096,"pattern":"^https:\\/\\//i"},"avatarThumb":{"type":"string","nullable":true},"followers":{"type":"integer","nullable":true,"minimum":0},"postCount":{"type":"integer","nullable":true,"minimum":0},"bio":{"type":"string","maxLength":4000},"location":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"language":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"observedAt":{"type":"string","format":"date-time"}},"required":["platform","handle","name","url","avatarUrl","followers","bio","location","language","observedAt"]},"minItems":1,"maxItems":6},"primaryAccountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"fit":{"type":"string","minLength":1,"maxLength":2000},"suggestedCollaboration":{"type":"string","minLength":1,"maxLength":2000},"outreachDm":{"type":"string","minLength":1,"maxLength":600},"matchedCriteria":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"unverifiedCriteria":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"maxItems":30},"pastContent":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok","instagram","youtube"]},"accountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"url":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"caption":{"type":"string","maxLength":4000},"format":{"type":"string","enum":["video","image","carousel","unknown"]},"thumbnailUrl":{"type":"string","nullable":true,"maxLength":4096,"pattern":"^https:\\/\\//i"},"thumb":{"type":"string","nullable":true},"postedAt":{"type":"string","nullable":true,"format":"date-time"},"observedAt":{"type":"string","format":"date-time"},"views":{"type":"integer","nullable":true,"minimum":0},"likes":{"type":"integer","nullable":true,"minimum":0},"comments":{"type":"integer","nullable":true,"minimum":0},"outlier":{"type":"string","enum":["outlier","reference","unverified"]},"whyRelevant":{"type":"string","maxLength":2000}},"required":["platform","accountUrl","url","caption","thumbnailUrl","postedAt","observedAt","views","likes","comments","outlier","whyRelevant"]},"maxItems":20},"collaborations":{"type":"array","items":{"type":"object","properties":{"brand":{"type":"string","minLength":1,"maxLength":2000},"relationship":{"type":"string","enum":["disclosed","affiliate","inferred","mention"]},"evidenceUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"evidence":{"type":"string","minLength":1,"maxLength":2000},"observedAt":{"type":"string","format":"date-time"},"competitor":{"type":"boolean"}},"required":["brand","relationship","evidenceUrl","evidence","observedAt","competitor"]},"maxItems":30},"collaborationCoverage":{"type":"string","enum":["reviewed","limited","unavailable"]},"identityEvidence":{"type":"array","items":{"type":"object","properties":{"accountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"matchedAccountUrl":{"type":"string","maxLength":4096,"pattern":"^https:\\/\\//i"},"basis":{"type":"string","enum":["profile_link","name_and_image"]},"explanation":{"type":"string","minLength":1,"maxLength":2000},"confidence":{"type":"string","enum":["confirmed","probable"]},"imageSimilarity":{"type":"number","minimum":0,"maximum":1}},"required":["accountUrl","matchedAccountUrl","basis","explanation","confidence"]},"maxItems":15}},"required":["id","name","accounts","primaryAccountUrl","fit","suggestedCollaboration","matchedCriteria","unverifiedCriteria","pastContent","collaborations","collaborationCoverage","identityEvidence"]},"maxItems":100}},"required":["criteria","productUrl","sourceReportId","scannedAt","competitors","searched","candidatesReviewed","items"]},"x":{"type":"object","properties":{"window":{"type":"string","enum":["day","week","month"]},"scannedAt":{"type":"string"},"productUrl":{"type":"string","format":"uri"},"replyAs":{"type":"object","properties":{"name":{"type":"string","default":""},"handle":{"type":"string","default":""}},"additionalProperties":{"nullable":true}},"stats":{"type":"object","properties":{"searches":{"type":"integer","minimum":0,"default":0},"discovered":{"type":"integer","minimum":0},"readPosts":{"type":"integer","minimum":0,"default":0},"candidates":{"type":"integer","minimum":0},"brand":{"type":"integer","minimum":0,"default":0},"competitor":{"type":"integer","minimum":0,"default":0},"need":{"type":"integer","minimum":0,"default":0}},"required":["discovered","candidates"],"additionalProperties":{"nullable":true}},"pulse":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"summary":{"type":"string","minLength":1},"tone":{"type":"string","enum":["positive","mixed","negative","neutral"],"default":"mixed"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1},"url":{"type":"string","pattern":"^https:\\/\\/(?:www\\.|mobile\\.)?(?:x|twitter)\\.com\\/[A-Za-z0-9_]{1,15}\\/status\\/\\d{5,20}(?:[/?#][^\\s]*)?$/i"}},"required":["label","url"]},"maxItems":8,"default":[]}},"required":["name","summary"],"additionalProperties":{"nullable":true}},"maxItems":20,"default":[]},"posts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{5,20}$"},"url":{"type":"string","pattern":"^https:\\/\\/(?:www\\.|mobile\\.)?(?:x|twitter)\\.com\\/[A-Za-z0-9_]{1,15}\\/status\\/\\d{5,20}(?:[/?#][^\\s]*)?$/i"},"handle":{"type":"string"},"authorName":{"type":"string","default":""},"text":{"type":"string","default":""},"postedAt":{"type":"string","nullable":true},"likes":{"type":"number","default":0},"reposts":{"type":"number","default":0},"replies":{"type":"number","default":0},"views":{"type":"number","default":0},"bucket":{"type":"string","enum":["brand","competitor","need"]},"matched":{"type":"array","items":{"type":"string"},"default":[]},"thumb":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","video","gif","link","quote"],"default":"text"},"isReply":{"type":"boolean","default":false},"verdict":{"type":"string","enum":["reply","skip"]},"why":{"type":"string","default":""},"risk":{"type":"string","default":""},"reply":{"type":"string","maxLength":1000,"default":""},"sellingPoint":{"type":"string","nullable":true},"changed":{"type":"boolean"}},"required":["id","url","handle","bucket","verdict"],"additionalProperties":{"nullable":true}},"minItems":1,"maxItems":1000},"revision":{"type":"object","properties":{"feedback":{"type":"string","minLength":1},"changes":{"type":"array","items":{"type":"string"},"maxItems":20,"default":[]}},"required":["feedback"]}},"required":["window","scannedAt","productUrl","stats","posts"],"additionalProperties":{"nullable":true}},"status":{"type":"string","nullable":true},"requestedStrategyCount":{"type":"integer","minimum":0,"exclusiveMinimum":true},"gaps":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","minLength":1},"title":{"type":"string","nullable":true},"observedAt":{"type":"string","nullable":true}},"required":["url"],"additionalProperties":{"nullable":true}}},"connect":{"type":"object","additionalProperties":{"nullable":true}}},"required":["cover"],"additionalProperties":{"nullable":true}},"reportId":{"type":"string","minLength":1},"assets":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":255},"uploadId":{"type":"string","minLength":1,"maxLength":128}},"required":["path","uploadId"]},"maxItems":200,"default":[]},"pdfUploadId":{"type":"string","minLength":1},"htmlUploadId":{"type":"string","minLength":1}},"required":["idempotency_key","data"]}}}},"responses":{"200":{"description":"Persisted research result","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"400":{"description":"The report failed validation: every problem with its path, and the expected outline of each top-level section that had one","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/research/report/read":{"post":{"operationId":"readContentResearchReport","tags":["research"],"summary":"Read a saved report back as research context","description":"Requires a Brain session token and the content-research or creator-scout-agent feature flag. Returns the report's product, findings, every cited video and its strategies — the seed a strategist run builds on and the videos it must not recommend again. The caller must own the report or hold a share of it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":2048},"version":{"type":"integer","minimum":1}},"required":["report"]}}}},"responses":{"200":{"description":"The report as research context","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportContext"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/reddit/scan":{"post":{"operationId":"scanRedditListening","tags":["reddit-listening"],"summary":"Scan recent Reddit posts and comments against a watchlist","description":"Requires a Brain session token and the reddit-listening feature flag. Read-only. Bills the account's credits per supplier request answered (`listeningPricing.reddit`): the call's ceiling is held first, 402 when the balance cannot carry it, and what went unused is released. Searches the watchlist's queries, reads its subreddits' newest posts and the comments of the busiest matching threads, and answers ranked candidates bucketed as brand, competitor or need. Threads any of the account's saved reports already showed are left out before their comments are read (`previouslyShown` counts them) unless `includeShown`. Failed queries or feeds, and sources skipped at the scan's deadline, are listed in `errors`. 429 while a scan is in flight for the account or past 20 scans an hour.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"watchlist":{"type":"object","properties":{"brandTerms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":60},"maxItems":40,"default":[]},"competitors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"terms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":60},"minItems":1,"maxItems":8}},"required":["name","terms"]},"maxItems":25,"default":[]},"needTerms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":60},"maxItems":40,"default":[]},"searchQueries":{"type":"array","items":{"type":"string","minLength":2,"maxLength":100},"maxItems":10,"default":[]},"subreddits":{"type":"array","items":{"type":"string"},"maxItems":20,"default":[]},"excludeTerms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":60},"maxItems":40}}},"timeframe":{"type":"string","enum":["day","week","month"],"default":"week"},"commentThreads":{"type":"integer","minimum":0,"maximum":15,"default":8},"limit":{"type":"integer","minimum":1,"maximum":60,"default":60},"includeShown":{"type":"boolean","default":false}},"required":["watchlist"]}}}},"responses":{"200":{"description":"Ranked candidates","content":{"application/json":{"schema":{"type":"object","properties":{"timeframe":{"type":"string","enum":["day","week","month"]},"scannedPosts":{"type":"number"},"previouslyShown":{"type":"number"},"readThreads":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}},"candidates":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["post","comment"]},"id":{"type":"string"},"bucket":{"type":"string","enum":["brand","competitor","need"]},"subreddit":{"type":"string"},"title":{"type":"string"},"excerpt":{"type":"string"},"url":{"type":"string"},"author":{"type":"string"},"createdAt":{"type":"string","nullable":true},"score":{"type":"number"},"numComments":{"type":"number"},"matched":{"type":"object","properties":{"brand":{"type":"array","items":{"type":"string"}},"competitors":{"type":"array","items":{"type":"string"}},"needs":{"type":"array","items":{"type":"string"}},"intents":{"type":"array","items":{"type":"string"}}},"required":["brand","competitors","needs","intents"]},"postType":{"type":"string","enum":["ask","tool_search","comparison","complaint","feedback","story","discussion","mention"]},"relevance":{"type":"number"},"imageUrl":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","gallery","crosspost","video","link"]},"foundBy":{"type":"array","items":{"type":"string"}}},"required":["kind","id","bucket","subreddit","title","excerpt","url","author","createdAt","score","numComments","matched","postType","relevance","imageUrl","media","foundBy"]}},"fromLeftovers":{"type":"boolean"},"creditsCharged":{"type":"number"}},"required":["timeframe","scannedPosts","previouslyShown","readThreads","errors","candidates","creditsCharged"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/reddit/voice":{"post":{"operationId":"studyRedditVoice","tags":["reddit-listening"],"summary":"Read what a Reddit community upvotes","description":"Requires a Brain session token and the reddit-listening feature flag. Read-only. Bills the account's credits per supplier request answered (`listeningPricing.reddit`): the call's ceiling is held first, 402 when the balance cannot carry it, and what went unused is released. Reads the most-upvoted threads of the last month or year in the named subreddits or searches and answers their highest-scored top-level comments with the norms they share (length, links, lists, self-promotion) — the examples a reply draft should sound like. Shares the scan's per-account limit (one read in flight, 20 an hour).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subreddits":{"type":"array","items":{"type":"string"},"maxItems":6,"default":[]},"queries":{"type":"array","items":{"type":"string","minLength":2,"maxLength":100},"maxItems":6,"default":[]},"window":{"type":"string","enum":["month","year"],"default":"year"},"threads":{"type":"integer","minimum":1,"maximum":8,"default":6}}}}}},"responses":{"200":{"description":"Upvoted examples and their norms","content":{"application/json":{"schema":{"type":"object","properties":{"window":{"type":"string","enum":["month","year"]},"readThreads":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}},"norms":{"type":"object","properties":{"sample":{"type":"number"},"medianWords":{"type":"number"},"p75Words":{"type":"number"},"linkShare":{"type":"number"},"listShare":{"type":"number"},"firstPersonShare":{"type":"number"},"numberShare":{"type":"number"},"selfPromoShare":{"type":"number"}},"required":["sample","medianWords","p75Words","linkShare","listShare","firstPersonShare","numberShare","selfPromoShare"]},"examples":{"type":"array","items":{"type":"object","properties":{"subreddit":{"type":"string"},"threadTitle":{"type":"string"},"threadUrl":{"type":"string"},"rank":{"type":"number"},"score":{"type":"number"},"words":{"type":"number"},"body":{"type":"string"},"url":{"type":"string"}},"required":["subreddit","threadTitle","threadUrl","rank","score","words","body","url"]}},"creditsCharged":{"type":"number"}},"required":["window","readThreads","errors","norms","examples","creditsCharged"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/reddit/thread":{"post":{"operationId":"readRedditThread","tags":["reddit-listening"],"summary":"Read one Reddit thread's post and comments","description":"Requires a Brain session token and the reddit-listening feature flag. Read-only. Bills the account's credits per supplier request answered (`listeningPricing.reddit`): the call's ceiling is held first, 402 when the balance cannot carry it, and what went unused is released. Accepts reddit.com thread links only (www, old, new, m, sh hosts; not share links). Answers at most 150 comments, highest-scored, with bodies cut to size (`truncated`); 404 for a deleted, private, or unreadable thread.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":10,"maxLength":500}},"required":["url"]}}}},"responses":{"200":{"description":"The thread","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string"},"subreddit":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"author":{"type":"string"},"url":{"type":"string"},"createdAt":{"type":"string","nullable":true},"score":{"type":"number"},"numComments":{"type":"number"},"imageUrl":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","gallery","crosspost","video","link"]}},"required":["id","subreddit","title","body","author","url","createdAt","score","numComments","imageUrl","media"]},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"body":{"type":"string"},"url":{"type":"string"},"createdAt":{"type":"string","nullable":true},"score":{"type":"number"},"depth":{"type":"number"}},"required":["id","author","body","url","createdAt","score","depth"]}},"truncated":{"type":"boolean"},"creditsCharged":{"type":"number"}},"required":["post","comments","truncated","creditsCharged"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/reddit/report":{"post":{"operationId":"saveRedditReport","tags":["reddit-listening"],"summary":"Save a Reddit listening report, or a revision of one","description":"Requires a Brain session token and the reddit-listening feature flag. Stores report_data.json (layout reddit_listening) in the user's report library. Pass `reportId` to save the next version of an existing report after feedback (a social listening report takes this network's section in its place). Pass `mergeInto` (the listening report this conversation already saved for the other network) or `combined` to save into one social_listening report carrying both networks; identical data within a day is not stored twice.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"layout":{"type":"string","enum":["reddit_listening"]},"cover":{"type":"object","properties":{"clientName":{"type":"string","minLength":1},"reportSubtitle":{"type":"string","nullable":true},"reportDate":{"type":"string","nullable":true}},"required":["clientName"],"additionalProperties":{"nullable":true}},"exec":{"type":"object","additionalProperties":{"nullable":true}},"reddit":{"type":"object","properties":{"window":{"type":"string","enum":["day","week","month"]},"scannedAt":{"type":"string"},"stats":{"type":"object","properties":{"scannedPosts":{"type":"integer","minimum":0},"candidates":{"type":"integer","minimum":0},"brand":{"type":"integer","minimum":0,"default":0},"competitor":{"type":"integer","minimum":0,"default":0},"need":{"type":"integer","minimum":0,"default":0}},"required":["scannedPosts","candidates"],"additionalProperties":{"nullable":true}},"audience":{"type":"object","properties":{"icp":{"type":"string","minLength":1},"useCases":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"capability":{"type":"string","minLength":1},"detail":{"type":"string"}},"required":["name","capability"],"additionalProperties":{"nullable":true}},"maxItems":12,"default":[]}},"required":["icp"],"additionalProperties":{"nullable":true}},"pulse":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"summary":{"type":"string","minLength":1},"tone":{"type":"string","enum":["positive","mixed","negative","neutral"],"default":"mixed"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"}},"required":["label","url"]},"maxItems":8,"default":[]}},"required":["name","summary"],"additionalProperties":{"nullable":true}},"maxItems":20,"default":[]},"threads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"subreddit":{"type":"string"},"title":{"type":"string","minLength":1},"excerpt":{"type":"string","default":""},"author":{"type":"string","default":""},"postedAt":{"type":"string","nullable":true},"score":{"type":"number","default":0},"numComments":{"type":"number","default":0},"bucket":{"type":"string","enum":["brand","competitor","need"]},"postType":{"type":"string"},"matched":{"type":"array","items":{"type":"string"},"default":[]},"thumb":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","gallery","crosspost","video","link"],"default":"text"},"verdict":{"type":"string","enum":["reply","help","skip"]},"why":{"type":"string","default":""},"risk":{"type":"string","default":""},"reply":{"type":"string","maxLength":4000,"default":""},"changed":{"type":"boolean"},"useCase":{"type":"string","nullable":true}},"required":["id","url","subreddit","title","bucket","verdict"],"additionalProperties":{"nullable":true}},"minItems":1,"maxItems":30},"revision":{"type":"object","properties":{"feedback":{"type":"string","minLength":1},"changes":{"type":"array","items":{"type":"string"},"maxItems":20,"default":[]}},"required":["feedback"]}},"required":["window","scannedAt","stats","threads"],"additionalProperties":{"nullable":true}},"status":{"type":"string","nullable":true},"gaps":{"type":"array","items":{"type":"string"}}},"required":["layout","cover","reddit"],"additionalProperties":{"nullable":true}},"reportId":{"type":"string","minLength":1,"maxLength":100},"mergeInto":{"type":"string","minLength":1,"maxLength":100},"combined":{"type":"boolean"}},"required":["data"]}}}},"responses":{"200":{"description":"The saved version","content":{"application/json":{"schema":{"type":"object","properties":{"reportId":{"type":"string"},"url":{"type":"string"},"version":{"type":"integer"},"kind":{"type":"string"},"mergedData":{"type":"object","additionalProperties":{"nullable":true}},"mergedFrom":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"locked":{"nullable":true}},"required":["reportId","url","version","kind","warnings"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/reddit/report/read":{"post":{"operationId":"readRedditReport","tags":["reddit-listening"],"summary":"Read a Reddit listening report's data back for a revision","description":"Requires a Brain session token and the reddit-listening feature flag. Answers the stored report_data.json of the latest (or the given) version, with the version list. 400 for a report that is not a Reddit listening report.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":500},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["report"]}}}},"responses":{"200":{"description":"The report data","content":{"application/json":{"schema":{"type":"object","properties":{"reportId":{"type":"string"},"url":{"type":"string"},"version":{"type":"integer"},"versions":{"type":"array","items":{"type":"integer"}},"data":{"type":"object","additionalProperties":{"nullable":true}}},"required":["reportId","url","version","versions","data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/x/scan":{"post":{"operationId":"scanXListening","tags":["x-listening"],"summary":"Find fresh posts on X against a watchlist","description":"Requires a Brain session token and the x-listening feature flag. Read-only. Bills the account's credits per supplier request answered (`listeningPricing.x`: a search page of up to 20 whole posts, a post read whole; a page with no posts is free): the call's ceiling is held first, 402 when the balance cannot carry it, and what went unused is released. Runs one native X search per watchlist query (English posts, not replies) and per account inside the window — a page of up to 20 whole posts with their counts, hours old — and a second page for a source only while its first was full and fewer than `limit` candidates were found; nothing is read after the search. Every post the account's saved reports already showed is left out before ranking (`previouslyShown` counts them) unless `includeShown`; the answer is ranked candidates bucketed as brand, competitor or need. Failed searches, and those skipped at the scan's deadline, are listed in `errors`. 429 while a scan is in flight for the account or past 8 scans an hour.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"watchlist":{"type":"object","properties":{"brandTerms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":60},"maxItems":40,"default":[]},"competitors":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"terms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":60},"minItems":1,"maxItems":8}},"required":["name","terms"]},"maxItems":25,"default":[]},"needTerms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":60},"maxItems":40,"default":[]},"searchQueries":{"type":"array","items":{"type":"string","minLength":2,"maxLength":100},"maxItems":8,"default":[]},"accounts":{"type":"array","items":{"type":"string"},"maxItems":6,"default":[]},"ownHandles":{"type":"array","items":{"type":"string"},"maxItems":10},"excludeTerms":{"type":"array","items":{"type":"string","minLength":2,"maxLength":60},"maxItems":40},"excludePostIds":{"type":"array","items":{"type":"string","pattern":"^\\d{5,20}$"},"maxItems":1000}}},"timeframe":{"type":"string","enum":["day","week","month"],"default":"week"},"readPosts":{"type":"integer","minimum":1,"maximum":40},"limit":{"type":"integer","minimum":1,"maximum":40,"default":10},"includeShown":{"type":"boolean","default":false}},"required":["watchlist"]}}}},"responses":{"200":{"description":"Ranked candidates","content":{"application/json":{"schema":{"type":"object","properties":{"timeframe":{"type":"string","enum":["day","week","month"]},"searches":{"type":"number"},"discovered":{"type":"number"},"previouslyShown":{"type":"number"},"readPosts":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}},"candidates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bucket":{"type":"string","enum":["brand","competitor","need"]},"url":{"type":"string"},"handle":{"type":"string"},"authorName":{"type":"string"},"authorFollowers":{"type":"number"},"verified":{"type":"boolean"},"excerpt":{"type":"string"},"createdAt":{"type":"string","nullable":true},"likes":{"type":"number"},"reposts":{"type":"number"},"replies":{"type":"number"},"views":{"type":"number"},"isReply":{"type":"boolean"},"matched":{"type":"object","properties":{"brand":{"type":"array","items":{"type":"string"}},"competitors":{"type":"array","items":{"type":"string"}},"needs":{"type":"array","items":{"type":"string"}},"intents":{"type":"array","items":{"type":"string"}}},"required":["brand","competitors","needs","intents"]},"relevance":{"type":"number"},"imageUrl":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","video","gif","link","quote"]},"foundBy":{"type":"array","items":{"type":"string"}},"competitorAccount":{"type":"string","nullable":true}},"required":["id","bucket","url","handle","authorName","authorFollowers","verified","excerpt","createdAt","likes","reposts","replies","views","isReply","matched","relevance","imageUrl","media","foundBy","competitorAccount"]}},"fromLeftovers":{"type":"number"},"creditsCharged":{"type":"number"}},"required":["timeframe","searches","discovered","previouslyShown","readPosts","errors","candidates","creditsCharged"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/x/thread":{"post":{"operationId":"readXThread","tags":["x-listening"],"summary":"Read one post on X, and the post it answers","description":"Requires a Brain session token and the x-listening feature flag. Read-only. Bills the account's credits per supplier request answered (`listeningPricing.x`: a search page of up to 20 whole posts, a post read whole; a page with no posts is free): the call's ceiling is held first, 402 when the balance cannot carry it, and what went unused is released. Accepts x.com and twitter.com post links only. Answers the post whole and, when it is a reply, its parent (two reads at most; a post a scan answered is read from memory for free); with `studyReplies`, one page of the post's direct replies sorted by likes, the three most liked kept — one search page, not a complete discussion. 404 for a deleted, protected, or unreadable post; 429 past 120 reads an hour for the account.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":10,"maxLength":500},"studyReplies":{"type":"boolean","default":false}},"required":["url"]}}}},"responses":{"200":{"description":"The post","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":"string"},"authorName":{"type":"string"},"authorFollowers":{"type":"number"},"verified":{"type":"boolean"},"text":{"type":"string"},"url":{"type":"string"},"createdAt":{"type":"string","nullable":true},"likes":{"type":"number"},"reposts":{"type":"number"},"replies":{"type":"number"},"quotes":{"type":"number"},"views":{"type":"number"},"lang":{"type":"string"},"inReplyTo":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"handle":{"type":"string"}},"required":["id","handle"]},"imageUrl":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","video","gif","link","quote"]}},"required":["id","handle","authorName","authorFollowers","verified","text","url","createdAt","likes","reposts","replies","quotes","views","lang","inReplyTo","imageUrl","media"]},"parent":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"handle":{"type":"string"},"authorName":{"type":"string"},"authorFollowers":{"type":"number"},"verified":{"type":"boolean"},"text":{"type":"string"},"url":{"type":"string"},"createdAt":{"type":"string","nullable":true},"likes":{"type":"number"},"reposts":{"type":"number"},"replies":{"type":"number"},"quotes":{"type":"number"},"views":{"type":"number"},"lang":{"type":"string"},"inReplyTo":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"handle":{"type":"string"}},"required":["id","handle"]},"imageUrl":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","video","gif","link","quote"]}},"required":["id","handle","authorName","authorFollowers","verified","text","url","createdAt","likes","reposts","replies","quotes","views","lang","inReplyTo","imageUrl","media"]},"creditsCharged":{"type":"number"},"replyEvidence":{"type":"object","properties":{"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":"string"},"authorName":{"type":"string"},"authorFollowers":{"type":"number"},"verified":{"type":"boolean"},"text":{"type":"string"},"url":{"type":"string"},"createdAt":{"type":"string","nullable":true},"likes":{"type":"number"},"reposts":{"type":"number"},"replies":{"type":"number"},"quotes":{"type":"number"},"views":{"type":"number"},"lang":{"type":"string"},"inReplyTo":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"handle":{"type":"string"}},"required":["id","handle"]},"imageUrl":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","video","gif","link","quote"]}},"required":["id","handle","authorName","authorFollowers","verified","text","url","createdAt","likes","reposts","replies","quotes","views","lang","inReplyTo","imageUrl","media"]}},"observedAt":{"type":"string"},"coverage":{"type":"string","enum":["sampled"]},"gaps":{"type":"array","items":{"type":"string"}}},"required":["replies","observedAt","coverage","gaps"]}},"required":["post","parent","creditsCharged"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/x/report":{"post":{"operationId":"saveXReport","tags":["x-listening"],"summary":"Save an X listening report, or a revision of one","description":"Requires a Brain session token and the x-listening feature flag. Stores report_data.json (layout x_listening) in the user's report library. Pass `reportId` to save the next version of an existing report after feedback (a social listening report takes this network's section in its place). Pass `mergeInto` (the listening report this conversation already saved for the other network) or `combined` to save into one social_listening report carrying both networks; identical data within a day is not stored twice.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"layout":{"type":"string","enum":["x_listening"]},"cover":{"type":"object","properties":{"clientName":{"type":"string","minLength":1},"reportSubtitle":{"type":"string","nullable":true},"reportDate":{"type":"string","nullable":true}},"required":["clientName"],"additionalProperties":{"nullable":true}},"exec":{"type":"object","additionalProperties":{"nullable":true}},"x":{"type":"object","properties":{"window":{"type":"string","enum":["day","week","month"]},"scannedAt":{"type":"string"},"productUrl":{"type":"string","format":"uri"},"replyAs":{"type":"object","properties":{"name":{"type":"string","default":""},"handle":{"type":"string","default":""}},"additionalProperties":{"nullable":true}},"stats":{"type":"object","properties":{"searches":{"type":"integer","minimum":0,"default":0},"discovered":{"type":"integer","minimum":0},"readPosts":{"type":"integer","minimum":0,"default":0},"candidates":{"type":"integer","minimum":0},"brand":{"type":"integer","minimum":0,"default":0},"competitor":{"type":"integer","minimum":0,"default":0},"need":{"type":"integer","minimum":0,"default":0}},"required":["discovered","candidates"],"additionalProperties":{"nullable":true}},"pulse":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"summary":{"type":"string","minLength":1},"tone":{"type":"string","enum":["positive","mixed","negative","neutral"],"default":"mixed"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1},"url":{"type":"string","pattern":"^https:\\/\\/(?:www\\.|mobile\\.)?(?:x|twitter)\\.com\\/[A-Za-z0-9_]{1,15}\\/status\\/\\d{5,20}(?:[/?#][^\\s]*)?$/i"}},"required":["label","url"]},"maxItems":8,"default":[]}},"required":["name","summary"],"additionalProperties":{"nullable":true}},"maxItems":20,"default":[]},"posts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{5,20}$"},"url":{"type":"string","pattern":"^https:\\/\\/(?:www\\.|mobile\\.)?(?:x|twitter)\\.com\\/[A-Za-z0-9_]{1,15}\\/status\\/\\d{5,20}(?:[/?#][^\\s]*)?$/i"},"handle":{"type":"string"},"authorName":{"type":"string","default":""},"text":{"type":"string","default":""},"postedAt":{"type":"string","nullable":true},"likes":{"type":"number","default":0},"reposts":{"type":"number","default":0},"replies":{"type":"number","default":0},"views":{"type":"number","default":0},"bucket":{"type":"string","enum":["brand","competitor","need"]},"matched":{"type":"array","items":{"type":"string"},"default":[]},"thumb":{"type":"string","nullable":true},"media":{"type":"string","enum":["text","image","video","gif","link","quote"],"default":"text"},"isReply":{"type":"boolean","default":false},"verdict":{"type":"string","enum":["reply","skip"]},"why":{"type":"string","default":""},"risk":{"type":"string","default":""},"reply":{"type":"string","maxLength":1000,"default":""},"sellingPoint":{"type":"string","nullable":true},"changed":{"type":"boolean"}},"required":["id","url","handle","bucket","verdict"],"additionalProperties":{"nullable":true}},"minItems":1,"maxItems":1000},"revision":{"type":"object","properties":{"feedback":{"type":"string","minLength":1},"changes":{"type":"array","items":{"type":"string"},"maxItems":20,"default":[]}},"required":["feedback"]}},"required":["window","scannedAt","productUrl","stats","posts"],"additionalProperties":{"nullable":true}},"status":{"type":"string","nullable":true},"gaps":{"type":"array","items":{"type":"string"}}},"required":["layout","cover","x"],"additionalProperties":{"nullable":true}},"reportId":{"type":"string","minLength":1,"maxLength":100},"mergeInto":{"type":"string","minLength":1,"maxLength":100},"combined":{"type":"boolean"}},"required":["data"]}}}},"responses":{"200":{"description":"The saved version","content":{"application/json":{"schema":{"type":"object","properties":{"reportId":{"type":"string"},"url":{"type":"string"},"version":{"type":"integer"},"kind":{"type":"string"},"mergedData":{"type":"object","additionalProperties":{"nullable":true}},"mergedFrom":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}},"locked":{"nullable":true}},"required":["reportId","url","version","kind","warnings"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/x/report/read":{"post":{"operationId":"readXReport","tags":["x-listening"],"summary":"Read an X listening report's data back for a revision","description":"Requires a Brain session token and the x-listening feature flag. Answers the stored report_data.json of the latest (or the given) version, with the version list. 400 for a report that is neither an X listening report nor a social listening report.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":500},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["report"]}}}},"responses":{"200":{"description":"The report data","content":{"application/json":{"schema":{"type":"object","properties":{"reportId":{"type":"string"},"url":{"type":"string"},"version":{"type":"integer"},"versions":{"type":"array","items":{"type":"integer"}},"data":{"type":"object","additionalProperties":{"nullable":true}}},"required":["reportId","url","version","versions","data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/admin/deliverable-notifications/requeue":{"post":{"tags":["Admin"],"operationId":"adminRequeueReadyEmails","summary":"Send ready emails again","description":"Takes sent 'your video / report is ready' emails back so the next sweep mails them once more (admin only): by ledger batch, by owner over a window, or everyone over a window (at most the last 24 hours). With includeFailed, rows that failed on a provider quota or rate limit in that window are taken back too. Each row records 'requeued by admin'; the resend goes out under a new Resend idempotency key.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRequeueReadyEmailsInput"}}}},"responses":{"200":{"description":"How many ledger rows were requeued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRequeueReadyEmailsResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/profile.user":{"post":{"tags":["internal.profile"],"operationId":"internalProfileUser","summary":"Get user profile with skills","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"search":{"type":"string"},"sort":{"type":"string","enum":["downloads","recent","name","stars"],"default":"downloads"},"namespace":{"type":"string","enum":["user","github"]},"page":{"type":"integer","minimum":1,"default":1},"limit":{"type":"integer","minimum":1,"maximum":100,"default":20},"username":{"$ref":"#/components/schemas/Username"}},"required":["username"]}}}},"responses":{"200":{"description":"User profile with paginated skills","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"oneOf":[{"$ref":"#/components/schemas/InternalUserProfile"},{"$ref":"#/components/schemas/InternalGithubOwnerProfile"},{"$ref":"#/components/schemas/InternalGithubRepoProfile"}],"discriminator":{"propertyName":"type","mapping":{"user":"#/components/schemas/InternalUserProfile","github_owner":"#/components/schemas/InternalGithubOwnerProfile","github_repo":"#/components/schemas/InternalGithubRepoProfile"}}},"skills":{"type":"array","items":{"$ref":"#/components/schemas/ExploreSkill"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"}},"required":["profile","skills","total","page","limit","totalPages"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/profile.githubOwner":{"post":{"tags":["internal.profile"],"operationId":"internalProfileGithubOwner","summary":"Get GitHub owner profile with skills","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"search":{"type":"string"},"sort":{"type":"string","enum":["downloads","recent","name","stars"],"default":"downloads"},"namespace":{"type":"string","enum":["user","github"]},"page":{"type":"integer","minimum":1,"default":1},"limit":{"type":"integer","minimum":1,"maximum":100,"default":20},"owner":{"$ref":"#/components/schemas/Username"}},"required":["owner"]}}}},"responses":{"200":{"description":"GitHub owner profile with paginated skills","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"oneOf":[{"$ref":"#/components/schemas/InternalUserProfile"},{"$ref":"#/components/schemas/InternalGithubOwnerProfile"},{"$ref":"#/components/schemas/InternalGithubRepoProfile"}],"discriminator":{"propertyName":"type","mapping":{"user":"#/components/schemas/InternalUserProfile","github_owner":"#/components/schemas/InternalGithubOwnerProfile","github_repo":"#/components/schemas/InternalGithubRepoProfile"}}},"skills":{"type":"array","items":{"$ref":"#/components/schemas/ExploreSkill"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"}},"required":["profile","skills","total","page","limit","totalPages"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/profile.githubRepo":{"post":{"tags":["internal.profile"],"operationId":"internalProfileGithubRepo","summary":"Get GitHub repo profile with skills","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"search":{"type":"string"},"sort":{"type":"string","enum":["downloads","recent","name","stars"],"default":"downloads"},"namespace":{"type":"string","enum":["user","github"]},"page":{"type":"integer","minimum":1,"default":1},"limit":{"type":"integer","minimum":1,"maximum":100,"default":20},"owner":{"$ref":"#/components/schemas/Username"},"repo":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9._-]+$"}},"required":["owner","repo"]}}}},"responses":{"200":{"description":"GitHub repo profile with paginated skills","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"oneOf":[{"$ref":"#/components/schemas/InternalUserProfile"},{"$ref":"#/components/schemas/InternalGithubOwnerProfile"},{"$ref":"#/components/schemas/InternalGithubRepoProfile"}],"discriminator":{"propertyName":"type","mapping":{"user":"#/components/schemas/InternalUserProfile","github_owner":"#/components/schemas/InternalGithubOwnerProfile","github_repo":"#/components/schemas/InternalGithubRepoProfile"}}},"skills":{"type":"array","items":{"$ref":"#/components/schemas/ExploreSkill"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"}},"required":["profile","skills","total","page","limit","totalPages"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.listRepos":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerListRepos","summary":"List indexed repos","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"List of indexed repos","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"owner":{"type":"string"},"repo":{"type":"string"},"defaultRef":{"type":"string","nullable":true},"lastIndexedAt":{"type":"string","nullable":true},"lastCommitSha":{"type":"string","nullable":true},"indexStatus":{"type":"string","nullable":true},"skillCount":{"type":"number","nullable":true},"createdAt":{"type":"string"}},"required":["id","owner","repo","defaultRef","lastIndexedAt","lastCommitSha","indexStatus","skillCount","createdAt"]}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.listRepoSkills":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerListRepoSkills","summary":"List skills in an indexed repo","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"responses":{"200":{"description":"List of skills in the repo","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"githubPath":{"type":"string","nullable":true},"visibility":{"type":"string"},"downloadCount":{"type":"number"},"versionCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","githubPath","visibility","downloadCount","versionCount","createdAt","updatedAt"]}}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.addRepo":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerAddRepo","summary":"Add repo to index","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string","minLength":1},"repo":{"type":"string","minLength":1},"ref":{"type":"string"}},"required":["owner","repo"]}}}},"responses":{"200":{"description":"Repo added","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"owner":{"type":"string"},"repo":{"type":"string"},"defaultRef":{"type":"string","nullable":true},"lastIndexedAt":{"type":"string","nullable":true},"lastCommitSha":{"type":"string","nullable":true},"indexStatus":{"type":"string","nullable":true},"skillCount":{"type":"number","nullable":true},"createdAt":{"type":"string"}},"required":["id","owner","repo","defaultRef","lastIndexedAt","lastCommitSha","indexStatus","skillCount","createdAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.runRepo":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerRunRepo","summary":"Run indexer for a specific repo","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"responses":{"200":{"description":"Job enqueued or synchronous result","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}},"required":["jobId","status","message"]},{"type":"object","properties":{"owner":{"type":"string"},"repo":{"type":"string"},"ref":{"type":"string"},"commitSha":{"type":"string"},"skillsDiscovered":{"type":"number"},"skillsCreated":{"type":"number"},"skillsUpdated":{"type":"number"},"skillsSkipped":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}}},"required":["owner","repo","ref","commitSha","skillsDiscovered","skillsCreated","skillsUpdated","skillsSkipped","errors"]}]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.runAll":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerRunAll","summary":"Re-index all repos","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Jobs enqueued or synchronous results","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}},"required":["jobId","status","message"]}},{"type":"array","items":{"type":"object","properties":{"owner":{"type":"string"},"repo":{"type":"string"},"ref":{"type":"string"},"commitSha":{"type":"string"},"skillsDiscovered":{"type":"number"},"skillsCreated":{"type":"number"},"skillsUpdated":{"type":"number"},"skillsSkipped":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}}},"required":["owner","repo","ref","commitSha","skillsDiscovered","skillsCreated","skillsUpdated","skillsSkipped","errors"]}}]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.deleteRepo":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerDeleteRepo","summary":"Remove indexed repo","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"responses":{"200":{"description":"Repo removed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.deleteRepoSkill":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerDeleteRepoSkill","summary":"Delete a skill from an indexed repo","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"skillId":{"type":"string"}},"required":["id","skillId"]}}}},"responses":{"200":{"description":"Skill deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.bulkAction":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerBulkAction","summary":"Perform bulk indexer action","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["index-pending","index-failed","reset-status","purge-jobs"]}},"required":["action"]}}}},"responses":{"200":{"description":"Bulk action result","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string"},"affected":{"type":"number"},"message":{"type":"string"}},"required":["action","affected","message"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.getJob":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerGetJob","summary":"Get job status","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"responses":{"200":{"description":"Job status","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"repoId":{"type":"string","nullable":true},"status":{"type":"string"},"totalSkills":{"type":"number","nullable":true},"completedSkills":{"type":"number","nullable":true},"failedSkills":{"type":"number","nullable":true},"result":{"nullable":true},"error":{"type":"string","nullable":true},"createdAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true}},"required":["id","type","repoId","status","totalSkills","completedSkills","failedSkills","error","createdAt","startedAt","completedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.listJobs":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerListJobs","summary":"List recent indexer jobs","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","minimum":1,"default":1},"limit":{"type":"integer","minimum":1,"maximum":100,"default":20},"status":{"type":"string","enum":["queued","active","completed","failed"]},"sort":{"type":"string","enum":["createdAt","status","type"],"default":"createdAt"},"order":{"type":"string","enum":["asc","desc"],"default":"desc"}}}}}},"responses":{"200":{"description":"Paginated jobs","content":{"application/json":{"schema":{"type":"object","properties":{"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"repoId":{"type":"string","nullable":true},"status":{"type":"string"},"totalSkills":{"type":"number","nullable":true},"completedSkills":{"type":"number","nullable":true},"failedSkills":{"type":"number","nullable":true},"result":{"nullable":true},"error":{"type":"string","nullable":true},"createdAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true}},"required":["id","type","repoId","status","totalSkills","completedSkills","failedSkills","error","createdAt","startedAt","completedAt"]}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"totalPages":{"type":"number"}},"required":["jobs","total","page","limit","totalPages"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.submitRepo":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerSubmitRepo","summary":"Submit a GitHub repo for indexing","description":"Authenticated users can submit a GitHub URL. Server upserts the repo, parses owner/repo, and enqueues an indexing job (or returns the active one).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1}},"required":["url"]}}}},"responses":{"200":{"description":"Submission accepted","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"repoId":{"type":"string"},"owner":{"type":"string"},"repo":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}},"required":["jobId","repoId","owner","repo","status","message"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/indexer.getSubmission":{"post":{"tags":["internal.indexer"],"operationId":"internalIndexerGetSubmission","summary":"Get indexer submission status","description":"Get the status of a submitted indexing job for the user-facing tracker.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"responses":{"200":{"description":"Submission status","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"repo":{"type":"string","nullable":true},"totalSkills":{"type":"number","nullable":true},"completedSkills":{"type":"number","nullable":true},"failedSkills":{"type":"number","nullable":true},"error":{"type":"string","nullable":true},"createdAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true}},"required":["id","status","owner","repo","totalSkills","completedSkills","failedSkills","error","createdAt","startedAt","completedAt"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/notifications/presence":{"post":{"tags":["internal.notifications"],"summary":"The session is open in a visible tab","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string","minLength":1,"maxLength":200},"timezone":{"type":"string","minLength":1,"maxLength":64}},"required":["sessionId"]}}}},"responses":{"204":{"description":"Recorded"},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/notifications/seen":{"post":{"tags":["internal.notifications"],"summary":"The user saw these deliverables","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["video","report","video_awaiting"]},"targetId":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","targetId"]},"minItems":1,"maxItems":50}},"required":["items"]}}}},"responses":{"204":{"description":"Recorded"},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/notifications/email-preferences":{"get":{"tags":["internal.notifications"],"summary":"Which optional emails the user receives","responses":{"200":{"description":"The preferences","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalEmailPreferences"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["internal.notifications"],"summary":"Turn an optional email on or off","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalEmailPreferences"}}}},"responses":{"200":{"description":"The preferences after the change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalEmailPreferences"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/notifications/agent-team-run/claim":{"post":{"tags":["internal.notifications"],"summary":"The agent-team invite's button was clicked","responses":{"200":{"description":"What the Studio should do","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalAgentTeamRunClaim"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/internal/notifications/agent-team-run/started":{"post":{"tags":["internal.notifications"],"summary":"The chat the invite's button started","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"brainSessionId":{"type":"string","minLength":1,"maxLength":200}},"required":["brainSessionId"]}}}},"responses":{"204":{"description":"Recorded"},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}