{"openapi":"3.0.3","info":{"title":"Storylines REST API","description":"Backend REST API for Storylines","version":"1.0.0"},"components":{"schemas":{"ClientGroup":{"additionalProperties":false,"type":"object","properties":{"id":{"minLength":1,"maxLength":60,"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","createdAt","updatedAt"]},"Client":{"additionalProperties":false,"type":"object","properties":{"id":{"minLength":1,"maxLength":60,"type":"string"},"groupId":{"minLength":1,"maxLength":60,"type":"string"},"name":{"type":"string"},"apiKey":{"type":"string"},"statsApiKey":{"type":"string"},"config":{"additionalProperties":false,"type":"object","properties":{"language":{"type":"string","enum":["english","swedish","finnish","norwegian","danish","german","dutch","french","spanish","italian","portuguese"]},"playerConfig":{"additionalProperties":false,"type":"object","properties":{"playerVersion":{"type":"string","example":"1.1.17"},"lazyThreshold":{"type":"integer"}}},"playerConfigTest":{"additionalProperties":false,"type":"object","properties":{"playerVersion":{"type":"string","example":"1.1.17"},"lazyThreshold":{"type":"integer"}}},"playerConfigTestRatio":{"minimum":0,"maximum":1,"type":"number"},"storyTitleMaxLength":{"minimum":1,"maximum":500,"type":"integer"},"transcodeOptions":{"type":"object","properties":{"fileSizeLimit":{"minimum":500,"maximum":200000,"type":"integer"}}},"slack":{"additionalProperties":false,"type":"object","properties":{"channel":{"type":"string"}},"required":["channel"]},"website":{"type":"string"},"crmClientId":{"description":"CRM client connection ID","type":"string"},"crmUserId":{"description":"CRM user ID from client data","type":"string"},"webhook":{"additionalProperties":false,"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]},"featureFlags":{"additionalProperties":false,"type":"object","properties":{"brandedContent":{"type":"boolean"},"storylines":{"type":"boolean"},"testTraffic":{"type":"boolean"}}}},"required":["language"]},"status":{"type":"string","enum":["demo","onboarding","remove","live"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","apiKey","config","createdAt","updatedAt"]},"CreateUserRequest":{"additionalProperties":false,"type":"object","properties":{"email":{"format":"email","type":"string"},"firstName":{"minLength":1,"maxLength":200,"type":"string"},"lastName":{"minLength":1,"maxLength":200,"type":"string"},"roles":{"type":"array","items":{"enum":["read","write","admin"],"type":"string"}}},"required":["email","firstName","lastName","roles"]},"User":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"clientId":{"type":"string"},"roles":{"type":"array","items":{"enum":["read","write","admin"],"type":"string"}},"enabled":{"type":"boolean"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","email","firstName","lastName","clientId","roles","enabled","emailVerified","createdAt"]},"UpdateUserRequest":{"additionalProperties":false,"type":"object","properties":{"email":{"format":"email","type":"string"},"firstName":{"minLength":1,"maxLength":200,"type":"string"},"lastName":{"minLength":1,"maxLength":200,"type":"string"},"enabled":{"type":"boolean"},"roles":{"minItems":1,"type":"array","items":{"enum":["read","write","admin"],"type":"string"}}},"required":["firstName","lastName","roles"]},"Storyline":{"additionalProperties":false,"type":"object","properties":{"id":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"clientId":{"type":"string"},"campaignId":{"type":"string"},"slug":{"type":"string"},"title":{"minLength":1,"maxLength":130,"type":"string"},"status":{"type":"string","enum":["live","deleted"]},"publishedManifest":{},"publishedManifestMd5":{"type":"string"},"publishedManifestPath":{"type":"string"},"publishedAt":{"type":"string","format":"date-time"},"config":{"$ref":"#/components/schemas/StorylineConfig"},"scriptMd5":{"type":"string"},"scriptUrl":{"type":"string"},"manifestUrl":{"type":"string"},"stories":{"type":"array","items":{"$ref":"#/components/schemas/StoryWithMapping"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","clientId","slug","title","status","createdAt","updatedAt"]},"StorylineAppSettings":{"additionalProperties":false,"type":"object","properties":{"chrome":{"additionalProperties":false,"type":"object","properties":{"controlAvatar":{"type":"boolean"},"controlCardDuration":{"type":"boolean"},"controlClose":{"type":"string","enum":["top left","top right","none"]},"controlCloseIcon":{"type":"string","enum":["close","chevron"]},"controlHeadline":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["all","carousel","fullscreen","none"]}]},"controlAdLabel":{"type":"string"},"controlHasAdLabel":{"type":"boolean"},"controlHasAvatar":{"type":"boolean"},"controlHasCarouselCTA":{"type":"boolean"},"controlMute":{"type":"string","enum":["top","bottom","none"]},"controlPlay":{"type":"string","enum":["top","right","bottom","none"]},"overlayPlay":{"type":"boolean"},"controlProgressbar":{"type":"boolean"},"controlTime":{"type":"boolean"},"gradient":{"type":"boolean"},"onboardFullscreen":{"type":"string","enum":["top","bottom","none"]},"onboardSwipe":{"type":"string","enum":["top","bottom","none"]},"sponsorLabel":{"type":"string"},"avatarLabel":{"type":"string"},"avatarUrl":{"type":"string"},"carouselCtaLabel":{"type":"string"}}},"styles":{"additionalProperties":false,"type":"object","properties":{"button-fill":{"type":"boolean"},"button-radius":{"type":"string"},"card-radius":{"type":"string"},"color-accent":{"type":"string"},"color-ad-label-background":{"type":"string"},"color-ad-label-foreground":{"type":"string"},"color-avatar-background":{"type":"string"},"color-avatar-foreground":{"type":"string"},"color-cta-background":{"type":"string"},"color-cta-foreground":{"type":"string"},"color-primary":{"type":"string"},"color-progressbar":{"type":"string"},"gutters":{"type":"string"},"icon-library":{"type":"string"},"margins":{"type":"string"},"typeface-button":{"type":"string"},"typeface-card-duration":{"type":"string"},"typeface-card-headline":{"type":"string"},"typeface":{"type":"string"},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string"},"weight":{"type":"string"},"style":{"type":"string"},"format":{"type":"string"},"url":{"type":"string"}},"required":["family","weight","style","format","url"]}}}}}},"StorylineConfig":{"additionalProperties":false,"type":"object","properties":{"autoPublish":{"type":"boolean"},"manifestVersion":{"enum":["v1","v2"],"type":"string"},"storyLimit":{"minimum":1,"maximum":100,"description":"How many stories to include in Storyline","default":20,"type":"integer"},"publishVideoPreviews":{"type":"boolean"},"brandedContent":{"type":"boolean"},"appSettings":{"$ref":"#/components/schemas/StorylineAppSettings"},"brandName":{"type":"string"},"campaignName":{"type":"string"},"campaignStartDate":{"type":"string"},"campaignEndDate":{"type":"string"},"placementId":{"type":"string"},"crmOrderId":{"description":"CRM order ID for this storyline","type":"string"},"isTestTraffic":{"type":"boolean"},"tagGenerator":{"additionalProperties":false,"type":"object","properties":{"scriptType":{"type":"string"},"language":{"type":"string"},"trackingCode":{"type":"string"}}}}},"Story":{"additionalProperties":false,"type":"object","properties":{"id":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"clientId":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"videoUrl":{"type":"string"},"videoMeta":{"additionalProperties":false,"type":"object","properties":{"videoId":{"type":"string"},"jobId":{"type":"string"},"status":{"type":"string"},"previewStatus":{"type":"string"},"thumbnails":{"additionalProperties":false,"type":"object","properties":{"firstFrame":{"type":"string"}}},"probe":{"additionalProperties":false,"type":"object","properties":{"sizeBytes":{"type":"integer"},"durationSeconds":{"type":"number"},"bitrate":{"type":"number"}}},"quality":{"type":"object","properties":{"count":{"type":"number"},"min":{"type":"number"},"p01":{"type":"number"},"p05":{"type":"number"},"p10":{"type":"number"},"p50":{"type":"number"},"avg":{"type":"number"},"p90":{"type":"number"},"max":{"type":"number"}},"required":["count","min","p01","p05","p10","p50","avg","p90","max"]},"bitrate":{"type":"number"},"transcoderInvokedAt":{"type":"string","format":"date-time"},"errors":{"type":"array","items":{}}}},"oldVideoMeta":{"additionalProperties":false,"type":"object","properties":{"videoId":{"type":"string"},"jobId":{"type":"string"},"status":{"type":"string"},"previewStatus":{"type":"string"},"thumbnails":{"additionalProperties":false,"type":"object","properties":{"firstFrame":{"type":"string"}}},"probe":{"additionalProperties":false,"type":"object","properties":{"sizeBytes":{"type":"integer"},"durationSeconds":{"type":"number"},"bitrate":{"type":"number"}}},"quality":{"type":"object","properties":{"count":{"type":"number"},"min":{"type":"number"},"p01":{"type":"number"},"p05":{"type":"number"},"p10":{"type":"number"},"p50":{"type":"number"},"avg":{"type":"number"},"p90":{"type":"number"},"max":{"type":"number"}},"required":["count","min","p01","p05","p10","p50","avg","p90","max"]},"bitrate":{"type":"number"},"transcoderInvokedAt":{"type":"string","format":"date-time"},"errors":{"type":"array","items":{}}}},"videoFinishedAt":{"type":"string","format":"date-time"},"customMetadata":{"additionalProperties":true,"description":"A JSON object with arbitrary custom metadata such as external IDs etc.","type":"object","properties":{}},"scheduledPublishAt":{"type":"string","format":"date-time"},"scheduledPublishProcessedAt":{"type":"string","format":"date-time"},"config":{"$ref":"#/components/schemas/StoryConfig"},"apiReferrer":{"type":"string"},"storylines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","clientId","slug","title","createdAt","updatedAt"]},"StoryConfig":{"additionalProperties":false,"type":"object","properties":{"ctaLabel":{"type":"string"},"ctaUrl":{"type":"string"},"hasAvatar":{"type":"boolean"},"avatarUrl":{"type":"string"},"avatarLabel":{"type":"string"},"carouselCtaLabel":{"type":"string"},"hasCarouselCTA":{"type":"boolean"}}},"StoryMapping":{"additionalProperties":false,"type":"object","properties":{"id":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"clientId":{"type":"string"},"storylineId":{"type":"string"},"storyId":{"type":"string"},"pinnedPosition":{"minimum":1,"type":"integer"},"sortOrder":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","clientId","storylineId","storyId","sortOrder","createdAt","updatedAt"]},"StoryWithMapping":{"additionalProperties":false,"type":"object","allOf":[{"additionalProperties":false,"type":"object","properties":{"id":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"clientId":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"videoUrl":{"type":"string"},"videoMeta":{"additionalProperties":false,"type":"object","properties":{"videoId":{"type":"string"},"jobId":{"type":"string"},"status":{"type":"string"},"previewStatus":{"type":"string"},"thumbnails":{"additionalProperties":false,"type":"object","properties":{"firstFrame":{"type":"string"}}},"probe":{"additionalProperties":false,"type":"object","properties":{"sizeBytes":{"type":"integer"},"durationSeconds":{"type":"number"},"bitrate":{"type":"number"}}},"quality":{"type":"object","properties":{"count":{"type":"number"},"min":{"type":"number"},"p01":{"type":"number"},"p05":{"type":"number"},"p10":{"type":"number"},"p50":{"type":"number"},"avg":{"type":"number"},"p90":{"type":"number"},"max":{"type":"number"}},"required":["count","min","p01","p05","p10","p50","avg","p90","max"]},"bitrate":{"type":"number"},"transcoderInvokedAt":{"type":"string","format":"date-time"},"errors":{"type":"array","items":{}}}},"oldVideoMeta":{"additionalProperties":false,"type":"object","properties":{"videoId":{"type":"string"},"jobId":{"type":"string"},"status":{"type":"string"},"previewStatus":{"type":"string"},"thumbnails":{"additionalProperties":false,"type":"object","properties":{"firstFrame":{"type":"string"}}},"probe":{"additionalProperties":false,"type":"object","properties":{"sizeBytes":{"type":"integer"},"durationSeconds":{"type":"number"},"bitrate":{"type":"number"}}},"quality":{"type":"object","properties":{"count":{"type":"number"},"min":{"type":"number"},"p01":{"type":"number"},"p05":{"type":"number"},"p10":{"type":"number"},"p50":{"type":"number"},"avg":{"type":"number"},"p90":{"type":"number"},"max":{"type":"number"}},"required":["count","min","p01","p05","p10","p50","avg","p90","max"]},"bitrate":{"type":"number"},"transcoderInvokedAt":{"type":"string","format":"date-time"},"errors":{"type":"array","items":{}}}},"videoFinishedAt":{"type":"string","format":"date-time"},"customMetadata":{"additionalProperties":true,"description":"A JSON object with arbitrary custom metadata such as external IDs etc.","type":"object","properties":{}},"scheduledPublishAt":{"type":"string","format":"date-time"},"scheduledPublishProcessedAt":{"type":"string","format":"date-time"},"config":{"$ref":"#/components/schemas/StoryConfig"},"apiReferrer":{"type":"string"},"storylines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","clientId","slug","title","createdAt","updatedAt"]},{"type":"object","properties":{"pinnedPosition":{"type":"integer"},"sortOrder":{"type":"integer"}}}]},"Manifest":{"additionalProperties":false,"type":"object","properties":{"id":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"manifestVersion":{"enum":["v2"],"type":"string"},"clientId":{"type":"string"},"isTestTraffic":{"type":"boolean"},"stories":{"type":"array","items":{"type":"object","properties":{"id":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"title":{"type":"string"},"slug":{"type":"string"},"videoId":{"type":"string"},"thumbnails":{"additionalProperties":false,"type":"object","properties":{"firstFrame":{"type":"string"}}},"duration":{"minimum":0,"type":"number"},"ctaLabel":{"type":"string"},"ctaUrl":{"type":"string"},"avatarEnabled":{"type":"boolean"},"avatarUrl":{"type":"string"},"avatarLabel":{"type":"string"},"carouselCtaEnabled":{"type":"boolean"},"carouselCtaLabel":{"type":"string"}},"required":["id","title","slug","videoId","thumbnails"]}},"settings":{"$ref":"#/components/schemas/StorylineAppSettings"},"isBrandStory":{"type":"boolean"}},"required":["id","manifestVersion","clientId","stories"]},"StorylineStats":{"additionalProperties":false,"type":"object","properties":{"eventTimeSlot":{"type":"string","format":"date-time"},"storylineSlug":{"type":"string"},"env":{"description":"Environment ID - 1=web, 2=app","type":"integer"},"domain":{"type":"string"},"events":{"type":"integer"},"sessions":{"type":"integer"},"errorsSessions":{"type":"integer"},"pageLoads":{"type":"integer"},"pageLoadsSessions":{"type":"integer"},"inScreenViews":{"type":"integer"},"inScreenViewsInitial":{"type":"integer"},"inScreenViewsSessions":{"type":"integer"},"swipesSessions":{"type":"integer"},"thumbnailVideoStarts":{"type":"integer"},"thumbnailVideoComplete":{"type":"integer"},"thumbnailVideoCompleteSessions":{"type":"integer"},"thumbnailVideoCompleteUnique":{"type":"integer"},"opens":{"type":"integer"},"opensSessions":{"type":"integer"},"fullscreenVideoStarts":{"type":"integer"},"completionCount100":{"type":"integer"},"fullscreenCta":{"type":"integer"},"thumbnailCompletionCount6sec":{"type":"integer"},"fullscreenCompletionCount6sec":{"type":"integer"},"audioOn":{"type":"integer"},"audioOff":{"type":"integer"},"adImpressions":{"type":"integer"},"nRows":{"type":"integer"},"swipeRate":{"type":"number"},"openRate":{"type":"number"},"fullscreenCtr":{"type":"number"},"completionCount6sec":{"type":"number"},"thumbnailVtr":{"type":"number"},"fullscreenVtr":{"type":"number"},"muteUnmute":{"type":"number"}},"required":["eventTimeSlot","events","sessions","errorsSessions","pageLoads","pageLoadsSessions","inScreenViews","inScreenViewsInitial","inScreenViewsSessions","swipesSessions","thumbnailVideoStarts","thumbnailVideoComplete","thumbnailVideoCompleteSessions","thumbnailVideoCompleteUnique","opens","opensSessions","fullscreenVideoStarts","completionCount100","fullscreenCta","thumbnailCompletionCount6sec","fullscreenCompletionCount6sec","audioOn","audioOff","adImpressions","nRows"]},"StorylineMetrics":{"additionalProperties":false,"type":"object","properties":{"events":{"type":"integer"},"sessions":{"type":"integer"},"errorsSessions":{"type":"integer"},"pageLoads":{"type":"integer"},"pageLoadsSessions":{"type":"integer"},"inScreenViews":{"type":"integer"},"inScreenViewsInitial":{"type":"integer"},"inScreenViewsSessions":{"type":"integer"},"swipesSessions":{"type":"integer"},"thumbnailVideoStarts":{"type":"integer"},"thumbnailVideoComplete":{"type":"integer"},"thumbnailVideoCompleteSessions":{"type":"integer"},"thumbnailVideoCompleteUnique":{"type":"integer"},"opens":{"type":"integer"},"opensSessions":{"type":"integer"},"fullscreenVideoStarts":{"type":"integer"},"completionCount100":{"type":"integer"},"fullscreenCta":{"type":"integer"},"thumbnailCompletionCount6sec":{"type":"integer"},"fullscreenCompletionCount6sec":{"type":"integer"},"audioOn":{"type":"integer"},"audioOff":{"type":"integer"},"adImpressions":{"type":"integer"},"nRows":{"type":"integer"},"swipeRate":{"type":"number"},"openRate":{"type":"number"},"fullscreenCtr":{"type":"number"},"completionCount6sec":{"type":"number"},"thumbnailVtr":{"type":"number"},"fullscreenVtr":{"type":"number"},"muteUnmute":{"type":"number"}},"required":["events","sessions","errorsSessions","pageLoads","pageLoadsSessions","inScreenViews","inScreenViewsInitial","inScreenViewsSessions","swipesSessions","thumbnailVideoStarts","thumbnailVideoComplete","thumbnailVideoCompleteSessions","thumbnailVideoCompleteUnique","opens","opensSessions","fullscreenVideoStarts","completionCount100","fullscreenCta","thumbnailCompletionCount6sec","fullscreenCompletionCount6sec","audioOn","audioOff","adImpressions","nRows"]},"StoryStats":{"additionalProperties":false,"type":"object","properties":{"eventTimeSlot":{"type":"string","format":"date-time"},"videoId":{"type":"string"},"storyId":{"type":"string"},"title":{"type":"string"},"videoMeta":{"additionalProperties":false,"type":"object","properties":{"videoId":{"type":"string"},"jobId":{"type":"string"},"status":{"type":"string"},"previewStatus":{"type":"string"},"thumbnails":{"additionalProperties":false,"type":"object","properties":{"firstFrame":{"type":"string"}}},"probe":{"additionalProperties":false,"type":"object","properties":{"sizeBytes":{"type":"integer"},"durationSeconds":{"type":"number"},"bitrate":{"type":"number"}}},"quality":{"type":"object","properties":{"count":{"type":"number"},"min":{"type":"number"},"p01":{"type":"number"},"p05":{"type":"number"},"p10":{"type":"number"},"p50":{"type":"number"},"avg":{"type":"number"},"p90":{"type":"number"},"max":{"type":"number"}},"required":["count","min","p01","p05","p10","p50","avg","p90","max"]},"bitrate":{"type":"number"},"transcoderInvokedAt":{"type":"string","format":"date-time"},"errors":{"type":"array","items":{}}}},"createdAt":{"type":"string","format":"date-time"},"storylineSlug":{"type":"string"},"env":{"description":"Environment ID - 1=web, 2=app","type":"integer"},"fullscreenVideoStarts":{"type":"integer"},"fullscreenVideoEnds":{"type":"integer"},"fullscreenCta":{"type":"integer"},"thumbnailVideoStarts":{"type":"integer"},"thumbnailVideoStartsSessions":{"type":"integer"},"thumbnailVideoComplete":{"type":"integer"},"thumbnailVideoCompleteSessions":{"type":"integer"},"totalDuration":{"type":"number"},"durationSum":{"type":"integer"},"zeroDurationCount":{"type":"integer"},"completionCount25":{"type":"integer"},"completionCount50":{"type":"integer"},"completionCount75":{"type":"integer"},"completionCount100":{"type":"integer"},"completionCountEnded":{"type":"integer"},"thumbnailCompletionCount6sec":{"type":"integer"},"fullscreenCompletionCount6sec":{"type":"integer"},"nRows":{"type":"integer"},"fullscreenCtr":{"type":"number"},"thumbnailVtr":{"type":"number"},"avgDuration":{"type":"number"}},"required":["videoId","fullscreenVideoStarts","fullscreenVideoEnds","fullscreenCta","thumbnailVideoStarts","thumbnailVideoStartsSessions","thumbnailVideoComplete","thumbnailVideoCompleteSessions","durationSum","zeroDurationCount","completionCount25","completionCount50","completionCount75","completionCount100","completionCountEnded","thumbnailCompletionCount6sec","fullscreenCompletionCount6sec","nRows"]},"Campaign":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"crmOrderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","slug","advertiserId","startDate","createdAt","updatedAt"]},"Advertiser":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","createdAt","updatedAt"]},"StoryMetrics":{"additionalProperties":false,"type":"object","properties":{"fullscreenVideoStarts":{"type":"integer"},"fullscreenVideoEnds":{"type":"integer"},"fullscreenCta":{"type":"integer"},"thumbnailVideoStarts":{"type":"integer"},"thumbnailVideoStartsSessions":{"type":"integer"},"thumbnailVideoComplete":{"type":"integer"},"thumbnailVideoCompleteSessions":{"type":"integer"},"totalDuration":{"type":"number"},"durationSum":{"type":"integer"},"zeroDurationCount":{"type":"integer"},"completionCount25":{"type":"integer"},"completionCount50":{"type":"integer"},"completionCount75":{"type":"integer"},"completionCount100":{"type":"integer"},"completionCountEnded":{"type":"integer"},"thumbnailCompletionCount6sec":{"type":"integer"},"fullscreenCompletionCount6sec":{"type":"integer"},"nRows":{"type":"integer"},"fullscreenCtr":{"type":"number"},"thumbnailVtr":{"type":"number"},"avgDuration":{"type":"number"}},"required":["fullscreenVideoStarts","fullscreenVideoEnds","fullscreenCta","thumbnailVideoStarts","thumbnailVideoStartsSessions","thumbnailVideoComplete","thumbnailVideoCompleteSessions","durationSum","zeroDurationCount","completionCount25","completionCount50","completionCount75","completionCount100","completionCountEnded","thumbnailCompletionCount6sec","fullscreenCompletionCount6sec","nRows"]},"ClientGroupCreate":{"type":"object","properties":{"id":{"minLength":1,"maxLength":60,"type":"string"},"name":{"type":"string"}},"required":["name"]},"CreateClient":{"type":"object","properties":{"id":{"minLength":1,"maxLength":60,"type":"string"},"groupId":{"minLength":1,"maxLength":60,"type":"string"},"name":{"type":"string"},"config":{"additionalProperties":false,"type":"object","properties":{"language":{"type":"string","enum":["english","swedish","finnish","norwegian","danish","german","dutch","french","spanish","italian","portuguese"]},"playerConfig":{"additionalProperties":false,"type":"object","properties":{"playerVersion":{"type":"string","example":"1.1.17"},"lazyThreshold":{"type":"integer"}}},"playerConfigTest":{"additionalProperties":false,"type":"object","properties":{"playerVersion":{"type":"string","example":"1.1.17"},"lazyThreshold":{"type":"integer"}}},"playerConfigTestRatio":{"minimum":0,"maximum":1,"type":"number"},"storyTitleMaxLength":{"minimum":1,"maximum":500,"type":"integer"},"transcodeOptions":{"type":"object","properties":{"fileSizeLimit":{"minimum":500,"maximum":200000,"type":"integer"}}},"slack":{"additionalProperties":false,"type":"object","properties":{"channel":{"type":"string"}},"required":["channel"]},"website":{"type":"string"},"crmClientId":{"description":"CRM client connection ID","type":"string"},"crmUserId":{"description":"CRM user ID from client data","type":"string"},"webhook":{"additionalProperties":false,"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]},"featureFlags":{"additionalProperties":false,"type":"object","properties":{"brandedContent":{"type":"boolean"},"storylines":{"type":"boolean"},"testTraffic":{"type":"boolean"}}}},"required":["language"]},"status":{"type":"string","enum":["demo","onboarding","remove","live"]},"apiKey":{"type":"string"}},"required":["name","config"]},"ClientCreateBody":{"additionalProperties":false,"type":"object","properties":{"client":{"type":"object","properties":{"id":{"minLength":1,"maxLength":60,"type":"string"},"groupId":{"minLength":1,"maxLength":60,"type":"string"},"name":{"type":"string"},"config":{"additionalProperties":false,"type":"object","properties":{"language":{"type":"string","enum":["english","swedish","finnish","norwegian","danish","german","dutch","french","spanish","italian","portuguese"]},"playerConfig":{"additionalProperties":false,"type":"object","properties":{"playerVersion":{"type":"string","example":"1.1.17"},"lazyThreshold":{"type":"integer"}}},"playerConfigTest":{"additionalProperties":false,"type":"object","properties":{"playerVersion":{"type":"string","example":"1.1.17"},"lazyThreshold":{"type":"integer"}}},"playerConfigTestRatio":{"minimum":0,"maximum":1,"type":"number"},"storyTitleMaxLength":{"minimum":1,"maximum":500,"type":"integer"},"transcodeOptions":{"type":"object","properties":{"fileSizeLimit":{"minimum":500,"maximum":200000,"type":"integer"}}},"slack":{"additionalProperties":false,"type":"object","properties":{"channel":{"type":"string"}},"required":["channel"]},"website":{"type":"string"},"crmClientId":{"description":"CRM client connection ID","type":"string"},"crmUserId":{"description":"CRM user ID from client data","type":"string"},"webhook":{"additionalProperties":false,"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]},"featureFlags":{"additionalProperties":false,"type":"object","properties":{"brandedContent":{"type":"boolean"},"storylines":{"type":"boolean"},"testTraffic":{"type":"boolean"}}}},"required":["language"]},"status":{"type":"string","enum":["demo","onboarding","remove","live"]},"apiKey":{"type":"string"}},"required":["name","config"]},"adminUser":{"additionalProperties":false,"type":"object","properties":{"email":{"format":"email","type":"string"},"firstName":{"minLength":1,"maxLength":200,"type":"string"},"lastName":{"minLength":1,"maxLength":200,"type":"string"},"roles":{"type":"array","items":{"enum":["read","write","admin"],"type":"string"}}},"required":["email","firstName","lastName","roles"]}},"required":["client"]},"UpdateClient":{"type":"object","properties":{"name":{"type":"string"},"config":{"additionalProperties":false,"type":"object","properties":{"language":{"type":"string","enum":["english","swedish","finnish","norwegian","danish","german","dutch","french","spanish","italian","portuguese"]},"playerConfig":{"additionalProperties":false,"type":"object","properties":{"playerVersion":{"type":"string","example":"1.1.17"},"lazyThreshold":{"type":"integer"}}},"playerConfigTest":{"additionalProperties":false,"type":"object","properties":{"playerVersion":{"type":"string","example":"1.1.17"},"lazyThreshold":{"type":"integer"}}},"playerConfigTestRatio":{"minimum":0,"maximum":1,"type":"number"},"storyTitleMaxLength":{"minimum":1,"maximum":500,"type":"integer"},"transcodeOptions":{"type":"object","properties":{"fileSizeLimit":{"minimum":500,"maximum":200000,"type":"integer"}}},"slack":{"additionalProperties":false,"type":"object","properties":{"channel":{"type":"string"}},"required":["channel"]},"website":{"type":"string"},"crmClientId":{"description":"CRM client connection ID","type":"string"},"crmUserId":{"description":"CRM user ID from client data","type":"string"},"webhook":{"additionalProperties":false,"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]},"featureFlags":{"additionalProperties":false,"type":"object","properties":{"brandedContent":{"type":"boolean"},"storylines":{"type":"boolean"},"testTraffic":{"type":"boolean"}}}},"required":["language"]},"apiKey":{"type":"string"},"status":{"type":"string"}}},"ClientUpdateBody":{"additionalProperties":false,"type":"object","properties":{"client":{"type":"object","properties":{"name":{"type":"string"},"config":{"additionalProperties":false,"type":"object","properties":{"language":{"type":"string","enum":["english","swedish","finnish","norwegian","danish","german","dutch","french","spanish","italian","portuguese"]},"playerConfig":{"additionalProperties":false,"type":"object","properties":{"playerVersion":{"type":"string","example":"1.1.17"},"lazyThreshold":{"type":"integer"}}},"playerConfigTest":{"additionalProperties":false,"type":"object","properties":{"playerVersion":{"type":"string","example":"1.1.17"},"lazyThreshold":{"type":"integer"}}},"playerConfigTestRatio":{"minimum":0,"maximum":1,"type":"number"},"storyTitleMaxLength":{"minimum":1,"maximum":500,"type":"integer"},"transcodeOptions":{"type":"object","properties":{"fileSizeLimit":{"minimum":500,"maximum":200000,"type":"integer"}}},"slack":{"additionalProperties":false,"type":"object","properties":{"channel":{"type":"string"}},"required":["channel"]},"website":{"type":"string"},"crmClientId":{"description":"CRM client connection ID","type":"string"},"crmUserId":{"description":"CRM user ID from client data","type":"string"},"webhook":{"additionalProperties":false,"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]},"featureFlags":{"additionalProperties":false,"type":"object","properties":{"brandedContent":{"type":"boolean"},"storylines":{"type":"boolean"},"testTraffic":{"type":"boolean"}}}},"required":["language"]},"apiKey":{"type":"string"},"status":{"type":"string"}}}},"required":["client"]},"CreateStoryline":{"additionalProperties":false,"type":"object","properties":{"title":{"minLength":1,"maxLength":130,"type":"string"},"status":{"type":"string","enum":["live","deleted"]},"campaignId":{"type":"string"},"config":{"$ref":"#/components/schemas/StorylineConfig"}},"required":["title"]},"UpdateStoryline":{"additionalProperties":false,"type":"object","properties":{"title":{"minLength":1,"maxLength":130,"type":"string"},"status":{"type":"string","enum":["live","deleted"]},"campaignId":{"type":"string"},"config":{"$ref":"#/components/schemas/StorylineConfig"}}},"CreateStory":{"additionalProperties":false,"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"videoUrl":{"type":"string"},"customMetadata":{"additionalProperties":true,"description":"A JSON object with arbitrary custom metadata such as external IDs etc.","type":"object","properties":{}},"scheduledPublishAt":{"type":"string","format":"date-time"},"config":{"$ref":"#/components/schemas/StoryConfig"}},"required":["title"]},"UpdateStory":{"additionalProperties":false,"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"videoUrl":{"type":"string"},"customMetadata":{"additionalProperties":true,"description":"A JSON object with arbitrary custom metadata such as external IDs etc.","type":"object","properties":{}},"scheduledPublishAt":{"type":"string","format":"date-time"},"config":{"$ref":"#/components/schemas/StoryConfig"}}},"CreateStoryMapping":{"additionalProperties":false,"type":"object","properties":{"storylineId":{"type":"string"},"storyId":{"type":"string"},"pinnedPosition":{"minimum":1,"type":"integer"},"sortOrder":{"type":"number"}},"required":["storylineId","storyId"]},"UpdateStoryMapping":{"additionalProperties":false,"type":"object","properties":{"pinnedPosition":{"anyOf":[{"type":"null"},{"minimum":1,"type":"integer"}]},"sortOrder":{"type":"number"}}},"CreateCampaign":{"type":"object","properties":{"name":{"minLength":1,"maxLength":83,"type":"string"},"description":{"type":"string"},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}},"required":["name","advertiserId"]},"UpdateCampaign":{"type":"object","properties":{"name":{"minLength":1,"maxLength":83,"type":"string"},"description":{"type":"string"},"crmOrderId":{"type":"string"},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}}},"CreateAdvertiser":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"}},"required":["name"]},"UpdateAdvertiser":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"}},"required":["name"]},"UsersListResponse":{"additionalProperties":false,"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/User"}}},"required":["users"]},"UsersGetResponse":{"additionalProperties":false,"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}},"required":["user"]},"StorylinesListResponse":{"additionalProperties":false,"type":"object","properties":{"storylines":{"type":"array","items":{"$ref":"#/components/schemas/Storyline"}}},"required":["storylines"]},"StorylineGetResponse":{"additionalProperties":false,"type":"object","properties":{"storyline":{"$ref":"#/components/schemas/Storyline"},"stories":{"type":"array","items":{"$ref":"#/components/schemas/Story"}},"storyMappings":{"type":"array","items":{"$ref":"#/components/schemas/StoryMapping"}}},"required":["storyline"]},"StorylineManifestResponse":{"additionalProperties":false,"type":"object","properties":{"manifest":{"$ref":"#/components/schemas/Manifest"},"manifestMd5":{"type":"string"},"isPublished":{"type":"boolean"}},"required":["manifest","manifestMd5","isPublished"]},"StorylineCreateBody":{"additionalProperties":false,"type":"object","properties":{"storyline":{"$ref":"#/components/schemas/CreateStoryline"}},"required":["storyline"]},"StorylineCreateResponse":{"additionalProperties":false,"type":"object","properties":{"storyline":{"$ref":"#/components/schemas/Storyline"}},"required":["storyline"]},"StorylineUpdateResponse":{"additionalProperties":false,"type":"object","properties":{"storyline":{"$ref":"#/components/schemas/Storyline"}},"required":["storyline"]},"StorylinePublishResponse":{"additionalProperties":false,"type":"object","properties":{"storyline":{"$ref":"#/components/schemas/Storyline"}},"required":["storyline"]},"StoriesListResponse":{"additionalProperties":false,"type":"object","properties":{"stories":{"type":"array","items":{"$ref":"#/components/schemas/Story"}}},"required":["stories"]},"StoryGetResponse":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/Story"},"storylines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]}}},"required":["story","storylines"]},"StoryUpdateResponse":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/Story"},"storylines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]}}},"required":["story","storylines"]},"StoryUpdateStorylinesResponse":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/Story"},"storylines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]}}},"required":["story","storylines"]},"StoryCreateBody":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/CreateStory"},"storylineIds":{"uniqueItems":true,"type":"array","items":{"type":"string"}}},"required":["story"]},"StoryCreateResponse":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/Story"}},"required":["story"]},"StoryUpdateBody":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/UpdateStory"}},"required":["story"]},"StoryUpdateStorylinesBody":{"additionalProperties":false,"type":"object","properties":{"storylineIds":{"uniqueItems":true,"type":"array","items":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"}}},"required":["storylineIds"]},"StoryInvokeTranscoderResponse":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/Story"}},"required":["story"]},"StoryMappingsListResponse":{"additionalProperties":false,"type":"object","properties":{"storyMappings":{"type":"array","items":{"$ref":"#/components/schemas/StoryMapping"}}},"required":["storyMappings"]},"StoryMappingGetResponse":{"additionalProperties":false,"type":"object","properties":{"storyMapping":{"$ref":"#/components/schemas/StoryMapping"}},"required":["storyMapping"]},"StoryMappingCreateResponse":{"additionalProperties":false,"type":"object","properties":{"storyMapping":{"$ref":"#/components/schemas/StoryMapping"}},"required":["storyMapping"]},"ClientResponse":{"additionalProperties":false,"type":"object","properties":{"client":{"$ref":"#/components/schemas/Client"}},"required":["client"]},"MyClientsResponse":{"additionalProperties":false,"type":"object","properties":{"clients":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/ClientGroup"}}},"required":["clients","groups"]},"ClientGroupResponse":{"additionalProperties":false,"type":"object","properties":{"clientGroup":{"$ref":"#/components/schemas/ClientGroup"},"clients":{"type":"array","items":{"$ref":"#/components/schemas/Client"}}},"required":["clientGroup","clients"]},"ClientCreateResponse":{"additionalProperties":false,"type":"object","properties":{"client":{"$ref":"#/components/schemas/Client"}},"required":["client"]},"ClientStatsResponse":{"additionalProperties":false,"type":"object","properties":{"client":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"storylines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"slug":{"type":"string"},"storyKey":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["live","deleted"]},"createdAt":{"type":"string"},"publishedAt":{"type":"string"},"storiesCount":{"type":"integer"},"clientConfig":{},"sessions":{"type":"integer"},"inScreenViewsSessions":{"type":"integer"},"opensSessions":{"type":"integer"},"fullscreenVideoStarts":{"type":"integer"},"adImpressions":{"type":"integer"},"nHours":{"type":"integer"},"pageLoads":{"type":"integer"},"manifestUrl":{"type":"string"},"scriptUrl":{"type":"string"}},"required":["id","clientId","slug","storyKey","title","status","createdAt","storiesCount","manifestUrl","scriptUrl"]}}},"required":["client","storylines"]},"StorylineStatsResponse":{"additionalProperties":false,"type":"object","properties":{"storylineStats":{"type":"array","items":{"$ref":"#/components/schemas/StorylineStats"}},"storylineStatsTotal":{"$ref":"#/components/schemas/StorylineMetrics"},"clientId":{"type":"string"},"storylineSlug":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"granularity":{"type":"string"},"groupBy":{"type":"array","items":{"type":"string"}},"count":{"type":"integer"}},"required":["storylineStats","clientId","startTime","endTime","granularity","groupBy","count"]},"StoryStatsResponse":{"additionalProperties":false,"type":"object","properties":{"storyStats":{"type":"array","items":{"$ref":"#/components/schemas/StoryStats"}},"storyStatsTotal":{"$ref":"#/components/schemas/StoryMetrics"},"clientId":{"type":"string"},"storylineSlug":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"granularity":{"type":"string"},"groupBy":{"type":"array","items":{"type":"string"}},"previewData":{"type":"boolean"},"count":{"type":"integer"}},"required":["storyStats","clientId","startTime","endTime","granularity","groupBy","count"]},"CampaignStatsResponse":{"additionalProperties":false,"type":"object","properties":{"campaignStats":{"type":"array","items":{"$ref":"#/components/schemas/StorylineStats"}},"campaignStatsTotal":{"$ref":"#/components/schemas/StorylineMetrics"},"clientId":{"type":"string"},"campaignSlug":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"granularity":{"type":"string"},"count":{"type":"integer"}},"required":["campaignStats","clientId","campaignSlug","startTime","endTime","granularity","count"]},"AllCampaignsStatsQuery":{"additionalProperties":false,"type":"object","properties":{"startTime":{"type":"string","format":"date-time","description":"Start time for the stats query (inclusive). Defaults to client creation date if not provided.","example":"2024-05-19T00:00:00.000Z"},"endTime":{"type":"string","format":"date-time","description":"End time for the stats query (exclusive). Defaults to now if not provided.","example":"2024-05-20T00:00:00.000Z"},"granularity":{"enum":["hour","day","week","month","year"],"default":"day","description":"Aggregation interval for the stats query","example":"day"},"includeTimeSeries":{"default":false,"description":"If true, include time-bucketed stats per campaign","type":"boolean"},"env":{"enum":["1","2"],"description":"Optionally filter by env=1 (web) or env=2 (mobile)","type":"string","example":"1"},"previewData":{"default":false,"description":"Include preview/test data","type":"boolean"}}},"CampaignStatsItem":{"additionalProperties":false,"type":"object","properties":{"campaignId":{"type":"string"},"campaignSlug":{"type":"string"},"campaignName":{"type":"string"},"campaignStatsTotal":{},"campaignStats":{"type":"array","items":{}}},"required":["campaignId","campaignSlug","campaignName","campaignStatsTotal"]},"AllCampaignsStatsResponse":{"additionalProperties":false,"type":"object","properties":{"campaigns":{"type":"array","items":{"additionalProperties":false,"type":"object","properties":{"campaignId":{"type":"string"},"campaignSlug":{"type":"string"},"campaignName":{"type":"string"},"campaignStatsTotal":{},"campaignStats":{"type":"array","items":{}}},"required":["campaignId","campaignSlug","campaignName","campaignStatsTotal"]}},"clientId":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"granularity":{"type":"string"},"count":{"type":"integer"}},"required":["campaigns","clientId","startTime","endTime","granularity","count"]},"CampaignResponse":{"additionalProperties":false,"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"crmOrderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","slug","advertiserId","startDate","createdAt","updatedAt"]},"advertiser":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","createdAt","updatedAt"]},"storylinesCount":{"type":"integer"}},"required":["campaign","advertiser"]},"CampaignsListResponse":{"additionalProperties":false,"type":"object","properties":{"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"crmOrderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","slug","advertiserId","startDate","createdAt","updatedAt"]}}},"required":["campaigns"]},"AdvertiserResponse":{"additionalProperties":false,"type":"object","properties":{"advertiser":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","createdAt","updatedAt"]}},"required":["advertiser"]},"AdvertiserDetailResponse":{"additionalProperties":false,"type":"object","properties":{"advertiser":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"campaigns":{"type":"array","items":{}}},"required":["id","clientId","name","createdAt","updatedAt","campaigns"]}},"required":["advertiser"]},"AdvertiserWithCampaigns":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"campaigns":{"type":"array","items":{}}},"required":["id","clientId","name","createdAt","updatedAt","campaigns"]},"AdvertisersListResponse":{"additionalProperties":false,"type":"object","properties":{"advertisers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","createdAt","updatedAt"]}}},"required":["advertisers"]},"AdvertiserCreateBody":{"additionalProperties":false,"type":"object","properties":{"advertiser":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"}},"required":["name"]}},"required":["advertiser"]},"AdvertiserUpdateBody":{"additionalProperties":false,"type":"object","properties":{"advertiser":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"}},"required":["name"]}},"required":["advertiser"]},"SignedUploadUrlResponse":{"additionalProperties":false,"type":"object","properties":{"uploadUrl":{"type":"string"},"method":{"type":"string"},"contentType":{"type":"string"},"publicUrl":{"type":"string"}},"required":["uploadUrl","method","contentType","publicUrl"]},"StorylineRemoveStoriesBody":{"additionalProperties":false,"type":"object","properties":{"storyIds":{"minItems":1,"uniqueItems":true,"type":"array","items":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"}}},"required":["storyIds"]},"StorylineAddStoriesBody":{"additionalProperties":false,"type":"object","properties":{"storyIds":{"minItems":1,"uniqueItems":true,"type":"array","items":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"}}},"required":["storyIds"]},"StorylinePublishQuery":{"additionalProperties":false,"type":"object","properties":{"forcePublish":{"default":false,"type":"boolean"}}},"StorylinePublishBody":{"description":"The storyline was successfully published","additionalProperties":false,"type":"object","properties":{"publishedManifest":{"$ref":"#/components/schemas/Manifest"},"publishedManifestMd5":{"type":"string"},"publishedAt":{"type":"string"}},"required":["publishedManifest","publishedManifestMd5","publishedAt"]},"StorylineAvatarUploadResponse":{"additionalProperties":false,"type":"object","properties":{"avatarUrl":{"type":"string"}},"required":["avatarUrl"]},"StorylineFontUploadResponse":{"additionalProperties":false,"type":"object","properties":{"family":{"type":"string"},"weight":{"type":"string"},"style":{"type":"string"},"format":{"type":"string"},"url":{"type":"string"}},"required":["family","weight","style","format","url"]},"StorylinePublicStatsCreateBody":{"type":"object","properties":{"password":{"type":"string"}},"required":["password"]},"StorylinePublicStatsConfig":{"additionalProperties":true,"type":"object","properties":{"dateRange":{"type":"object","properties":{"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}}}}},"StorylinePublicStatsResponse":{"additionalProperties":false,"type":"object","properties":{"publicId":{"type":"string"},"publicUrl":{"type":"string"},"password":{"type":"string"},"config":{"additionalProperties":true,"type":"object","properties":{"dateRange":{"type":"object","properties":{"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}}}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["publicId","publicUrl","createdAt","updatedAt"]},"PublicStatsQuery":{"type":"object","properties":{"password":{"type":"string"},"startTime":{"format":"date-time","type":"string"},"endTime":{"format":"date-time","type":"string"},"granularity":{"enum":["hour","day","week","month","year"],"default":"day","type":"string"}},"required":["password"]},"PublicStatsResponse":{"type":"object","properties":{"storyline":{"type":"object","properties":{"title":{"type":"string"},"slug":{"type":"string"}},"required":["title","slug"]},"campaign":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"]},"config":{"additionalProperties":true,"type":"object","properties":{"dateRange":{"type":"object","properties":{"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}}}}},"storylineStats":{"type":"array","items":{"$ref":"#/components/schemas/StorylineStats"}},"storylineStatsTotal":{"$ref":"#/components/schemas/StorylineMetrics"},"startTime":{"type":"string"},"endTime":{"type":"string"},"granularity":{"type":"string"},"count":{"type":"number"}},"required":["storyline","storylineStats","startTime","endTime","granularity","count"]},"ClientParams":{"additionalProperties":false,"type":"object","properties":{"clientId":{"type":"string"}},"required":["clientId"]},"ClientIdParams":{"additionalProperties":false,"type":"object","properties":{"clientId":{"type":"string"},"id":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"}},"required":["clientId","id"]},"StorylinesListParams":{"additionalProperties":false,"type":"object","properties":{"clientId":{"type":"string"}},"required":["clientId"]},"StorylinesListQuery":{"additionalProperties":false,"type":"object","properties":{"includeStories":{"default":false,"type":"boolean"}}},"StoriesListParams":{"additionalProperties":false,"type":"object","properties":{"clientId":{"type":"string"}},"required":["clientId"]},"StoriesListQuery":{"additionalProperties":false,"type":"object","properties":{"query":{"type":"string"},"includeStorylines":{"default":false,"type":"boolean"}}},"StoryMappingsListParams":{"additionalProperties":false,"type":"object","properties":{"clientId":{"type":"string"}},"required":["clientId"]},"StoryMappingsListQuery":{"additionalProperties":false,"type":"object","properties":{"storylineId":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"limit":{"minimum":1,"maximum":500,"type":"integer"}}},"StoryMappingParams":{"additionalProperties":false,"type":"object","properties":{"clientId":{"type":"string"},"id":{"type":"string"}},"required":["clientId","id"]},"StoryMappingCreateBody":{"additionalProperties":false,"type":"object","properties":{"storyMapping":{"additionalProperties":false,"type":"object","properties":{"storylineId":{"type":"string"},"storyId":{"type":"string"},"pinnedPosition":{"minimum":1,"type":"integer"},"sortOrder":{"type":"number"}},"required":["storylineId","storyId"]}},"required":["storyMapping"]},"StoryMappingUpdateBody":{"additionalProperties":false,"type":"object","properties":{"storyMapping":{"additionalProperties":false,"type":"object","properties":{"pinnedPosition":{"anyOf":[{"type":"null"},{"minimum":1,"type":"integer"}]},"sortOrder":{"type":"number"}}},"newPosition":{"minimum":1,"maximum":50,"type":"number"}}},"CampaignCreateBody":{"additionalProperties":false,"type":"object","properties":{"campaign":{"type":"object","properties":{"name":{"minLength":1,"maxLength":83,"type":"string"},"description":{"type":"string"},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}},"required":["name","advertiserId"]}},"required":["campaign"]},"CampaignUpdateBody":{"additionalProperties":false,"type":"object","properties":{"campaign":{"type":"object","properties":{"name":{"minLength":1,"maxLength":83,"type":"string"},"description":{"type":"string"},"crmOrderId":{"type":"string"},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}}}},"required":["campaign"]},"CampaignParams":{"type":"object","properties":{"clientId":{"type":"string"},"id":{"type":"string"}},"required":["clientId","id"]},"AdvertiserParams":{"type":"object","properties":{"clientId":{"type":"string"},"id":{"type":"string"}},"required":["clientId","id"]},"StatsApiParams":{"additionalProperties":false,"type":"object","properties":{"clientId":{"type":"string"}},"required":["clientId"]},"ClientStatsQuery":{"additionalProperties":false,"type":"object","properties":{"startTime":{"format":"date-time","type":"string"},"endTime":{"format":"date-time","type":"string"},"previewData":{"type":"boolean"}}},"SignedUploadUrlQuery":{"additionalProperties":false,"type":"object","properties":{"contentType":{"type":"string"},"filename":{"type":"string"}}},"StorylineGetQuery":{"additionalProperties":false,"type":"object","properties":{"includeStories":{"default":true,"type":"boolean"},"includeStoryMappings":{"default":false,"type":"boolean"},"storyLimit":{"type":"number"}}},"StatsQuery":{"additionalProperties":false,"type":"object","properties":{"from":{"format":"date","type":"string"},"to":{"format":"date","type":"string"},"response":{"enum":["csv","json"],"default":"json","description":"Response format, i.e. csv or json","type":"string"}},"required":["from","to"]},"StorylineStatsQuery":{"additionalProperties":false,"type":"object","properties":{"storylineSlug":{"description":"Optionally specify slug of storyline to filter by (i.e. to only return stats for single storyline)","type":"string"},"env":{"enum":["1","2"],"description":"Optionally filter by env=1 (web) or env=2 (mobile). By default data for both envs is returned","type":"string","example":"1"},"deviceType":{"enum":["mobile","desktop","unknown"],"description":"Optionally filter by device type. By default data for all device types is returned","type":"string","example":"mobile"},"startTime":{"type":"string","format":"date-time","description":"Start time for the stats query (inclusive with hour granularity)","example":"2024-05-19T00:00:00.000Z"},"endTime":{"type":"string","format":"date-time","description":"End time for the stats query (exclusive with hour granularity)","example":"2024-05-20T00:00:00.000Z"},"granularity":{"enum":["hour","day","week","month","year"],"default":"day","description":"Aggregation interval for the stats query (i.e. hour, day, week, month, year)","example":"day"},"groupBy":{"default":["storylineSlug","env"],"description":"Fields to group query result by (i.e. storylineSlug, env, domain, deviceType)","uniqueItems":true,"type":"array","items":{"enum":["storylineSlug","env","domain","deviceType"]}},"format":{"enum":["json","csv"],"default":"json","description":"Response format, i.e. csv or json","example":"csv"},"previewData":{"default":false,"type":"boolean"}},"required":["startTime","endTime"]},"StoryStatsQuery":{"additionalProperties":false,"type":"object","properties":{"storylineSlug":{"description":"Optionally specify slug of storyline to filter by (i.e. to only return stats for single storyline)","type":"string"},"videoId":{"description":"Optionally specify ID of video to filter by (i.e. to only return stats for single story/video)","type":"string"},"env":{"enum":["1","2"],"description":"Optionally filter by env=1 (web) or env=2 (mobile). By default data for both envs is returned","type":"string","example":"1"},"deviceType":{"enum":["mobile","desktop","unknown"],"description":"Optionally filter by device type. By default data for all device types is returned","type":"string","example":"mobile"},"startTime":{"type":"string","format":"date-time","description":"Start time for the stats query (inclusive with hour granularity)","example":"2024-05-19T00:00:00.000Z"},"endTime":{"type":"string","format":"date-time","description":"End time for the stats query (exclusive with hour granularity)","example":"2024-05-20T00:00:00.000Z"},"granularity":{"enum":["hour","day","week","month","year"],"default":"year","description":"Aggregation interval for the stats query (i.e. hour, day, week, month, year)","example":"month"},"groupBy":{"default":["storylineSlug","env"],"description":"Fields to group query result by (i.e. storylineSlug, env, deviceType)","uniqueItems":true,"type":"array","items":{"enum":["storylineSlug","env","deviceType"]}},"limit":{"default":100,"minimum":10,"maximum":500,"type":"integer"},"format":{"enum":["json","csv"],"default":"json","description":"Response format, i.e. csv or json","example":"csv"},"previewData":{"default":false,"type":"boolean"}},"required":["startTime","endTime"]},"CampaignStatsQuery":{"additionalProperties":false,"type":"object","properties":{"campaignSlug":{"description":"Slug of campaign to get aggregated stats for","type":"string"},"env":{"enum":["1","2"],"description":"Optionally filter by env=1 (web) or env=2 (mobile). By default data for both envs is returned","type":"string","example":"1"},"deviceType":{"enum":["mobile","desktop","unknown"],"description":"Optionally filter by device type. By default data for all device types is returned","type":"string","example":"mobile"},"startTime":{"type":"string","format":"date-time","description":"Start time for the stats query (inclusive with hour granularity)","example":"2024-05-19T00:00:00.000Z"},"endTime":{"type":"string","format":"date-time","description":"End time for the stats query (exclusive with hour granularity)","example":"2024-05-20T00:00:00.000Z"},"granularity":{"enum":["hour","day","week","month","year"],"default":"day","description":"Aggregation interval for the stats query (i.e. hour, day, week, month, year)","example":"day"},"groupBy":{"description":"Fields to group query result by (e.g. storylineSlug to get per-storyline breakdown)","uniqueItems":true,"type":"array","items":{"enum":["storylineSlug","domain","deviceType"]}},"format":{"enum":["json","csv"],"default":"json","description":"Response format, i.e. csv or json","example":"csv"},"previewData":{"default":false,"type":"boolean"}},"required":["campaignSlug","startTime","endTime"]},"StorylineManifestParams":{"additionalProperties":false,"type":"object","properties":{"clientId":{"type":"string"},"slug":{"type":"string"}},"required":["clientId","slug"]},"StorylineScriptParams":{"additionalProperties":false,"type":"object","properties":{"clientId":{"type":"string"},"slug":{"type":"string"}},"required":["clientId","slug"]},"StoryManifestParams":{"additionalProperties":false,"type":"object","properties":{"clientId":{"type":"string"},"slug":{"type":"string"}},"required":["clientId","slug"]},"StorylineUpdateBody":{"additionalProperties":false,"type":"object","properties":{"storyline":{"additionalProperties":false,"type":"object","properties":{"title":{"minLength":1,"maxLength":130,"type":"string"},"status":{"type":"string","enum":["live","deleted"]},"campaignId":{"type":"string"},"config":{"$ref":"#/components/schemas/StorylineConfig"}}}},"required":["storyline"]},"CrmClient":{"additionalProperties":false,"type":"object","properties":{"crmId":{"type":"string"},"data":{"additionalProperties":true,"type":"object","properties":{"name":{"type":"string"},"userId":{"type":"string"},"countryCode":{"type":"string"},"businessTypeCode":{"type":"number"},"parentAccountId":{"type":"string"},"salesConsultant":{"type":"string"},"showInVideoDrop":{"type":"boolean"},"videoDropUserId":{"type":"string"},"partnerAccountId":{"type":"string"},"campaignResponsibleId":{"type":"string"},"salesConsultantCommissionFee":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["crmId","data","createdAt","updatedAt"]},"CrmClientSearchResponse":{"additionalProperties":false,"type":"object","properties":{"clients":{"type":"array","items":{"$ref":"#/components/schemas/CrmClient"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["clients","total","limit","offset"]},"AdminReportQuery":{"additionalProperties":false,"type":"object","properties":{"template":{"description":"Report template identifier","type":"string"},"startDate":{"description":"Start date in ISO format (e.g., 2024-01-01)","type":"string"},"endDate":{"description":"End date in ISO format (e.g., 2024-01-31)","type":"string"}},"required":["template","startDate","endDate"]},"AdminReportData":{"additionalProperties":false,"type":"object","properties":{"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"totalDataPoints":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"eventTimeSlot":{"type":"string"},"clientId":{"type":"string"},"storylineSlug":{"type":"string"},"storylineTitle":{"type":"string"},"storyKey":{"type":"string"},"crmClientId":{"type":"string"},"crmOrderId":{"type":"string"},"impressions":{"type":"number"},"thumbnailVideoStarts":{"type":"number"},"thumbnailVideoCompleteUnique":{"type":"number"},"fullscreenVideoStarts":{"type":"number"},"fullscreenVideoCompletions":{"type":"number"}},"required":["eventTimeSlot","clientId","storylineSlug","storylineTitle","storyKey","impressions","thumbnailVideoStarts","thumbnailVideoCompleteUnique","fullscreenVideoStarts","fullscreenVideoCompletions"]}}},"required":["period","totalDataPoints","data"]},"AdminReportResponse":{"additionalProperties":false,"type":"object","properties":{"template":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"},"data":{"additionalProperties":false,"type":"object","properties":{"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"totalDataPoints":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"eventTimeSlot":{"type":"string"},"clientId":{"type":"string"},"storylineSlug":{"type":"string"},"storylineTitle":{"type":"string"},"storyKey":{"type":"string"},"crmClientId":{"type":"string"},"crmOrderId":{"type":"string"},"impressions":{"type":"number"},"thumbnailVideoStarts":{"type":"number"},"thumbnailVideoCompleteUnique":{"type":"number"},"fullscreenVideoStarts":{"type":"number"},"fullscreenVideoCompletions":{"type":"number"}},"required":["eventTimeSlot","clientId","storylineSlug","storylineTitle","storyKey","impressions","thumbnailVideoStarts","thumbnailVideoCompleteUnique","fullscreenVideoStarts","fullscreenVideoCompletions"]}}},"required":["period","totalDataPoints","data"]}},"required":["template","startDate","endDate","data"]}}},"paths":{"/health/ready":{"get":{"tags":["system"],"responses":{"200":{"description":"Default Response"}}}},"/ping-db":{"get":{"tags":["system"],"responses":{"200":{"description":"Default Response"}}}},"/health":{"get":{"tags":["system"],"responses":{"200":{"description":"Default Response"}}}},"/ping":{"get":{"tags":["system"],"responses":{"200":{"description":"Default Response"}}}},"/api/{clientId}/storylines":{"get":{"tags":["storylines"],"description":"List storylines for clientId","parameters":[{"schema":{"default":false,"type":"boolean"},"in":"query","name":"includeStories","required":false},{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storylines":{"type":"array","items":{"$ref":"#/components/schemas/Storyline"}}},"required":["storylines"]}}}}}},"post":{"tags":["storylines"],"description":"Create new storyline","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyline":{"$ref":"#/components/schemas/CreateStoryline"}},"required":["storyline"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyline":{"$ref":"#/components/schemas/Storyline"}},"required":["storyline"]}}}}}}},"/api/{clientId}/storylines/{id}":{"get":{"tags":["storylines"],"description":"Get one storyline by id and clientId","parameters":[{"schema":{"default":true,"type":"boolean"},"in":"query","name":"includeStories","required":false},{"schema":{"default":false,"type":"boolean"},"in":"query","name":"includeStoryMappings","required":false},{"schema":{"type":"number"},"in":"query","name":"storyLimit","required":false},{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyline":{"$ref":"#/components/schemas/Storyline"},"stories":{"type":"array","items":{"$ref":"#/components/schemas/Story"}},"storyMappings":{"type":"array","items":{"$ref":"#/components/schemas/StoryMapping"}}},"required":["storyline"]}}}}}},"patch":{"tags":["storylines"],"description":"Update storyline","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyline":{"additionalProperties":false,"type":"object","properties":{"title":{"minLength":1,"maxLength":130,"type":"string"},"status":{"type":"string","enum":["live","deleted"]},"campaignId":{"type":"string"},"config":{"$ref":"#/components/schemas/StorylineConfig"}}}},"required":["storyline"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyline":{"$ref":"#/components/schemas/Storyline"}},"required":["storyline"]}}}}}},"delete":{"tags":["storylines"],"description":"Delete storyline","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/api/{clientId}/storylines/bySlug/{slug}":{"get":{"tags":["storylines"],"description":"Get one storyline by slug and clientId","parameters":[{"schema":{"default":true,"type":"boolean"},"in":"query","name":"includeStories","required":false},{"schema":{"default":false,"type":"boolean"},"in":"query","name":"includeStoryMappings","required":false},{"schema":{"type":"number"},"in":"query","name":"storyLimit","required":false},{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"slug","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyline":{"$ref":"#/components/schemas/Storyline"},"stories":{"type":"array","items":{"$ref":"#/components/schemas/Story"}},"storyMappings":{"type":"array","items":{"$ref":"#/components/schemas/StoryMapping"}}},"required":["storyline"]}}}}}}},"/api/{clientId}/storylines/{id}/manifest":{"get":{"tags":["storylines"],"description":"Generate manifest for storyline so you can see unpublished changes","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"manifest":{"$ref":"#/components/schemas/Manifest"},"manifestMd5":{"type":"string"},"isPublished":{"type":"boolean"}},"required":["manifest","manifestMd5","isPublished"]}}}}}}},"/api/{clientId}/storylines/{id}/addStories":{"post":{"tags":["storylines"],"description":"Add stories to storyline","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyIds":{"minItems":1,"uniqueItems":true,"type":"array","items":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"}}},"required":["storyIds"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/api/{clientId}/storylines/{id}/removeStories":{"post":{"tags":["storylines"],"description":"Remove stories from storyline","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyIds":{"minItems":1,"uniqueItems":true,"type":"array","items":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"}}},"required":["storyIds"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/api/{clientId}/storylines/{id}/publish":{"post":{"tags":["storylines"],"description":"Publish storyline","parameters":[{"schema":{"default":false,"type":"boolean"},"in":"query","name":"forcePublish","required":false},{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"The storyline was successfully published","content":{"application/json":{"schema":{"description":"The storyline was successfully published","additionalProperties":false,"type":"object","properties":{"publishedManifest":{"$ref":"#/components/schemas/Manifest"},"publishedManifestMd5":{"type":"string"},"publishedAt":{"type":"string"}},"required":["publishedManifest","publishedManifestMd5","publishedAt"]}}}},"204":{"description":"The storyline manifest has not changed and the storyline was not published"}}}},"/api/{clientId}/storylines/{id}/avatar":{"post":{"tags":["storylines"],"description":"Upload avatar for storyline to both GCP and AWS storage","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"avatarUrl":{"type":"string"}},"required":["avatarUrl"]}}}}}}},"/api/{clientId}/storylines/{id}/fonts":{"post":{"tags":["storylines"],"description":"Upload a custom font file for a storyline","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"family":{"type":"string"},"weight":{"type":"string"},"style":{"type":"string"},"format":{"type":"string"},"url":{"type":"string"}},"required":["family","weight","style","format","url"]}}}}}}},"/api/{clientId}/storylines/{id}/public-stats":{"post":{"tags":["storylines"],"description":"Create or update public stats URL for storyline","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"}},"required":["password"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"publicId":{"type":"string"},"publicUrl":{"type":"string"},"password":{"type":"string"},"config":{"additionalProperties":true,"type":"object","properties":{"dateRange":{"type":"object","properties":{"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}}}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["publicId","publicUrl","createdAt","updatedAt"]}}}}}},"delete":{"tags":["storylines"],"description":"Delete public stats URL for storyline","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}},"get":{"tags":["storylines"],"description":"Get public stats info for storyline","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"additionalProperties":false,"type":"object","properties":{"publicId":{"type":"string"},"publicUrl":{"type":"string"},"password":{"type":"string"},"config":{"additionalProperties":true,"type":"object","properties":{"dateRange":{"type":"object","properties":{"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}}}}},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["publicId","publicUrl","createdAt","updatedAt"]},{"type":"null"}]}}}}}}},"/api/{clientId}/stories":{"get":{"tags":["stories"],"description":"List stories for clientId","parameters":[{"schema":{"type":"string"},"in":"query","name":"query","required":false},{"schema":{"default":false,"type":"boolean"},"in":"query","name":"includeStorylines","required":false},{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"stories":{"type":"array","items":{"$ref":"#/components/schemas/Story"}}},"required":["stories"]}}}}}},"post":{"tags":["stories"],"description":"Create story and optionally specify which storylines it should appear in","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/CreateStory"},"storylineIds":{"uniqueItems":true,"type":"array","items":{"type":"string"}}},"required":["story"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/Story"}},"required":["story"]}}}}}}},"/api/{clientId}/stories/{id}":{"get":{"tags":["stories"],"description":"Get one story by id and clientId","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/Story"},"storylines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]}}},"required":["story","storylines"]}}}}}},"patch":{"tags":["stories"],"description":"Update story properties","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/UpdateStory"}},"required":["story"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/Story"},"storylines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]}}},"required":["story","storylines"]}}}}}},"delete":{"tags":["stories"],"description":"Delete story","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/api/{clientId}/stories/{id}/storylines":{"post":{"tags":["stories"],"description":"Update storylines association for a story by specifying which storyline IDs the story should appear in","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storylineIds":{"uniqueItems":true,"type":"array","items":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"}}},"required":["storylineIds"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"story":{"$ref":"#/components/schemas/Story"},"storylines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","title"]}}},"required":["story","storylines"]}}}},"204":{"description":"Default Response"}}}},"/api/{clientId}/storyMappings":{"get":{"tags":["storyMappings"],"description":"List story mappings for clientId","parameters":[{"schema":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"in":"query","name":"storylineId","required":false},{"schema":{"minimum":1,"maximum":500,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyMappings":{"type":"array","items":{"$ref":"#/components/schemas/StoryMapping"}}},"required":["storyMappings"]}}}}}},"post":{"tags":["storyMappings"],"description":"Create new story mapping","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyMapping":{"additionalProperties":false,"type":"object","properties":{"storylineId":{"type":"string"},"storyId":{"type":"string"},"pinnedPosition":{"minimum":1,"type":"integer"},"sortOrder":{"type":"number"}},"required":["storylineId","storyId"]}},"required":["storyMapping"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyMapping":{"$ref":"#/components/schemas/StoryMapping"}},"required":["storyMapping"]}}}}}}},"/api/{clientId}/storyMappings/{id}":{"get":{"tags":["storyMappings"],"description":"Get one story by id and clientId","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyMapping":{"$ref":"#/components/schemas/StoryMapping"}},"required":["storyMapping"]}}}}}},"patch":{"tags":["storyMappings"],"description":"Update story mapping","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyMapping":{"additionalProperties":false,"type":"object","properties":{"pinnedPosition":{"anyOf":[{"type":"null"},{"minimum":1,"type":"integer"}]},"sortOrder":{"type":"number"}}},"newPosition":{"minimum":1,"maximum":50,"type":"number"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"storyMapping":{"$ref":"#/components/schemas/StoryMapping"}},"required":["storyMapping"]}}}}}},"delete":{"tags":["storyMappings"],"description":"Delete story mapping","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/api/{clientId}/clients/me":{"get":{"tags":["clients"],"description":"Get client info","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"client":{"$ref":"#/components/schemas/Client"}},"required":["client"]}}}}}}},"/api/me":{"get":{"tags":["clients"],"description":"Get all clients accessible to the authenticated user based on their roles","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"clients":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"groups":{"type":"array","items":{"$ref":"#/components/schemas/ClientGroup"}}},"required":["clients","groups"]}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api/{clientId}/campaigns":{"get":{"tags":["campaigns"],"description":"List all campaigns for a client","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"crmOrderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","slug","advertiserId","startDate","createdAt","updatedAt"]}}},"required":["campaigns"]}}}}}},"post":{"tags":["campaigns"],"description":"Create a new campaign","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"campaign":{"type":"object","properties":{"name":{"minLength":1,"maxLength":83,"type":"string"},"description":{"type":"string"},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}},"required":["name","advertiserId"]}},"required":["campaign"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"crmOrderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","slug","advertiserId","startDate","createdAt","updatedAt"]},"advertiser":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","createdAt","updatedAt"]},"storylinesCount":{"type":"integer"}},"required":["campaign","advertiser"]}}}}}}},"/api/{clientId}/campaigns/{id}":{"get":{"tags":["campaigns"],"description":"Get a single campaign by ID or slug","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"crmOrderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","slug","advertiserId","startDate","createdAt","updatedAt"]},"advertiser":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","createdAt","updatedAt"]},"storylinesCount":{"type":"integer"}},"required":["campaign","advertiser"]}}}}}},"patch":{"tags":["campaigns"],"description":"Update a campaign","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"campaign":{"type":"object","properties":{"name":{"minLength":1,"maxLength":83,"type":"string"},"description":{"type":"string"},"crmOrderId":{"type":"string"},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"}}}},"required":["campaign"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"crmOrderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"advertiserId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"endDate":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","slug","advertiserId","startDate","createdAt","updatedAt"]},"advertiser":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","createdAt","updatedAt"]},"storylinesCount":{"type":"integer"}},"required":["campaign","advertiser"]}}}}}},"delete":{"tags":["campaigns"],"description":"Delete a campaign","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/api/{clientId}/campaigns/{id}/storylines":{"get":{"tags":["campaigns"],"description":"List all storylines (brand stories) for a campaign","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"storylines":{"type":"array","items":{"additionalProperties":false,"type":"object","properties":{"id":{"minLength":26,"maxLength":26,"pattern":"^[0-9a-hjkmnp-tv-z]{26}$","type":"string"},"clientId":{"type":"string"},"campaignId":{"type":"string"},"slug":{"type":"string"},"title":{"minLength":1,"maxLength":130,"type":"string"},"status":{"type":"string","enum":["live","deleted"]},"publishedManifest":{},"publishedManifestMd5":{"type":"string"},"publishedManifestPath":{"type":"string"},"publishedAt":{"type":"string","format":"date-time"},"config":{"$ref":"#/components/schemas/StorylineConfig"},"scriptMd5":{"type":"string"},"scriptUrl":{"type":"string"},"manifestUrl":{"type":"string"},"stories":{"type":"array","items":{"$ref":"#/components/schemas/StoryWithMapping"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","clientId","slug","title","status","createdAt","updatedAt"]}}},"required":["storylines"]}}}}}}},"/api/{clientId}/advertisers":{"get":{"tags":["advertisers"],"description":"List all advertisers for a client","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"advertisers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","createdAt","updatedAt"]}}},"required":["advertisers"]}}}}}},"post":{"tags":["advertisers"],"description":"Create a new advertiser","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"advertiser":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"}},"required":["name"]}},"required":["advertiser"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"advertiser":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","createdAt","updatedAt"]}},"required":["advertiser"]}}}}}}},"/api/{clientId}/advertisers/{id}":{"get":{"tags":["advertisers"],"description":"Get a single advertiser by ID with campaigns","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"advertiser":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"campaigns":{"type":"array","items":{}}},"required":["id","clientId","name","createdAt","updatedAt","campaigns"]}},"required":["advertiser"]}}}}}},"put":{"tags":["advertisers"],"description":"Update an advertiser","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"advertiser":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"type":"string"}},"required":["name"]}},"required":["advertiser"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"advertiser":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"deletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","clientId","name","createdAt","updatedAt"]}},"required":["advertiser"]}}}}}},"delete":{"tags":["advertisers"],"description":"Delete an advertiser (only if no campaigns are associated)","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"minLength":26,"maxLength":26,"type":"string"},"in":"header","name":"x-api-key","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}},"/api/{clientId}/users":{"post":{"tags":["users"],"description":"Create a new user for the client","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"email":{"format":"email","type":"string"},"firstName":{"minLength":1,"maxLength":200,"type":"string"},"lastName":{"minLength":1,"maxLength":200,"type":"string"},"roles":{"type":"array","items":{"enum":["read","write","admin"],"type":"string"}}},"required":["email","firstName","lastName","roles"]}}},"required":true},"parameters":[{"schema":{"minLength":1,"maxLength":60,"type":"string"},"in":"path","name":"clientId","required":true}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}},"required":["user"]}}}}}},"get":{"tags":["users"],"description":"Get all users for the client","parameters":[{"schema":{"minLength":1,"maxLength":60,"type":"string"},"in":"path","name":"clientId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/User"}}},"required":["users"]}}}}}}},"/api/{clientId}/users/{userId}":{"get":{"tags":["users"],"description":"Get a specific user","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"userId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"user":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"clientId":{"type":"string"},"roles":{"type":"array","items":{"enum":["read","write","admin"],"type":"string"}},"enabled":{"type":"boolean"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","email","firstName","lastName","clientId","roles","enabled","emailVerified","createdAt"]}},"required":["user"]}}}}}},"patch":{"tags":["users"],"description":"Update a user (superuser or admin only)","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"email":{"format":"email","type":"string"},"firstName":{"minLength":1,"maxLength":200,"type":"string"},"lastName":{"minLength":1,"maxLength":200,"type":"string"},"enabled":{"type":"boolean"},"roles":{"minItems":1,"type":"array","items":{"enum":["read","write","admin"],"type":"string"}}},"required":["firstName","lastName","roles"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"userId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"user":{"additionalProperties":false,"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"clientId":{"type":"string"},"roles":{"type":"array","items":{"enum":["read","write","admin"],"type":"string"}},"enabled":{"type":"boolean"},"emailVerified":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","email","firstName","lastName","clientId","roles","enabled","emailVerified","createdAt"]}},"required":["user"]}}}}}},"delete":{"tags":["users"],"description":"Delete a user (superuser or admin only)","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"userId","required":true}],"responses":{"204":{"description":"Default Response"}}}},"/api/{clientId}/users/{userId}/resend-verification-email":{"post":{"tags":["users"],"description":"Resend verification email to a user","parameters":[{"schema":{"type":"string"},"in":"path","name":"clientId","required":true},{"schema":{"type":"string"},"in":"path","name":"userId","required":true}],"responses":{"204":{"description":"Default Response"}}}},"/admin-api/stats":{"get":{"tags":["Admin"],"description":"Get storyline stats with optional filters for client_id(s), start and end date","parameters":[{"schema":{"type":"string"},"in":"query","name":"clientId","required":true,"description":"Filter stats by specific client ID"},{"schema":{"type":"string"},"in":"query","name":"startTime","required":true,"description":"Start date in ISO format (e.g., 2024-01-01T00:00:00.000Z)"},{"schema":{"type":"string"},"in":"query","name":"endTime","required":true,"description":"End date in ISO format (e.g., 2024-01-31T23:59:59.999Z)"},{"schema":{"anyOf":[{"type":"string","enum":["storylineSlug"]},{"type":"string","enum":["clientId"]}]},"in":"query","name":"groupBy","required":false,"description":"Group by storyline slug or client ID."},{"schema":{"anyOf":[{"type":"string","enum":["hour"]},{"type":"string","enum":["day"]},{"type":"string","enum":["week"]},{"type":"string","enum":["month"]},{"type":"string","enum":["year"]}]},"in":"query","name":"granularity","required":false,"description":"Granularity for stats aggregation. Options: \"hour\", \"day\", \"week\", \"month\", \"year\". Defaults to \"day\"."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"stats":{"type":"array","items":{}},"total_clients":{"type":"number"},"date_range":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}}}},"required":["stats","total_clients","date_range"]}}}}}}},"/admin-api/crm/clients":{"get":{"tags":["Admin","CRM"],"description":"Search and list clients from CRM system","parameters":[{"schema":{"type":"string"},"in":"query","name":"search","required":false,"description":"Search term to filter clients by name"},{"schema":{"minimum":1,"maximum":100,"default":20,"type":"integer"},"in":"query","name":"limit","required":false},{"schema":{"minimum":0,"default":0,"type":"integer"},"in":"query","name":"offset","required":false},{"schema":{"type":"string"},"in":"query","name":"countryCode","required":false,"description":"Filter by country code"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"clients":{"type":"array","items":{"$ref":"#/components/schemas/CrmClient"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["clients","total","limit","offset"]}}}}}}},"/admin-api/crm/clients/{crmId}":{"get":{"tags":["Admin","CRM"],"description":"Get a specific client from CRM system by ID","parameters":[{"schema":{"type":"string"},"in":"path","name":"crmId","required":true,"description":"CRM client ID"}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"crmId":{"type":"string"},"data":{"additionalProperties":true,"type":"object","properties":{"name":{"type":"string"},"userId":{"type":"string"},"countryCode":{"type":"string"},"businessTypeCode":{"type":"number"},"parentAccountId":{"type":"string"},"salesConsultant":{"type":"string"},"showInVideoDrop":{"type":"boolean"},"videoDropUserId":{"type":"string"},"partnerAccountId":{"type":"string"},"campaignResponsibleId":{"type":"string"},"salesConsultantCommissionFee":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["crmId","data","createdAt","updatedAt"]}}}}}}},"/admin-api/report":{"get":{"tags":["Admin"],"description":"Generate a report based on template and date range","parameters":[{"schema":{"type":"string"},"in":"query","name":"template","required":true,"description":"Report template identifier"},{"schema":{"type":"string"},"in":"query","name":"startDate","required":true,"description":"Start date in ISO format (e.g., 2024-01-01)"},{"schema":{"type":"string"},"in":"query","name":"endDate","required":true,"description":"End date in ISO format (e.g., 2024-01-31)"},{"schema":{"type":"string"},"in":"header","name":"x-timezone","required":false,"description":"IANA timezone for date aggregation (e.g. Asia/Tokyo). Defaults to UTC if not specified."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"additionalProperties":false,"type":"object","properties":{"template":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"},"data":{"additionalProperties":false,"type":"object","properties":{"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]},"totalDataPoints":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"eventTimeSlot":{"type":"string"},"clientId":{"type":"string"},"storylineSlug":{"type":"string"},"storylineTitle":{"type":"string"},"storyKey":{"type":"string"},"crmClientId":{"type":"string"},"crmOrderId":{"type":"string"},"impressions":{"type":"number"},"thumbnailVideoStarts":{"type":"number"},"thumbnailVideoCompleteUnique":{"type":"number"},"fullscreenVideoStarts":{"type":"number"},"fullscreenVideoCompletions":{"type":"number"}},"required":["eventTimeSlot","clientId","storylineSlug","storylineTitle","storyKey","impressions","thumbnailVideoStarts","thumbnailVideoCompleteUnique","fullscreenVideoStarts","fullscreenVideoCompletions"]}}},"required":["period","totalDataPoints","data"]}},"required":["template","startDate","endDate","data"]}}}}}}}},"servers":[{"url":"http://localhost:8001"}]}