{"openapi":"3.1.0","info":{"title":"saasco API","description":"saasco Api Docs for the saasco App project","version":"2.0.0"},"servers":[{"url":"https://www.saasco.com/api/v2/"}],"tags":[{"name":"Users"},{"name":"Events"},{"name":"Sessions"},{"name":"Funnels"},{"name":"Usage"},{"name":"Contacts"},{"name":"Attributes"},{"name":"Lists"},{"name":"List Members"},{"name":"Notifications"},{"name":"Custom Links"},{"name":"Clean"},{"name":"Campaigns"},{"name":"Emails"},{"name":"Sender"},{"name":"Articles"},{"name":"Collections"},{"name":"Help Center"},{"name":"Widget"},{"name":"Conversations"},{"name":"Messages"},{"name":"Workflows"},{"name":"Steps"},{"name":"Edges"},{"name":"Runs"},{"name":"Ads"},{"name":"Domains"},{"name":"Files"},{"name":"Projects"},{"name":"Credits"}],"paths":{"/projects/{projectId}/ads/top-ads":{"post":{"operationId":"ads-getTopAds","summary":"Get Top Ads","description":"Fetches top-performing ads from an ad account with customizable sorting and filtering options. Supports multiple platforms.","tags":["Ads"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cursor":{"type":"string"},"datePreset":{"default":"last_30d","type":"string","enum":["today","yesterday","this_month","last_month","this_quarter","maximum","data_maximum","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","last_week_mon_sun","last_week_sun_sat","last_quarter","last_year","this_week_mon_today","this_week_sun_today","this_year"]},"effectiveStatus":{"type":"array","items":{"type":"string","enum":["ACTIVE","PAUSED","DELETED","ARCHIVED"]}},"level":{"default":"ad","type":"string","enum":["ad","adset","campaign"]},"limit":{"default":50,"type":"number","minimum":1,"maximum":500},"platform":{"type":"string","enum":["meta"]},"sort":{"default":"impressions_descending","type":"string","enum":["impressions_descending","impressions_ascending","clicks_descending","clicks_ascending","spend_descending","spend_ascending","ctr_descending","ctr_ascending","cpm_descending","cpm_ascending","cpc_descending","cpc_ascending","revenue_descending","revenue_ascending","roas_descending","roas_ascending"]},"status":{"type":"array","items":{"type":"string","enum":["ACTIVE","PAUSED","DELETED","ARCHIVED"]}},"skipCache":{"type":"boolean"},"skipWriteCache":{"type":"boolean"}},"required":["platform"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"result":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"ad":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["meta"]},"status":{"type":"string","enum":["ACTIVE","PAUSED","PENDING","DELETED","ARCHIVED"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"adsetId":{"type":"string"},"adsetName":{"type":"string"},"adId":{"type":"string"},"adName":{"type":"string"},"campaignLink":{"type":"string"},"adsetLink":{"type":"string"},"adLink":{"type":"string"},"objective":{"type":"string","enum":["OUTCOME_APP_PROMOTION","OUTCOME_AWARENESS","OUTCOME_ENGAGEMENT","OUTCOME_LEADS","OUTCOME_SALES","OUTCOME_TRAFFIC"]},"optimizationGoal":{"type":"string"},"creative":{"type":"object","properties":{"type":{"type":"string","enum":["IMAGE","VIDEO","OTHER"]},"title":{"type":"string"},"body":{"type":"string"},"description":{"type":"string"},"thumbnailUrl":{"type":"string"},"videoUrl":{"type":"string"},"linkUrl":{"type":"string"},"callToAction":{"type":"string"}},"required":["type","title","body","description","thumbnailUrl"],"additionalProperties":false}},"required":["accountId","platform","status","createdAt","adId","adName","creative"],"additionalProperties":false},"metrics":{"anyOf":[{"type":"object","properties":{"adCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"adAgeDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"adUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"delivery":{"anyOf":[{"type":"string"},{"type":"null"}]},"effectiveStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"attributionSetting":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"objective":{"anyOf":[{"type":"string"},{"type":"null"}]},"optimizationGoal":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountName":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignId":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignName":{"anyOf":[{"type":"string"},{"type":"null"}]},"adSetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"adSetName":{"anyOf":[{"type":"string"},{"type":"null"}]},"adId":{"anyOf":[{"type":"string"},{"type":"null"}]},"adName":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateStop":{"anyOf":[{"type":"string"},{"type":"null"}]},"spend":{"anyOf":[{"type":"number"},{"type":"null"}]},"impressions":{"anyOf":[{"type":"number"},{"type":"null"}]},"reach":{"anyOf":[{"type":"number"},{"type":"null"}]},"frequency":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpc":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpm":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpp":{"anyOf":[{"type":"number"},{"type":"null"}]},"revenue":{"anyOf":[{"type":"number"},{"type":"null"}]},"roas":{"anyOf":[{"type":"number"},{"type":"null"}]},"clicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"ctr":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUniqueClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"outboundClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"outboundCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerOutboundClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueOutboundClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueOutboundCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUniqueOutboundClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerConversion":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoPlays":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoPlay":{"anyOf":[{"type":"number"},{"type":"null"}]},"video3SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video3SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideo3SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video30SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video30SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideo30SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP25Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP25WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP25Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP50Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP50WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP50Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP75Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP75WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP75Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP95Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP95WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP95Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP100Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP100WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP100Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoContinuous2SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoContinuous2SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoContinuous2SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoAvgTimeWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoTimeWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoPlayCurve":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"actions":{"default":[],"type":"array","items":{"type":"object","properties":{"costPer":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUnique":{"anyOf":[{"type":"number"},{"type":"null"}]},"key":{"type":"string","minLength":1},"total":{"anyOf":[{"type":"number"},{"type":"null"}]},"unique":{"anyOf":[{"type":"number"},{"type":"null"}]},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The monetary value of the actions"}},"required":["costPer","costPerUnique","key","total","unique","value"],"additionalProperties":false}}},"required":["adCreatedAt","adAgeDays","adUpdatedAt","delivery","effectiveStatus","attributionSetting","accountCurrency","objective","optimizationGoal","accountId","accountName","campaignId","campaignName","adSetId","adSetName","adId","adName","dateStart","dateStop","spend","impressions","reach","frequency","cpc","cpm","cpp","revenue","roas","clicks","ctr","uniqueClicks","uniqueCtr","costPerUniqueClick","outboundClicks","outboundCtr","costPerOutboundClick","uniqueOutboundClicks","uniqueOutboundCtr","costPerUniqueOutboundClick","conversions","costPerConversion","conversionRate","videoPlays","costPerVideoPlay","video3SecWatched","video3SecWatchedRate","costPerVideo3SecWatched","video30SecWatched","video30SecWatchedRate","costPerVideo30SecWatched","videoP25Watched","videoP25WatchedRate","costPerVideoP25Watched","videoP50Watched","videoP50WatchedRate","costPerVideoP50Watched","videoP75Watched","videoP75WatchedRate","costPerVideoP75Watched","videoP95Watched","videoP95WatchedRate","costPerVideoP95Watched","videoP100Watched","videoP100WatchedRate","costPerVideoP100Watched","videoContinuous2SecWatched","videoContinuous2SecWatchedRate","costPerVideoContinuous2SecWatched","videoAvgTimeWatched","videoTimeWatched","videoPlayCurve","actions"],"additionalProperties":false},{"type":"null"}]}},"required":["ad","metrics"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"previousCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","nextCursor","previousCursor"],"additionalProperties":false}},"required":["result"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/ads/ad-with-insights":{"post":{"operationId":"ads-getAdWithInsights","summary":"Get Ad With Insights","description":"Retrieves detailed information about a specific ad including standardized insights metrics.","tags":["Ads"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adId":{"type":"string","minLength":1},"datePreset":{"default":"last_30d","type":"string","enum":["today","yesterday","this_month","last_month","this_quarter","maximum","data_maximum","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","last_week_mon_sun","last_week_sun_sat","last_quarter","last_year","this_week_mon_today","this_week_sun_today","this_year"]},"platform":{"type":"string","enum":["meta"]},"skipCache":{"type":"boolean"},"skipWriteCache":{"type":"boolean"}},"required":["adId","platform"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"result":{"type":"object","properties":{"ad":{"type":"object","properties":{"accountId":{"type":"string"},"platform":{"type":"string","enum":["meta"]},"status":{"type":"string","enum":["ACTIVE","PAUSED","PENDING","DELETED","ARCHIVED"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"adsetId":{"type":"string"},"adsetName":{"type":"string"},"adId":{"type":"string"},"adName":{"type":"string"},"campaignLink":{"type":"string"},"adsetLink":{"type":"string"},"adLink":{"type":"string"},"objective":{"type":"string","enum":["OUTCOME_APP_PROMOTION","OUTCOME_AWARENESS","OUTCOME_ENGAGEMENT","OUTCOME_LEADS","OUTCOME_SALES","OUTCOME_TRAFFIC"]},"optimizationGoal":{"type":"string"},"creative":{"type":"object","properties":{"type":{"type":"string","enum":["IMAGE","VIDEO","OTHER"]},"title":{"type":"string"},"body":{"type":"string"},"description":{"type":"string"},"thumbnailUrl":{"type":"string"},"videoUrl":{"type":"string"},"linkUrl":{"type":"string"},"callToAction":{"type":"string"}},"required":["type","title","body","description","thumbnailUrl"],"additionalProperties":false}},"required":["accountId","platform","status","createdAt","adId","adName","creative"],"additionalProperties":false},"metrics":{"anyOf":[{"type":"object","properties":{"adCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"adAgeDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"adUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"delivery":{"anyOf":[{"type":"string"},{"type":"null"}]},"effectiveStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"attributionSetting":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"objective":{"anyOf":[{"type":"string"},{"type":"null"}]},"optimizationGoal":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountName":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignId":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignName":{"anyOf":[{"type":"string"},{"type":"null"}]},"adSetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"adSetName":{"anyOf":[{"type":"string"},{"type":"null"}]},"adId":{"anyOf":[{"type":"string"},{"type":"null"}]},"adName":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateStop":{"anyOf":[{"type":"string"},{"type":"null"}]},"spend":{"anyOf":[{"type":"number"},{"type":"null"}]},"impressions":{"anyOf":[{"type":"number"},{"type":"null"}]},"reach":{"anyOf":[{"type":"number"},{"type":"null"}]},"frequency":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpc":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpm":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpp":{"anyOf":[{"type":"number"},{"type":"null"}]},"revenue":{"anyOf":[{"type":"number"},{"type":"null"}]},"roas":{"anyOf":[{"type":"number"},{"type":"null"}]},"clicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"ctr":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUniqueClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"outboundClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"outboundCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerOutboundClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueOutboundClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueOutboundCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUniqueOutboundClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerConversion":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoPlays":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoPlay":{"anyOf":[{"type":"number"},{"type":"null"}]},"video3SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video3SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideo3SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video30SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video30SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideo30SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP25Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP25WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP25Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP50Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP50WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP50Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP75Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP75WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP75Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP95Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP95WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP95Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP100Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP100WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP100Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoContinuous2SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoContinuous2SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoContinuous2SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoAvgTimeWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoTimeWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoPlayCurve":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"actions":{"default":[],"type":"array","items":{"type":"object","properties":{"costPer":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUnique":{"anyOf":[{"type":"number"},{"type":"null"}]},"key":{"type":"string","minLength":1},"total":{"anyOf":[{"type":"number"},{"type":"null"}]},"unique":{"anyOf":[{"type":"number"},{"type":"null"}]},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The monetary value of the actions"}},"required":["costPer","costPerUnique","key","total","unique","value"],"additionalProperties":false}}},"required":["adCreatedAt","adAgeDays","adUpdatedAt","delivery","effectiveStatus","attributionSetting","accountCurrency","objective","optimizationGoal","accountId","accountName","campaignId","campaignName","adSetId","adSetName","adId","adName","dateStart","dateStop","spend","impressions","reach","frequency","cpc","cpm","cpp","revenue","roas","clicks","ctr","uniqueClicks","uniqueCtr","costPerUniqueClick","outboundClicks","outboundCtr","costPerOutboundClick","uniqueOutboundClicks","uniqueOutboundCtr","costPerUniqueOutboundClick","conversions","costPerConversion","conversionRate","videoPlays","costPerVideoPlay","video3SecWatched","video3SecWatchedRate","costPerVideo3SecWatched","video30SecWatched","video30SecWatchedRate","costPerVideo30SecWatched","videoP25Watched","videoP25WatchedRate","costPerVideoP25Watched","videoP50Watched","videoP50WatchedRate","costPerVideoP50Watched","videoP75Watched","videoP75WatchedRate","costPerVideoP75Watched","videoP95Watched","videoP95WatchedRate","costPerVideoP95Watched","videoP100Watched","videoP100WatchedRate","costPerVideoP100Watched","videoContinuous2SecWatched","videoContinuous2SecWatchedRate","costPerVideoContinuous2SecWatched","videoAvgTimeWatched","videoTimeWatched","videoPlayCurve","actions"],"additionalProperties":false},{"type":"null"}]}},"required":["ad","metrics"],"additionalProperties":false}},"required":["result"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/ads/ad-account-info":{"get":{"operationId":"ads-getAdAccountInfo","summary":"Get Ad Account Info","description":"Retrieves basic information about an ad account including name and status. Supports multiple platforms.","tags":["Ads"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"platform","schema":{"type":"string","enum":["meta"]},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string"},"name":{"type":"string"},"platform":{"type":"string","enum":["meta"]},"status":{"type":"number"}},"required":["accountId","platform"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/ads/validate-token":{"post":{"operationId":"ads-validateAccessToken","summary":"Validate Access Token","description":"Validates if the stored access token for the project is still valid by making a lightweight API call.","tags":["Ads"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["meta"]}},"required":["platform"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"isValid":{"type":"boolean"}},"required":["isValid"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/ads/user-ad-accounts":{"get":{"operationId":"ads-getUserAdAccounts","summary":"Get User Ad Accounts","description":"Retrieves all ad accounts accessible by the user with provided access token.","tags":["Ads"],"security":[{"Authorization":[]}],"parameters":[{"in":"query","name":"accessToken","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"account_status":{"type":"number"},"business":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"picture":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"currency":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"timezone_name":{"type":"string"}},"required":["account_id","account_status","id","name"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/ads/account-insights":{"post":{"operationId":"ads-getAdAccountInsights","summary":"Get Ad Account Insights","description":"Retrieves aggregated insights metrics for an entire ad account across all campaigns and ads.","tags":["Ads"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"datePreset":{"type":"string","enum":["today","yesterday","this_month","last_month","this_quarter","maximum","data_maximum","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","last_week_mon_sun","last_week_sun_sat","last_quarter","last_year","this_week_mon_today","this_week_sun_today","this_year"]},"platform":{"type":"string","enum":["meta"]},"skipCache":{"type":"boolean"},"skipWriteCache":{"type":"boolean"}},"required":["datePreset","platform"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"result":{"type":"object","properties":{"adCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"adAgeDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"adUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"delivery":{"anyOf":[{"type":"string"},{"type":"null"}]},"effectiveStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"attributionSetting":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"objective":{"anyOf":[{"type":"string"},{"type":"null"}]},"optimizationGoal":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountName":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignId":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignName":{"anyOf":[{"type":"string"},{"type":"null"}]},"adSetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"adSetName":{"anyOf":[{"type":"string"},{"type":"null"}]},"adId":{"anyOf":[{"type":"string"},{"type":"null"}]},"adName":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateStop":{"anyOf":[{"type":"string"},{"type":"null"}]},"spend":{"anyOf":[{"type":"number"},{"type":"null"}]},"impressions":{"anyOf":[{"type":"number"},{"type":"null"}]},"reach":{"anyOf":[{"type":"number"},{"type":"null"}]},"frequency":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpc":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpm":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpp":{"anyOf":[{"type":"number"},{"type":"null"}]},"revenue":{"anyOf":[{"type":"number"},{"type":"null"}]},"roas":{"anyOf":[{"type":"number"},{"type":"null"}]},"clicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"ctr":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUniqueClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"outboundClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"outboundCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerOutboundClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueOutboundClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueOutboundCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUniqueOutboundClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerConversion":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoPlays":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoPlay":{"anyOf":[{"type":"number"},{"type":"null"}]},"video3SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video3SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideo3SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video30SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video30SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideo30SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP25Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP25WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP25Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP50Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP50WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP50Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP75Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP75WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP75Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP95Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP95WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP95Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP100Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP100WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP100Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoContinuous2SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoContinuous2SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoContinuous2SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoAvgTimeWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoTimeWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoPlayCurve":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"actions":{"default":[],"type":"array","items":{"type":"object","properties":{"costPer":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUnique":{"anyOf":[{"type":"number"},{"type":"null"}]},"key":{"type":"string","minLength":1},"total":{"anyOf":[{"type":"number"},{"type":"null"}]},"unique":{"anyOf":[{"type":"number"},{"type":"null"}]},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The monetary value of the actions"}},"required":["costPer","costPerUnique","key","total","unique","value"],"additionalProperties":false}}},"required":["adCreatedAt","adAgeDays","adUpdatedAt","delivery","effectiveStatus","attributionSetting","accountCurrency","objective","optimizationGoal","accountId","accountName","campaignId","campaignName","adSetId","adSetName","adId","adName","dateStart","dateStop","spend","impressions","reach","frequency","cpc","cpm","cpp","revenue","roas","clicks","ctr","uniqueClicks","uniqueCtr","costPerUniqueClick","outboundClicks","outboundCtr","costPerOutboundClick","uniqueOutboundClicks","uniqueOutboundCtr","costPerUniqueOutboundClick","conversions","costPerConversion","conversionRate","videoPlays","costPerVideoPlay","video3SecWatched","video3SecWatchedRate","costPerVideo3SecWatched","video30SecWatched","video30SecWatchedRate","costPerVideo30SecWatched","videoP25Watched","videoP25WatchedRate","costPerVideoP25Watched","videoP50Watched","videoP50WatchedRate","costPerVideoP50Watched","videoP75Watched","videoP75WatchedRate","costPerVideoP75Watched","videoP95Watched","videoP95WatchedRate","costPerVideoP95Watched","videoP100Watched","videoP100WatchedRate","costPerVideoP100Watched","videoContinuous2SecWatched","videoContinuous2SecWatchedRate","costPerVideoContinuous2SecWatched","videoAvgTimeWatched","videoTimeWatched","videoPlayCurve","actions"],"additionalProperties":false}},"required":["result"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/ads/insights-time-series":{"post":{"operationId":"ads-getAdInsightsTimeSeries","summary":"Get Ad Insights Time Series","description":"Retrieves ad account insights broken down by time (hourly/daily) for charting purposes.","tags":["Ads"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action_attribution_windows":{"default":["7d_click","1d_view"],"type":"array","items":{"type":"string","enum":["1d_click","7d_click","28d_click","1d_view","7d_view","28d_view","default"]}},"action_breakdowns":{"default":["action_type"],"type":"array","items":{"type":"string","enum":["action_carousel_card_id","action_carousel_card_name","action_destination","action_device","action_reaction","action_target_id","action_type","action_video_sound","action_video_type"]}},"adAccountId":{"type":"string"},"adName":{"type":"string"},"adsetId":{"type":"string"},"adsetName":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"cursor":{"type":"string"},"date_preset":{"default":"last_30d","type":"string","enum":["today","yesterday","this_month","last_month","this_quarter","maximum","data_maximum","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","last_week_mon_sun","last_week_sun_sat","last_quarter","last_year","this_week_mon_today","this_week_sun_today","this_year"]},"effectiveStatus":{"type":"array","items":{"type":"string","enum":["ACTIVE","PAUSED","DELETED","ARCHIVED"]}},"fields":{"type":"array","items":{"type":"string","enum":["account_currency","account_id","account_name","action_values","actions","ad_click_actions","ad_id","ad_impression_actions","ad_name","adset_end","adset_id","adset_name","adset_start","age_targeting","attribution_setting","auction_bid","auction_competitiveness","auction_max_competitor_bid","buying_type","campaign_id","campaign_name","canvas_avg_view_percent","canvas_avg_view_time","catalog_segment_actions","catalog_segment_value","catalog_segment_value_mobile_purchase_roas","catalog_segment_value_omni_purchase_roas","catalog_segment_value_website_purchase_roas","clicks","conversion_lead_rate","conversion_leads","conversion_rate_ranking","conversion_values","conversions","converted_product_quantity","converted_product_value","converted_promoted_product_quantity","converted_promoted_product_value","cost_per_15_sec_video_view","cost_per_2_sec_continuous_video_view","cost_per_action_type","cost_per_ad_click","cost_per_conversion","cost_per_dda_countby_convs","cost_per_inline_link_click","cost_per_inline_post_engagement","cost_per_one_thousand_ad_impression","cost_per_outbound_click","cost_per_thruplay","cost_per_unique_action_type","cost_per_unique_click","cost_per_unique_conversion","cost_per_unique_inline_link_click","cost_per_unique_outbound_click","cpc","cpm","cpp","created_time","creative_media_type","ctr","date_start","date_stop","dda_countby_convs","dda_results","engagement_rate_ranking","estimated_ad_recall_rate","estimated_ad_recall_rate_lower_bound","estimated_ad_recall_rate_upper_bound","estimated_ad_recallers","estimated_ad_recallers_lower_bound","estimated_ad_recallers_upper_bound","frequency","full_view_impressions","full_view_reach","gender_targeting","impressions","inline_link_click_ctr","inline_link_clicks","inline_post_engagement","instagram_upcoming_event_reminders_set","instant_experience_clicks_to_open","instant_experience_clicks_to_start","instant_experience_outbound_clicks","interactive_component_tap","labels","landing_page_view_actions_per_link_click","landing_page_view_per_purchase_rate","location","marketing_messages_delivered","marketing_messages_delivery_rate","mobile_app_purchase_roas","objective","optimization_goal","outbound_clicks","outbound_clicks_ctr","place_page_name","purchase_roas","purchases_per_link_click","qualifying_question_qualify_answer_rate","quality_ranking","reach","result_values_performance_indicator","shops_assisted_purchases","social_spend","spend","total_postbacks","unique_actions","unique_clicks","unique_conversions","unique_ctr","unique_inline_link_click_ctr","unique_inline_link_clicks","unique_link_clicks_ctr","unique_outbound_clicks","unique_outbound_clicks_ctr","unique_video_continuous_2_sec_watched_actions","unique_video_view_15_sec","updated_time","video_15_sec_watched_actions","video_30_sec_watched_actions","video_avg_time_watched_actions","video_continuous_2_sec_watched_actions","video_p100_watched_actions","video_p25_watched_actions","video_p50_watched_actions","video_p75_watched_actions","video_p95_watched_actions","video_play_actions","video_play_curve_actions","video_play_retention_0_to_15s_actions","video_play_retention_20_to_60s_actions","video_play_retention_graph_actions","video_thruplay_watched_actions","video_time_watched_actions","video_view_per_impression","website_ctr","website_purchase_roas","wish_bid"]}},"level":{"type":"string","enum":["account","campaign","adset","ad"]},"limit":{"default":50,"type":"number","minimum":1,"maximum":500},"sort":{"default":"impressions_descending","type":"string","enum":["impressions_descending","impressions_ascending","clicks_descending","clicks_ascending","spend_descending","spend_ascending","ctr_descending","ctr_ascending","cpm_descending","cpm_ascending","cpc_descending","cpc_ascending","revenue_descending","revenue_ascending","roas_descending","roas_ascending"]},"status":{"type":"array","items":{"type":"string","enum":["ACTIVE","PAUSED","DELETED","ARCHIVED"]}},"time_increment":{"anyOf":[{"type":"string","enum":["all_days","monthly"]},{"type":"number","minimum":1,"maximum":90}]},"skipCache":{"type":"boolean"},"skipWriteCache":{"type":"boolean"}},"required":["level","time_increment"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"result":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"adCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"adAgeDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"adUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"delivery":{"anyOf":[{"type":"string"},{"type":"null"}]},"effectiveStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"attributionSetting":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"objective":{"anyOf":[{"type":"string"},{"type":"null"}]},"optimizationGoal":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountName":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignId":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignName":{"anyOf":[{"type":"string"},{"type":"null"}]},"adSetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"adSetName":{"anyOf":[{"type":"string"},{"type":"null"}]},"adId":{"anyOf":[{"type":"string"},{"type":"null"}]},"adName":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateStop":{"anyOf":[{"type":"string"},{"type":"null"}]},"spend":{"anyOf":[{"type":"number"},{"type":"null"}]},"impressions":{"anyOf":[{"type":"number"},{"type":"null"}]},"reach":{"anyOf":[{"type":"number"},{"type":"null"}]},"frequency":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpc":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpm":{"anyOf":[{"type":"number"},{"type":"null"}]},"cpp":{"anyOf":[{"type":"number"},{"type":"null"}]},"revenue":{"anyOf":[{"type":"number"},{"type":"null"}]},"roas":{"anyOf":[{"type":"number"},{"type":"null"}]},"clicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"ctr":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUniqueClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"outboundClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"outboundCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerOutboundClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueOutboundClicks":{"anyOf":[{"type":"number"},{"type":"null"}]},"uniqueOutboundCtr":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUniqueOutboundClick":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversions":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerConversion":{"anyOf":[{"type":"number"},{"type":"null"}]},"conversionRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoPlays":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoPlay":{"anyOf":[{"type":"number"},{"type":"null"}]},"video3SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video3SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideo3SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video30SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"video30SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideo30SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP25Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP25WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP25Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP50Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP50WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP50Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP75Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP75WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP75Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP95Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP95WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP95Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP100Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoP100WatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoP100Watched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoContinuous2SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoContinuous2SecWatchedRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerVideoContinuous2SecWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoAvgTimeWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoTimeWatched":{"anyOf":[{"type":"number"},{"type":"null"}]},"videoPlayCurve":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"actions":{"default":[],"type":"array","items":{"type":"object","properties":{"costPer":{"anyOf":[{"type":"number"},{"type":"null"}]},"costPerUnique":{"anyOf":[{"type":"number"},{"type":"null"}]},"key":{"type":"string","minLength":1},"total":{"anyOf":[{"type":"number"},{"type":"null"}]},"unique":{"anyOf":[{"type":"number"},{"type":"null"}]},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The monetary value of the actions"}},"required":["costPer","costPerUnique","key","total","unique","value"],"additionalProperties":false}}},"required":["adCreatedAt","adAgeDays","adUpdatedAt","delivery","effectiveStatus","attributionSetting","accountCurrency","objective","optimizationGoal","accountId","accountName","campaignId","campaignName","adSetId","adSetName","adId","adName","dateStart","dateStop","spend","impressions","reach","frequency","cpc","cpm","cpp","revenue","roas","clicks","ctr","uniqueClicks","uniqueCtr","costPerUniqueClick","outboundClicks","outboundCtr","costPerOutboundClick","uniqueOutboundClicks","uniqueOutboundCtr","costPerUniqueOutboundClick","conversions","costPerConversion","conversionRate","videoPlays","costPerVideoPlay","video3SecWatched","video3SecWatchedRate","costPerVideo3SecWatched","video30SecWatched","video30SecWatchedRate","costPerVideo30SecWatched","videoP25Watched","videoP25WatchedRate","costPerVideoP25Watched","videoP50Watched","videoP50WatchedRate","costPerVideoP50Watched","videoP75Watched","videoP75WatchedRate","costPerVideoP75Watched","videoP95Watched","videoP95WatchedRate","costPerVideoP95Watched","videoP100Watched","videoP100WatchedRate","costPerVideoP100Watched","videoContinuous2SecWatched","videoContinuous2SecWatchedRate","costPerVideoContinuous2SecWatched","videoAvgTimeWatched","videoTimeWatched","videoPlayCurve","actions"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"previousCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","nextCursor","previousCursor"],"additionalProperties":false}},"required":["result"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/ads/preferences":{"get":{"operationId":"ads-getAdsPreferences","summary":"Get Ads Preferences","description":"Retrieves the saved ads preferences for the project including metrics, view mode, sort, and filters.","tags":["Ads"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"datePreset":{"default":"last_30d","type":"string","enum":["today","yesterday","this_month","last_month","this_quarter","maximum","data_maximum","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","last_week_mon_sun","last_week_sun_sat","last_quarter","last_year","this_week_mon_today","this_week_sun_today","this_year"]},"effectiveStatus":{"type":"array","items":{"type":"string","enum":["ACTIVE","PAUSED","DELETED","ARCHIVED"]}},"filters":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"fieldType":{"type":"string","enum":["string","number"]},"id":{"type":"string"},"operator":{"type":"string","enum":["is","is_not","contains","does_not_contain","greater_than","less_than"]},"value":{"anyOf":[{"type":"string"},{"type":"number"}]}},"required":["field","fieldType","id","operator","value"],"additionalProperties":false}},"groupBy":{"default":"ad","type":"string","enum":["ad","adset","campaign","account"]},"id":{"type":"string"},"metricPreferences":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"required":["category","id","name"],"additionalProperties":false}},"name":{"type":"string"},"sort":{"default":"spend","type":"string"},"updatedAt":{"type":"string"},"viewMode":{"type":"string","enum":["cards","table","chart"]}},"required":["createdAt","datePreset","filters","groupBy","id","metricPreferences","name","sort","updatedAt","viewMode"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"ads-setAdsPreferences","summary":"Update Ads Preferences","description":"Updates the saved ads preferences for the project including metrics, view mode, sort, and filters.","tags":["Ads"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adsPreferences":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"datePreset":{"default":"last_30d","type":"string","enum":["today","yesterday","this_month","last_month","this_quarter","maximum","data_maximum","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","last_week_mon_sun","last_week_sun_sat","last_quarter","last_year","this_week_mon_today","this_week_sun_today","this_year"]},"effectiveStatus":{"type":"array","items":{"type":"string","enum":["ACTIVE","PAUSED","DELETED","ARCHIVED"]}},"filters":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"fieldType":{"type":"string","enum":["string","number"]},"id":{"type":"string"},"operator":{"type":"string","enum":["is","is_not","contains","does_not_contain","greater_than","less_than"]},"value":{"anyOf":[{"type":"string"},{"type":"number"}]}},"required":["field","fieldType","id","operator","value"]}},"groupBy":{"default":"ad","type":"string","enum":["ad","adset","campaign","account"]},"id":{"type":"string"},"metricPreferences":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"required":["category","id","name"]}},"name":{"type":"string"},"sort":{"default":"spend","type":"string"},"updatedAt":{"type":"string"},"viewMode":{"type":"string","enum":["cards","table","chart"]}},"required":["createdAt","id","metricPreferences","name","updatedAt","viewMode"]}}},"required":["adsPreferences"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"datePreset":{"default":"last_30d","type":"string","enum":["today","yesterday","this_month","last_month","this_quarter","maximum","data_maximum","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","last_week_mon_sun","last_week_sun_sat","last_quarter","last_year","this_week_mon_today","this_week_sun_today","this_year"]},"effectiveStatus":{"type":"array","items":{"type":"string","enum":["ACTIVE","PAUSED","DELETED","ARCHIVED"]}},"filters":{"default":[],"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"fieldType":{"type":"string","enum":["string","number"]},"id":{"type":"string"},"operator":{"type":"string","enum":["is","is_not","contains","does_not_contain","greater_than","less_than"]},"value":{"anyOf":[{"type":"string"},{"type":"number"}]}},"required":["field","fieldType","id","operator","value"],"additionalProperties":false}},"groupBy":{"default":"ad","type":"string","enum":["ad","adset","campaign","account"]},"id":{"type":"string"},"metricPreferences":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"required":["category","id","name"],"additionalProperties":false}},"name":{"type":"string"},"sort":{"default":"spend","type":"string"},"updatedAt":{"type":"string"},"viewMode":{"type":"string","enum":["cards","table","chart"]}},"required":["createdAt","datePreset","filters","groupBy","id","metricPreferences","name","sort","updatedAt","viewMode"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/ads/search-library":{"post":{"operationId":"ads-searchMetaAdsLibrary","summary":"Search Ads Library","description":"Search for ads in the Facebook Ads Library with various filters and parameters. When applyQualityFilter is true, includes quality scoring data. Supports cursor-based pagination for infinite scroll.","tags":["Ads"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ad_reached_countries":{"minItems":1,"type":"array","items":{"type":"string"}},"ad_type":{"default":"ALL","type":"string","enum":["ALL","EMPLOYMENT_ADS","FINANCIAL_PRODUCTS_AND_SERVICES_ADS","HOUSING_ADS","POLITICAL_AND_ISSUE_ADS"]},"ad_active_status":{"default":"ALL","type":"string","enum":["ALL","ACTIVE","INACTIVE"]},"ad_delivery_date_min":{"type":"string"},"ad_delivery_date_max":{"type":"string"},"search_terms":{"type":"string"},"search_page_ids":{"type":"array","items":{"type":"string"}},"search_type":{"default":"KEYWORD_EXACT_PHRASE","type":"string","enum":["KEYWORD_UNORDERED","KEYWORD_EXACT_PHRASE"]},"publisher_platforms":{"type":"array","items":{"type":"string","enum":["FACEBOOK","INSTAGRAM","AUDIENCE_NETWORK","MESSENGER","WHATSAPP","OCULUS","THREADS"]}},"media_type":{"type":"string","enum":["ALL","IMAGE","VIDEO","MEME","NONE"]},"languages":{"type":"array","items":{"type":"string"}},"unmask_removed_content":{"default":false,"type":"boolean"},"limit":{"default":100,"type":"number","minimum":1,"maximum":5000},"after":{"type":"string"},"fields":{"type":"array","items":{"type":"string"}},"bylines":{"type":"array","items":{"type":"string"}},"delivery_by_region":{"type":"array","items":{"type":"string"}},"estimated_audience_size_min":{"type":"number"},"estimated_audience_size_max":{"type":"number"},"applyQualityFilter":{"default":true,"type":"boolean"},"cursor":{"type":"string"}},"required":["ad_reached_countries"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ad_creation_time":{"type":"string"},"ad_creative_bodies":{"type":"array","items":{"type":"string"}},"ad_creative_link_captions":{"type":"array","items":{"type":"string"}},"ad_creative_link_descriptions":{"type":"array","items":{"type":"string"}},"ad_creative_link_titles":{"type":"array","items":{"type":"string"}},"ad_delivery_start_time":{"type":"string"},"ad_delivery_stop_time":{"type":"string"},"ad_snapshot_url":{"type":"string"},"languages":{"type":"array","items":{"type":"string"}},"page_id":{"type":"string"},"page_name":{"type":"string"},"publisher_platforms":{"type":"array","items":{"type":"string"}},"total_reach_by_location":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"number"}},"required":["key","value"],"additionalProperties":false}},"bylines":{"type":"string"},"currency":{"type":"string"},"spend":{"type":"object","properties":{"lower_bound":{"type":"string"},"upper_bound":{"type":"string"}},"additionalProperties":false},"impressions":{"type":"object","properties":{"lower_bound":{"type":"string"},"upper_bound":{"type":"string"}},"additionalProperties":false},"estimated_audience_size":{"type":"object","properties":{"lower_bound":{"type":"number"},"upper_bound":{"type":"number"}},"additionalProperties":false},"delivery_by_region":{"type":"array","items":{"type":"object","properties":{"percentage":{"type":"string"},"region":{"type":"string"}},"required":["percentage","region"],"additionalProperties":false}},"demographic_distribution":{"type":"array","items":{"type":"object","properties":{"age":{"type":"string"},"gender":{"type":"string"},"percentage":{"type":"string"}},"required":["percentage"],"additionalProperties":false}},"beneficiary_payers":{"type":"array","items":{"type":"object","properties":{"beneficiary":{"type":"string"},"current":{"type":"boolean"},"payer":{"type":"string"}},"additionalProperties":false}},"eu_total_reach":{"type":"number"},"age_country_gender_reach_breakdown":{"type":"array","items":{"type":"object","properties":{"age_gender_breakdowns":{"type":"array","items":{"type":"object","properties":{"age_range":{"type":"string"},"female":{"type":"number"},"male":{"type":"number"},"unknown":{"type":"number"}},"required":["age_range"],"additionalProperties":false}},"country":{"type":"string"}},"required":["age_gender_breakdowns","country"],"additionalProperties":false}},"target_ages":{"type":"array","items":{"type":"string"}},"target_gender":{"type":"string"},"target_locations":{"type":"array","items":{"type":"object","properties":{"city":{"type":"string"},"country":{"type":"string"},"excluded":{"type":"boolean"},"name":{"type":"string"},"num_obfuscated":{"type":"number"},"region":{"type":"string"},"type":{"type":"string"}},"required":["name"],"additionalProperties":false}},"br_total_reach":{"type":"number"},"quality":{"type":"object","properties":{"filterReasons":{"type":"array","items":{"type":"string"}},"passedPrefilters":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string"}},"score":{"type":"number","minimum":0,"maximum":100}},"required":["filterReasons","passedPrefilters","reasons","score"],"additionalProperties":false},"snapshot":{"type":"object","properties":{"body":{"anyOf":[{},{"type":"null"}]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"cards":{"anyOf":[{"type":"array","items":{}},{"type":"null"}]},"cta_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"cta_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"current_page_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"display_format":{"anyOf":[{"type":"string"},{"type":"null"}]},"images":{"type":"array","items":{"type":"object","properties":{"original_image_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"resized_image_url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["original_image_url","resized_image_url"],"additionalProperties":false}},"link_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"page_categories":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}]},{"type":"null"}]},"page_entity_type":{"anyOf":[{"type":"string"},{"type":"null"}]},"page_id":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}]},"page_like_count":{"anyOf":[{"type":"number"},{"type":"null"}]},"page_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"page_profile_picture_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"page_profile_uri":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"videos":{"type":"array","items":{"type":"object","properties":{"video_hd_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"video_preview_image_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"video_sd_url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["video_hd_url","video_preview_image_url","video_sd_url"],"additionalProperties":false}}},"required":["body","caption","cards","cta_text","cta_type","current_page_name","display_format","link_url","page_categories","page_entity_type","page_id","page_like_count","page_name","page_profile_picture_url","page_profile_uri","title"],"additionalProperties":false}},"required":["id","quality","snapshot"],"additionalProperties":{}}},"paging":{"type":"object","properties":{"cursors":{"type":"object","properties":{"after":{"type":"string"},"before":{"type":"string"}},"additionalProperties":false},"next":{"type":"string"},"previous":{"type":"string"}},"additionalProperties":false}},"required":["data"],"additionalProperties":{}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/current-users":{"get":{"operationId":"analytics-currentUsers","summary":"Current Users","description":"Counts visitors seen in the last `minutes` minutes: the live-visitors number. Optional filters narrow the count to a segment (country, device, browser, UTM tags). Returns a single row holding the visit count.","tags":["Users"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to count visitors for."},"required":true,"description":"ID of the project to count visitors for."},{"in":"query","name":"minutes","schema":{"type":"number","description":"Size of the look-back window in minutes. A visitor counts as present if they were active within this many minutes of now."},"required":true,"description":"Size of the look-back window in minutes. A visitor counts as present if they were active within this many minutes of now."},{"in":"query","name":"location","schema":{"type":"string","description":"Only count visitors from this country name."}},{"in":"query","name":"device","schema":{"type":"string","description":"Only count visitors on this device type, e.g. `mobile`."}},{"in":"query","name":"browser","schema":{"type":"string","description":"Only count visitors on this browser, e.g. `Chrome`."}},{"in":"query","name":"referrer","schema":{"type":"string","description":"Only count visitors with this exact referrer URL."}},{"in":"query","name":"utmSource","schema":{"type":"string","description":"Only count visitors tagged with this `utm_source`."}},{"in":"query","name":"utmMedium","schema":{"type":"string","description":"Only count visitors tagged with this `utm_medium`."}},{"in":"query","name":"utmCampaign","schema":{"type":"string","description":"Only count visitors tagged with this `utm_campaign`."}},{"in":"query","name":"utmTerm","schema":{"type":"string","description":"Only count visitors tagged with this `utm_term`."}},{"in":"query","name":"utmContent","schema":{"type":"string","description":"Only count visitors tagged with this `utm_content`."}},{"in":"query","name":"utmAdId","schema":{"type":"string","description":"Only count visitors attributed to this ad ID."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rows":{"type":"number"},"statistics":{"type":"object","properties":{"bytes_read":{"type":"number"},"elapsed":{"type":"number"},"rows_read":{"type":"number"}},"required":["bytes_read","elapsed","rows_read"],"additionalProperties":false},"usage":{"type":"object","properties":{"cost":{"type":"number"},"duration":{"type":"number"},"metricCount":{"type":"number"}},"required":["cost"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"visits":{"type":"number"}},"required":["visits"],"additionalProperties":false}}},"required":["meta","rows","statistics","usage","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/user/{distinctId}":{"delete":{"operationId":"analytics-deleteUser","summary":"Delete User","description":"Erases a user's stored identify properties for GDPR-style deletion requests. Scope is narrow and worth noting: it clears the identify record only. Tracked events stay, and the CRM contact is untouched (use Delete Contact for that). The delete runs as an asynchronous job, so the user can still surface in queries for a short window after this returns 200.","tags":["Users"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project the user belongs to."},"required":true,"description":"ID of the project the user belongs to."},{"in":"path","name":"distinctId","schema":{"type":"string","description":"Distinct ID of the user whose analytics data to erase."},"required":true,"description":"Distinct ID of the user whose analytics data to erase."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"analytics-getUser","summary":"Get User","description":"Fetches the most recent identify record for one user, returning the full property bag last known for them: reserved fields like `email` and `name`, Saasco's `$`-prefixed system properties (geo, device, referrer, subscription state), and any custom properties you have sent.","tags":["Users"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project the user belongs to."},"required":true,"description":"ID of the project the user belongs to."},{"in":"path","name":"distinctId","schema":{"type":"string","description":"The user's distinct ID: the identifier passed to `identify()` in the SDK, or the generated anonymous ID if they were never identified."},"required":true,"description":"The user's distinct ID: the identifier passed to `identify()` in the SDK, or the generated anonymous ID if they were never identified."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"distinctId":{"type":"string"},"projectId":{"type":"string"},"timestamp":{"type":"string"}},"required":["distinctId","projectId","timestamp"],"additionalProperties":false},{"type":"object","properties":{"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["properties"],"additionalProperties":false}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/funnel-steps":{"post":{"operationId":"analytics-getFunnelSteps","summary":"Get Funnel Steps","description":"Runs a sequential funnel over the named events and returns the number of users reaching each step. Order is significant: a user counts at step N only if they fired steps 1 through N in the given order within the window. Users are counted by anonymous ID, so the same person on two devices counts twice.","tags":["Funnels"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to analyse."},"required":true,"description":"ID of the project to analyse."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dateFrom":{"description":"Start of the window as an ISO 8601 timestamp.","type":"string"},"dateTo":{"description":"End of the window as an ISO 8601 timestamp.","type":"string"},"eventNames":{"type":"array","items":{"type":"string"},"description":"Ordered list of event action names forming the funnel. Order matters: a user counts at step N only if they fired steps 1..N in this sequence."}},"required":["dateFrom","dateTo","eventNames"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rows":{"type":"number"},"statistics":{"type":"object","properties":{"bytes_read":{"type":"number"},"elapsed":{"type":"number"},"rows_read":{"type":"number"}},"required":["bytes_read","elapsed","rows_read"],"additionalProperties":false},"usage":{"type":"object","properties":{"cost":{"type":"number"},"duration":{"type":"number"},"metricCount":{"type":"number"}},"required":["cost"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"count":{"type":"number"},"step":{"type":"string"}},"required":["count","step"],"additionalProperties":false}}},"required":["meta","rows","statistics","usage","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/funnel-steps-by-day":{"post":{"operationId":"analytics-getFunnelStepsByDay","summary":"Get Funnel Steps By Day","description":"The same sequential funnel as Get Funnel Steps, but broken out per day so you can chart step conversion over time. Returns one row per step per day.","tags":["Funnels"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to analyse."},"required":true,"description":"ID of the project to analyse."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dateFrom":{"description":"Start of the window as an ISO 8601 timestamp.","type":"string"},"dateTo":{"description":"End of the window as an ISO 8601 timestamp.","type":"string"},"eventNames":{"type":"array","items":{"type":"string"},"description":"Ordered list of event action names forming the funnel. Order matters: a user counts at step N only if they fired steps 1..N in this sequence."}},"required":["dateFrom","dateTo","eventNames"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rows":{"type":"number"},"statistics":{"type":"object","properties":{"bytes_read":{"type":"number"},"elapsed":{"type":"number"},"rows_read":{"type":"number"}},"required":["bytes_read","elapsed","rows_read"],"additionalProperties":false},"usage":{"type":"object","properties":{"cost":{"type":"number"},"duration":{"type":"number"},"metricCount":{"type":"number"}},"required":["cost"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"count":{"type":"number"},"day":{"type":"string"},"step":{"type":"string"}},"required":["count","day","step"],"additionalProperties":false}}},"required":["meta","rows","statistics","usage","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/usage":{"get":{"operationId":"analytics-getUsage","summary":"Get Usage","description":"Returns metered spend for the project over a date window, broken down by day, app, and upstream service. This is the cost side of the ledger. See Get Balance Transactions for how that spend drew down the credit balance.","tags":["Usage"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to report usage for."},"required":true,"description":"ID of the project to report usage for."},{"in":"query","name":"dateFrom","schema":{"type":"string","description":"Start of the window as a `YYYY-MM-DD` date, inclusive and read in UTC."}},{"in":"query","name":"dateTo","schema":{"type":"string","description":"End of the window as a `YYYY-MM-DD` date, inclusive and read in UTC."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rows":{"type":"number"},"statistics":{"type":"object","properties":{"bytes_read":{"type":"number"},"elapsed":{"type":"number"},"rows_read":{"type":"number"}},"required":["bytes_read","elapsed","rows_read"],"additionalProperties":false},"usage":{"type":"object","properties":{"cost":{"type":"number"},"duration":{"type":"number"},"metricCount":{"type":"number"}},"required":["cost"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"app":{"type":"string"},"cost":{"type":"number"},"date":{"type":"string"},"service":{"type":"string"}},"required":["app","cost","date","service"],"additionalProperties":false}}},"required":["meta","rows","statistics","usage","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/latest-events":{"get":{"operationId":"analytics-latestEvents","summary":"Latest Events","description":"Returns the project's most recent events, newest first: the live activity feed. Each row carries the action, timestamp, page, referrer, and the visitor's device, browser, and country. Social-proof popup events are hidden unless you ask for them by `action`.","tags":["Events"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to read events from."},"required":true,"description":"ID of the project to read events from."},{"in":"query","name":"action","schema":{"type":"string","description":"Return only events with this action name. When omitted the feed excludes the `$notification_shown` and `$notification_clicked` social-proof events."}},{"in":"query","name":"distinctId","schema":{"type":"string","description":"Adds the `distinctId` column to each row. This selects a column rather than filtering. Any value turns it on, and it does not narrow results to one contact."}},{"in":"query","name":"limit","schema":{"type":"number","description":"Maximum number of events to return. Defaults to 50."}},{"in":"query","name":"payload","schema":{"type":"boolean","description":"Adds the raw event `payload` to each row. Like `distinctId`, this is a column toggle: sending `false` still turns it on."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rows":{"type":"number"},"statistics":{"type":"object","properties":{"bytes_read":{"type":"number"},"elapsed":{"type":"number"},"rows_read":{"type":"number"}},"required":["bytes_read","elapsed","rows_read"],"additionalProperties":false},"usage":{"type":"object","properties":{"cost":{"type":"number"},"duration":{"type":"number"},"metricCount":{"type":"number"}},"required":["cost"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"browser":{"type":"string"},"device":{"type":"string"},"distinctId":{"type":"string"},"href":{"type":"string"},"id":{"type":"string"},"location":{"type":"string"},"payload":{"type":"string"},"referrer":{"type":"string"},"timestamp":{"type":"string"},"unique":{"type":"boolean"}},"required":["action","browser","device","href","id","location","referrer","timestamp"],"additionalProperties":false}}},"required":["meta","rows","statistics","usage","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/latest-identifies":{"post":{"operationId":"analytics-latestIdentifies","summary":"Latest Identifies","description":"Returns the property bags of the 5 most recently seen identified users. Intended as a sample for previewing what identify data is arriving. For a full list use List Users, and for one specific user use Get User.","tags":["Users"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to read identifies from."},"required":true,"description":"ID of the project to read identifies from."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"string"},"description":"Return only these property names, e.g. `[\"email\", \"name\"]`. Omit for every stored property."},"limit":{"type":"number","description":"Accepted but not applied. The underlying query is fixed to the 5 most recently seen contacts."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rows":{"type":"number"},"statistics":{"type":"object","properties":{"bytes_read":{"type":"number"},"elapsed":{"type":"number"},"rows_read":{"type":"number"}},"required":["bytes_read","elapsed","rows_read"],"additionalProperties":false},"usage":{"type":"object","properties":{"cost":{"type":"number"},"duration":{"type":"number"},"metricCount":{"type":"number"}},"required":["cost"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["properties"],"additionalProperties":false}}},"required":["meta","rows","statistics","usage","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/users":{"get":{"operationId":"analytics-listUsers","summary":"List Users","description":"Lists identified users for the project, most recently seen first, each with their full property bag. Only users who have been through an `identify()` call appear here. Anonymous visitors are counted by Current Users and Query Sessions but have no record to list.","tags":["Users"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to list users from."},"required":true,"description":"ID of the project to list users from."},{"in":"query","name":"limit","schema":{"type":"number","description":"Maximum number of users to return. Defaults to 100."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"type":"object","properties":{"distinctId":{"type":"string"},"projectId":{"type":"string"},"timestamp":{"type":"string"}},"required":["distinctId","projectId","timestamp"],"additionalProperties":false},{"type":"object","properties":{"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["properties"],"additionalProperties":false}]}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/query-events":{"post":{"operationId":"analytics-queryEvents","summary":"Query Events","description":"The general-purpose event reporting query. Pick a dimension to group by, the metrics to compute (`users`, `sessions`, `events`), and any filters, and it returns one aggregated row per group: a time series with `groupBy: \"date\"`, a top-pages table with `groupBy: \"pathname\"`, and so on. Dates are read in the project's configured timezone.","tags":["Events"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to query."},"required":true,"description":"ID of the project to query."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupBy":{"type":"string","enum":["projectId","date","hour","action","href","pathname","referrer","referringDomain","device","browser","location","utmSource","utmMedium","utmCampaign","utmTerm","utmContent","utmAdId"],"description":"Dimension to aggregate by. One row comes back per distinct value. Use `date` or `hour` for a time series."},"subGroupBy":{"type":"string","enum":["projectId","date","hour","action","href","pathname","referrer","referringDomain","device","browser","location","utmSource","utmMedium","utmCampaign","utmTerm","utmContent","utmAdId"],"description":"Optional second dimension, giving one row per `groupBy` × `subGroupBy` pair."},"metrics":{"type":"array","items":{"type":"string","enum":["users","sessions","events"]},"description":"Metrics to compute for each row. At least one is required."},"dateFrom":{"type":"string","description":"Start of the window as a `YYYY-MM-DD` date, inclusive. Interpreted in the project's configured timezone."},"dateTo":{"type":"string","description":"End of the window as a `YYYY-MM-DD` date, inclusive. Interpreted in the project's configured timezone."},"location":{"type":"string","description":"Only include events from this country name."},"device":{"type":"string","description":"Only include events from this device type, e.g. `mobile`."},"browser":{"type":"string","description":"Only include events from this browser, e.g. `Chrome`."},"referrer":{"type":"string","description":"Only include events with this exact referrer URL."},"referringDomain":{"type":"string","description":"Only include events from this referring domain."},"action":{"type":"string","description":"Only include events with this action name, e.g. `Page View`."},"utmSource":{"type":"string","description":"Only include events tagged with this `utm_source`."},"utmMedium":{"type":"string","description":"Only include events tagged with this `utm_medium`."},"utmCampaign":{"type":"string","description":"Only include events tagged with this `utm_campaign`."},"utmTerm":{"type":"string","description":"Only include events tagged with this `utm_term`."},"utmContent":{"type":"string","description":"Only include events tagged with this `utm_content`."},"utmAdId":{"type":"string","description":"Only include events attributed to this ad ID."},"pathname":{"type":"string","description":"Only include events on this path, e.g. `/pricing`."},"href":{"type":"string","description":"Only include events on this full URL."},"orderBy":{"type":"string","description":"Column to sort by: either `groupBy` or one of the requested `metrics`."},"orderDir":{"type":"string","enum":["ASC","DESC"],"description":"Sort direction. Ignored unless `orderBy` is set."},"skip":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of rows to skip before collecting results."},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Maximum number of rows to return."}},"required":["groupBy","metrics"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rows":{"type":"number"},"statistics":{"type":"object","properties":{"bytes_read":{"type":"number"},"elapsed":{"type":"number"},"rows_read":{"type":"number"}},"required":["bytes_read","elapsed","rows_read"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"events":{"type":"number"},"groupBy":{"type":"string"},"sessions":{"type":"number"},"subGroupBy":{"type":"string"},"users":{"type":"number"}},"required":["groupBy"],"additionalProperties":false}},"rows_before_limit_at_least":{"type":"number"}},"required":["meta","rows","statistics","data","rows_before_limit_at_least"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/query-sessions":{"post":{"operationId":"analytics-querySessions","summary":"Query Sessions","description":"The session-level counterpart to Query Events, grouping visits rather than individual events. Adds session-only metrics (`pageViews`, `bounceRate`, `avgSessionSec`) that cannot be derived from the event stream. Use this for traffic and engagement reporting, and Query Events for anything keyed on a specific action.","tags":["Sessions"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to query."},"required":true,"description":"ID of the project to query."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupBy":{"type":"string","enum":["projectId","date","hour","pathname","referringDomain","device","browser","location","utmSource","utmMedium","utmCampaign","utmTerm","utmContent","utmAdId"],"description":"Dimension to aggregate by. One row comes back per distinct value. Use `date` or `hour` for a time series."},"subGroupBy":{"type":"string","enum":["projectId","date","hour","pathname","referringDomain","device","browser","location","utmSource","utmMedium","utmCampaign","utmTerm","utmContent","utmAdId"],"description":"Optional second dimension, giving one row per `groupBy` × `subGroupBy` pair."},"metrics":{"type":"array","items":{"type":"string","enum":["users","sessions","pageViews","events","bounceRate","avgSessionSec"]},"description":"Metrics to compute for each row. At least one is required."},"dateFrom":{"type":"string","description":"Start of the window as a `YYYY-MM-DD` date, inclusive. Interpreted in the project's configured timezone."},"dateTo":{"type":"string","description":"End of the window as a `YYYY-MM-DD` date, inclusive. Interpreted in the project's configured timezone."},"location":{"type":"string","description":"Only include sessions from this country name."},"device":{"type":"string","description":"Only include sessions from this device type, e.g. `mobile`."},"browser":{"type":"string","description":"Only include sessions from this browser, e.g. `Chrome`."},"referringDomain":{"type":"string","description":"Only include sessions from this referring domain."},"utmSource":{"type":"string","description":"Only include sessions tagged with this `utm_source`."},"utmMedium":{"type":"string","description":"Only include sessions tagged with this `utm_medium`."},"utmCampaign":{"type":"string","description":"Only include sessions tagged with this `utm_campaign`."},"utmTerm":{"type":"string","description":"Only include sessions tagged with this `utm_term`."},"utmContent":{"type":"string","description":"Only include sessions tagged with this `utm_content`."},"utmAdId":{"type":"string","description":"Only include sessions attributed to this ad ID."},"orderBy":{"type":"string","description":"Column to sort by: either `groupBy` or one of the requested `metrics`."},"orderDir":{"type":"string","enum":["ASC","DESC"],"description":"Sort direction. Ignored unless `orderBy` is set."},"skip":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of rows to skip before collecting results."},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Maximum number of rows to return."}},"required":["groupBy","metrics"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rows":{"type":"number"},"statistics":{"type":"object","properties":{"bytes_read":{"type":"number"},"elapsed":{"type":"number"},"rows_read":{"type":"number"}},"required":["bytes_read","elapsed","rows_read"],"additionalProperties":false},"usage":{"type":"object","properties":{"cost":{"type":"number"},"duration":{"type":"number"},"metricCount":{"type":"number"}},"required":["cost"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"avgSessionSec":{"type":"number"},"bounceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"events":{"type":"number"},"groupBy":{"type":"string"},"pageViews":{"type":"number"},"sessions":{"type":"number"},"subGroupBy":{"type":"string"},"users":{"type":"number"}},"required":["groupBy"],"additionalProperties":false}}},"required":["meta","rows","statistics","usage","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/analytics/user-events":{"get":{"operationId":"analytics-userEvents","summary":"User Events","description":"Returns one user's event history, newest first: the activity timeline for a single person. Events fired before they were identified are stitched in by anonymous ID, so the timeline reaches back past the `identify()` call. Social-proof popup events are excluded. Page through it with `cursor`, which is a row offset: pass the number of rows already received to get the next batch.","tags":["Events"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to read analytics from."},"required":true,"description":"ID of the project to read analytics from."},{"in":"query","name":"browser","schema":{"type":"string","description":"Only count activity from this browser, e.g. `Chrome`."}},{"in":"query","name":"dateFrom","schema":{"type":"string","description":"Start of the window as a `YYYY-MM-DD` date, inclusive."}},{"in":"query","name":"dateTo","schema":{"type":"string","description":"End of the window as a `YYYY-MM-DD` date, inclusive."}},{"in":"query","name":"device","schema":{"type":"string","description":"Only count activity from this device type, e.g. `mobile`."}},{"in":"query","name":"limit","schema":{"type":"number","description":"Maximum number of rows to return."}},{"in":"query","name":"location","schema":{"type":"string","description":"Only count activity from this country name."}},{"in":"query","name":"referrer","schema":{"type":"string","description":"Only count activity with this exact referrer URL."}},{"in":"query","name":"referringDomain","schema":{"type":"string","description":"Only count activity from this referring domain, e.g. `google.com`."}},{"in":"query","name":"skip","schema":{"type":"number","description":"Number of rows to skip before collecting results."}},{"in":"query","name":"utmMedium","schema":{"type":"string","description":"Only count activity tagged with this `utm_medium`."}},{"in":"query","name":"cursor","schema":{"type":"number","description":"Row offset to start from. Defaults to 0; pass the number of rows already received to fetch the next page."}},{"in":"query","name":"daysAgo","schema":{"type":"number","description":"Only return events from the last this-many days. Defaults to 30."}},{"in":"query","name":"distinctId","schema":{"type":"string","description":"Distinct ID of the user whose events to return."},"required":true,"description":"Distinct ID of the user whose events to return."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}},"rows":{"type":"number"},"statistics":{"type":"object","properties":{"bytes_read":{"type":"number"},"elapsed":{"type":"number"},"rows_read":{"type":"number"}},"required":["bytes_read","elapsed","rows_read"],"additionalProperties":false},"usage":{"type":"object","properties":{"cost":{"type":"number"},"duration":{"type":"number"},"metricCount":{"type":"number"}},"required":["cost"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"anonymousId":{"type":"string"},"context":{"anyOf":[{"type":"string"},{"type":"null"}]},"distinctId":{"anyOf":[{"type":"string"},{"type":"null"}]},"payload":{"type":"string"},"projectId":{"type":"string"},"sessionId":{"type":"string"},"source":{"default":"unknown","anyOf":[{"type":"string","enum":["client","server","unknown"]},{"type":"null"}]},"version":{"type":"string"},"id":{"type":"string"},"timestamp":{"type":"string"}},"required":["action","anonymousId","payload","projectId","sessionId","source","version","id","timestamp"],"additionalProperties":false}}},"required":["meta","rows","statistics","usage","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contacts":{"post":{"operationId":"crm-upsertContact","summary":"Upsert Contact","description":"Creates a contact, or updates it if one already exists with the same distinct ID. Properties are merged rather than replaced, so omitting a property leaves its current value alone. Send an explicit null to clear one. Omitting `distinctId` generates one with a `soft_` prefix, which is what you want for a contact you only know by email. A new hard distinct ID whose email is already on another contact creates a second, related contact rather than failing.","tags":["Contacts"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"distinctId":{"type":"string","description":"A database level unique identifier for the contact. If not provided, one will be automatically generated with a soft_ prefix."},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean","description":"Marks the contact for deletion instead of writing properties. Prefer the Delete Contact endpoint."},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$subscribed":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}},"anonymousId":{"type":"string","description":"Anonymous ID of the browser session this write came from, used to stitch pre-identify events to the contact. Generated when omitted."}},"required":["properties"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contacts/{distinctId}":{"get":{"operationId":"crm-getContact","summary":"Get Contact","description":"Fetches a single contact by distinct ID, including its merged property bag. Returns 404 if no contact matches.","tags":["Contacts"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."},{"in":"path","name":"distinctId","schema":{"type":"string","description":"Distinct ID of the contact to fetch."},"required":true,"description":"Distinct ID of the contact to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contacts/{distinctId}/related":{"get":{"operationId":"crm-listRelatedContacts","summary":"List Related","description":"Lists the other contacts sharing this contact's email address. An address can be held by more than one contact — most often because the same person was identified under two IDs, for example after the customer migrated auth providers — and they are surfaced as related rather than merged. Returns an empty list when the contact has no email or no siblings.","tags":["Contacts"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."},{"in":"path","name":"distinctId","schema":{"type":"string","description":"Distinct ID of the contact whose siblings to list."},"required":true,"description":"Distinct ID of the contact whose siblings to list."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contacts/properties":{"post":{"operationId":"crm-getContactProperties","summary":"Get Properties","description":"Returns just a contact's property bag, without the surrounding contact record. Naming specific `attributes` keeps the response small when you only need a few values from a contact with many properties.","tags":["Contacts"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"attributes":{"type":"array","items":{"type":"string"},"description":"Property names to return, e.g. `[\"email\", \"$country\"]`. Omit for every stored property."},"distinctId":{"type":"string","description":"Distinct ID of the contact whose properties to read."}},"required":["distinctId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contacts/by-email/{email}":{"get":{"operationId":"crm-getContactByEmail","summary":"Get By Email","description":"Looks a contact up by email address rather than distinct ID, the usual entry point when all you have is an email from a form or webhook. When more than one contact holds the address, returns the primary: a hard distinct ID over a `soft_` placeholder, then the most recently updated. Returns 404 if no contact matches.","tags":["Contacts"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."},{"in":"path","name":"email","schema":{"type":"string","description":"Email address to look up."},"required":true,"description":"Email address to look up."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contacts/query":{"post":{"operationId":"crm-listContacts","summary":"List Contacts","description":"Queries contacts with attribute and event filters, returning a page of contacts plus the total `count` matching the filter. A POST because the filter structure is too rich for a query string. This is the endpoint behind audience building. The same filter shape defines a dynamic contact list or a campaign audience.","tags":["Contacts"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to list contacts from."},"required":true,"description":"ID of the project to list contacts from."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"attributes":{"type":"array","items":{"type":"string"},"description":"Property names to include on each contact. Omit for the default set. Narrowing this is the main lever for making large queries cheaper."},"contactIds":{"type":"array","items":{"type":"string"},"description":"Restrict the result to these contact IDs."},"contactsFilterGroup":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","operator","value"]},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"]}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"description":"Attribute and event conditions the contact must satisfy. Omit to match every contact in the project."},"orderBy":{"type":"string","description":"Contact property to sort by, e.g. `$lastSeen` or `email`."},"orderDirection":{"type":"string","enum":["asc","desc"],"description":"Sort direction. Ignored unless `orderBy` is set."},"skip":{"default":0,"description":"Number of contacts to skip before collecting results. Deep offsets get progressively slower, so prefer narrowing the filter over paging far into a large audience.","type":"number"},"take":{"default":24,"description":"Maximum number of contacts to return.","type":"number"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"],"additionalProperties":false}},"usage":{"type":"object","properties":{"cost":{"type":"number"},"duration":{"type":"number"},"metricCount":{"type":"number"}},"required":["cost"],"additionalProperties":false}},"required":["count","data","usage"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contacts/{contactDistinctId}":{"patch":{"operationId":"crm-updateContact","summary":"Update Contact","description":"Updates a contact's properties. Properties are merged, so omitted ones keep their current values. Functionally the same as Upsert Contact for a contact that already exists; use this when you want the call to be explicitly an update.","tags":["Contacts"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."},{"in":"path","name":"contactDistinctId","schema":{"type":"string","description":"Distinct ID of the contact to update."},"required":true,"description":"Distinct ID of the contact to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean","description":"Marks the contact for deletion instead of writing properties. Prefer the Delete Contact endpoint."},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$subscribed":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}},"anonymousId":{"type":"string","description":"Anonymous ID of the browser session this write came from, used to stitch pre-identify events to the contact. Generated when omitted."}},"required":["properties"],"description":"Fields to change. Properties are merged rather than replaced, so omitted properties keep their current values."}},"required":["changes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"crm-deleteContact","summary":"Delete Contact","description":"Deletes a contact. The removal is processed asynchronously and can take up to 15 minutes; in the meantime the contact stays queryable with the system property `$_toDelete` set to true, which is how you can tell a deletion is pending rather than lost. Cannot be undone.","tags":["Contacts"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."},{"in":"path","name":"contactDistinctId","schema":{"type":"string","description":"Distinct ID of the contact to delete."},"required":true,"description":"Distinct ID of the contact to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/attributes":{"get":{"operationId":"crm-listAttributes","summary":"List Attributes","description":"Lists the contact attributes defined in this project: the property names available to filter and segment on, with their inferred types. Custom attributes appear once a contact has been written with that property; set `includeSystemAttributes` to also get Saasco's built-in `$`-prefixed ones.","tags":["Attributes"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to list attributes from."},"required":true,"description":"ID of the project to list attributes from."},{"in":"query","name":"includeSystemAttributes","schema":{"type":"boolean","description":"Also return Saasco's built-in `$`-prefixed attributes (geo, device, subscription state) alongside your own custom ones."}},{"in":"query","name":"skip","schema":{"default":0,"description":"Number of attributes to skip before collecting results.","type":"number"}},{"in":"query","name":"take","schema":{"default":24,"description":"Maximum number of attributes to return.","type":"number"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"totalCount":{"type":"number"},"type":{"type":"string","enum":["string","number","boolean","date","url","email"]},"uniqueCount":{"type":"number"}},"required":["id","projectId","totalCount","type","uniqueCount"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/attributes/{attributeDistinctId}":{"delete":{"operationId":"crm-deleteAttribute","summary":"Delete Attribute","description":"Removes an attribute from every contact in the project, deleting that property's stored values. Runs as a background job. The response contains job handles rather than a finished result, so the attribute keeps appearing in queries until the job completes. Anything filtering on it, such as a dynamic list, will stop matching. Cannot be undone.","tags":["Attributes"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the attribute."},"required":true,"description":"ID of the project that owns the attribute."},{"in":"path","name":"attributeDistinctId","schema":{"type":"string","description":"Distinct ID of the attribute to delete."},"required":true,"description":"Distinct ID of the attribute to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"delete_id":{"type":"string"},"id":{"type":"string"},"import_id":{"type":"string"},"job":{"type":"object","properties":{"created_at":{"type":"string"},"datasource":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"delete_condition":{"type":"string"},"id":{"type":"string"},"is_cancellable":{"type":"boolean"},"job_id":{"type":"string"},"kind":{"type":"string"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"updated_at":{"type":"string"}},"required":["created_at","datasource","id","is_cancellable","job_id","kind","started_at","status","updated_at"],"additionalProperties":false},"job_id":{"type":"string"},"job_url":{"type":"string","format":"uri"},"status":{"type":"string"}},"required":["id","job","job_id","job_url","status"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/attributes/bulk-delete":{"post":{"operationId":"crm-deleteAttributes","summary":"Delete Attributes","description":"The bulk form of Delete Attribute, removing several attributes from every contact in one call. Same asynchronous behaviour: one background job per attribute, returned as job handles. Cannot be undone.","tags":["Attributes"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the attributes."},"required":true,"description":"ID of the project that owns the attributes."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"attributeDistinctIds":{"type":"array","items":{"type":"string"},"description":"Distinct IDs of the attributes to delete."}},"required":["attributeDistinctIds"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"delete_id":{"type":"string"},"id":{"type":"string"},"import_id":{"type":"string"},"job":{"type":"object","properties":{"created_at":{"type":"string"},"datasource":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"delete_condition":{"type":"string"},"id":{"type":"string"},"is_cancellable":{"type":"boolean"},"job_id":{"type":"string"},"kind":{"type":"string"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"updated_at":{"type":"string"}},"required":["created_at","datasource","id","is_cancellable","job_id","kind","started_at","status","updated_at"],"additionalProperties":false},"job_id":{"type":"string"},"job_url":{"type":"string","format":"uri"},"status":{"type":"string"}},"required":["id","job","job_id","job_url","status"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/notification-types":{"get":{"operationId":"crm-listNotificationTypes","summary":"List Types","description":"Lists the notification types a project has defined: the named categories, such as product updates or billing alerts, that contacts can subscribe to independently. Public and unauthenticated so a preference centre can render the available options before the contact is identified.","tags":["Notifications"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to list attributes from."},"required":true,"description":"ID of the project to list attributes from."},{"in":"query","name":"includeSystemAttributes","schema":{"type":"boolean","description":"Also return Saasco's built-in `$`-prefixed attributes (geo, device, subscription state) alongside your own custom ones."}},{"in":"query","name":"skip","schema":{"default":0,"description":"Number of attributes to skip before collecting results.","type":"number"}},{"in":"query","name":"take","schema":{"default":24,"description":"Maximum number of attributes to return.","type":"number"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","name","projectId"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"crm-createNotificationType","summary":"Create Type","description":"Creates a notification type: a subscription category contacts can opt in and out of separately from the project-wide subscribe flag.","tags":["Notifications"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the notification type."},"required":true,"description":"ID of the project that owns the notification type."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","name","projectId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/notification-types/{notificationTypeId}":{"put":{"operationId":"crm-updateNotificationType","summary":"Update Type","description":"Updates a notification type's name or description. Existing contact preferences for it are preserved.","tags":["Notifications"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the notification type."},"required":true,"description":"ID of the project that owns the notification type."},{"in":"path","name":"notificationTypeId","schema":{"type":"string","description":"ID of the notification type to update."},"required":true,"description":"ID of the notification type to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","properties":{"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name"],"description":"Fields to change on the notification type."}},"required":["changes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","name","projectId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"crm-deleteNotificationType","summary":"Delete Type","description":"Deletes a notification type along with every contact preference recorded against it. Contacts who had opted out of this category lose that record, so recreating the type later starts everyone from the default. Returns `false` instead of an error status if the delete fails. Cannot be undone.","tags":["Notifications"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the notification type."},"required":true,"description":"ID of the project that owns the notification type."},{"in":"path","name":"notificationTypeId","schema":{"type":"string","description":"ID of the notification type to delete."},"required":true,"description":"ID of the notification type to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"boolean"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contact-notification-preferences/subscribe-status":{"get":{"operationId":"crm-subscribeStatus","summary":"Subscribe Status","description":"Reports whether a contact is subscribed at the project level: the master switch that overrides every per-type preference. Public and unauthenticated so an unsubscribe page can show current state before the contact acts.","tags":["Notifications"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."},{"in":"query","name":"contactDistinctId","schema":{"type":"string","description":"Distinct ID of the contact. Pass the encrypted form and set `encrypted` when calling from an emailed link."},"required":true,"description":"Distinct ID of the contact. Pass the encrypted form and set `encrypted` when calling from an emailed link."},{"in":"query","name":"encrypted","schema":{"type":"boolean","description":"Set when `contactDistinctId` is the encrypted value from an emailed link, so the server decrypts it before the lookup."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"subscribed":{"type":"boolean"}},"required":["subscribed"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"crm-updateSubscribeStatus","summary":"Update Subscribe Status","description":"Subscribes or unsubscribes a contact at the project level: the master switch that overrides every per-type preference, and what an unsubscribe link should call. Unsubscribing records the reason as `manual`. Pass `encrypted: true` with the token from an emailed link to apply the change to every contact sharing that address. A raw distinct ID only updates that one contact. Note this endpoint does not verify the contact exists; it writes the properties either way.","tags":["Notifications"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactDistinctId":{"type":"string","description":"Distinct ID of the contact. Pass the encrypted form and set `encrypted` when calling from an emailed link."},"encrypted":{"type":"boolean","description":"Set when `contactDistinctId` is the encrypted value from an emailed link, so the server decrypts it before writing."},"subscribed":{"type":"boolean","description":"`true` to subscribe the contact, `false` to unsubscribe them from all email."}},"required":["contactDistinctId","subscribed"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"subscribed":{"type":"boolean"}},"required":["subscribed"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contact-notification-preferences/{notificationTypeId}":{"post":{"operationId":"crm-updateContactNotificationPreference","summary":"Update Preference","description":"Sets whether a contact is subscribed to one notification type, creating the preference if it does not exist yet and updating it otherwise. Public and unauthenticated so it can back an emailed preference-centre link: pass the encrypted contact ID from that link together with `encrypted: true` rather than exposing raw distinct IDs in a URL. Returns 404 if the contact does not exist.","tags":["Notifications"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."},{"in":"path","name":"notificationTypeId","schema":{"type":"string","description":"ID of the notification type this preference applies to."},"required":true,"description":"ID of the notification type this preference applies to."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactDistinctId":{"type":"string"},"subscribed":{"type":"boolean"},"encrypted":{"type":"boolean","description":"Set when `contactDistinctId` is the encrypted value from a preference-centre link, so the server decrypts it before the lookup."}},"required":["contactDistinctId","subscribed"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"contactDistinctId":{"type":"string"},"notificationTypeId":{"type":"string"},"subscribed":{"type":"boolean"}},"required":["id","createdAt","updatedAt","projectId","contactDistinctId","notificationTypeId","subscribed"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contact-notification-preferences":{"get":{"operationId":"crm-listContactNotificationPreferences","summary":"List Preferences","description":"Lists one contact's per-type subscription preferences, for rendering a preference centre. Only types the contact has an explicit preference for are returned. Pair this with List Types to show categories they have never chosen. Public and unauthenticated; use `encrypted` when the contact ID comes from an emailed link. Returns 404 if the contact does not exist.","tags":["Notifications"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."},{"in":"query","name":"contactDistinctId","schema":{"type":"string","description":"Distinct ID of the contact whose preferences to list. Pass the encrypted form and set `encrypted` when calling from a public unsubscribe page."},"required":true,"description":"Distinct ID of the contact whose preferences to list. Pass the encrypted form and set `encrypted` when calling from a public unsubscribe page."},{"in":"query","name":"notificationTypeId","schema":{"type":"string","description":"Only return the preference for this notification type."}},{"in":"query","name":"skip","schema":{"default":0,"description":"Number of preferences to skip before collecting results.","type":"number"}},{"in":"query","name":"take","schema":{"default":24,"description":"Maximum number of preferences to return.","type":"number"}},{"in":"query","name":"encrypted","schema":{"type":"boolean","description":"Set when `contactDistinctId` is the encrypted value from a preference-centre link, so the server decrypts it before the lookup."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"contactDistinctId":{"type":"string"},"notificationTypeId":{"type":"string"},"subscribed":{"type":"boolean"}},"required":["id","createdAt","updatedAt","projectId","contactDistinctId","notificationTypeId","subscribed"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contact-lists":{"post":{"operationId":"crm-createContactList","summary":"Create List","description":"Creates a contact list. A `static` list holds the members you add explicitly; a `dynamic` list stores a filter and recomputes its members on read, so contacts join and leave automatically as their properties change. Set `contactsFilterGroups` for a dynamic list.","tags":["Lists"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that will own the list."},"required":true,"description":"ID of the project that will own the list."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"default":"static","type":"string","enum":["static","dynamic"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","operator","value"]},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"]}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"]}}},"required":["name","contactsFilterGroups"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"default":"static","type":"string","enum":["static","dynamic"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","name","type","contactsFilterGroups","projectId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"crm-listContactLists","summary":"List All","description":"Lists a project's contact lists with a total `count`. Narrow to one kind with `type`, or pass `contactId` to find the lists a particular contact belongs to.","tags":["Lists"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to list contact lists from."},"required":true,"description":"ID of the project to list contact lists from."},{"in":"query","name":"contactId","schema":{"type":"string","description":"Only return lists that this contact is a member of."}},{"in":"query","name":"orderBy","schema":{"type":"string","enum":["name","createdAt","updatedAt"],"description":"Field to sort by."}},{"in":"query","name":"orderDirection","schema":{"type":"string","enum":["asc","desc"],"description":"Sort direction. Ignored unless `orderBy` is set."}},{"in":"query","name":"skip","schema":{"default":0,"description":"Number of lists to skip before collecting results.","type":"number"}},{"in":"query","name":"take","schema":{"default":24,"description":"Maximum number of lists to return.","type":"number"}},{"in":"query","name":"type","schema":{"type":"string","enum":["static","dynamic"],"description":"Only return lists of this kind: `static` for a fixed set of members you manage explicitly, `dynamic` for a saved filter whose membership is recomputed on read."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"default":"static","type":"string","enum":["static","dynamic"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","name","type","contactsFilterGroups","projectId"],"additionalProperties":false}}},"required":["count","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contact-lists/{contactListId}":{"get":{"operationId":"crm-getContactList","summary":"Get List","description":"Fetches a single contact list with its configuration, including the filter definition for a dynamic list. Members are not included. Use List Members for those.","tags":["Lists"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the list."},"required":true,"description":"ID of the project that owns the list."},{"in":"path","name":"contactListId","schema":{"type":"string","description":"ID of the contact list to fetch."},"required":true,"description":"ID of the contact list to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"default":"static","type":"string","enum":["static","dynamic"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","name","type","contactsFilterGroups","projectId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"crm-updateContactList","summary":"Update List","description":"Updates a contact list's name, description, type, or filter. Only the fields present in `changes` are written. Editing the filter on a dynamic list changes who is in it immediately, since membership is evaluated on read.","tags":["Lists"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the list."},"required":true,"description":"ID of the project that owns the list."},{"in":"path","name":"contactListId","schema":{"type":"string","description":"ID of the contact list to update."},"required":true,"description":"ID of the contact list to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","properties":{"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","operator","value"]},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"]}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"]}},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"type":{"type":"string","enum":["static","dynamic"]}},"description":"Fields to change. Anything omitted is left as-is."}},"required":["changes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"default":"static","type":"string","enum":["static","dynamic"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","name","type","contactsFilterGroups","projectId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"crm-deleteContactList","summary":"Delete List","description":"Deletes a contact list. The contacts themselves are untouched. Only the list and its membership records go. Any campaign still targeting this list loses its audience. Cannot be undone.","tags":["Lists"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the list."},"required":true,"description":"ID of the project that owns the list."},{"in":"path","name":"contactListId","schema":{"type":"string","description":"ID of the contact list to delete."},"required":true,"description":"ID of the contact list to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"default":"static","type":"string","enum":["static","dynamic"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","name","type","contactsFilterGroups","projectId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contact-lists/{contactListId}/members":{"post":{"operationId":"crm-createContactListMember","summary":"Add to List","description":"Adds a contact to a static list. Dynamic lists derive their members from a filter, so adding to one has no lasting effect. Change the list's filter instead.","tags":["List Members"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the list."},"required":true,"description":"ID of the project that owns the list."},{"in":"path","name":"contactListId","schema":{"type":"string","description":"ID of the contact list to add the contact to."},"required":true,"description":"ID of the contact list to add the contact to."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactDistinctId":{"type":"string"}},"required":["contactDistinctId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"contactListId":{"type":"string"},"contactDistinctId":{"type":"string"}},"required":["id","createdAt","updatedAt","projectId","contactListId","contactDistinctId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"crm-listContactListMembers","summary":"List Members","description":"Lists the contacts in a list, with a total `count`. Works for both list kinds. A dynamic list's membership is computed from its filter at read time. Use Query List Members instead when you need extra filtering or to choose which properties come back.","tags":["List Members"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the list."},"required":true,"description":"ID of the project that owns the list."},{"in":"path","name":"contactListId","schema":{"type":"string","description":"ID of the contact list to read."},"required":true,"description":"ID of the contact list to read."},{"in":"query","name":"contactDistinctId","schema":{"type":"string","description":"Only return the membership for this contact."}},{"in":"query","name":"orderBy","schema":{"type":"string","enum":["name","createdAt","updatedAt"],"description":"Field to sort by."}},{"in":"query","name":"orderDirection","schema":{"type":"string","enum":["asc","desc"],"description":"Sort direction. Ignored unless `orderBy` is set."}},{"in":"query","name":"skip","schema":{"default":0,"description":"Number of members to skip before collecting results.","type":"number"}},{"in":"query","name":"take","schema":{"default":24,"description":"Maximum number of members to return.","type":"number"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"],"additionalProperties":false}}},"required":["count","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"crm-deleteContactListMember","summary":"Remove from List","description":"Removes a contact from a static list, identified by the contact's distinct ID. The contact itself is not deleted. Returns `null` if they were not in the list. Has no lasting effect on a dynamic list, whose membership comes from its filter.","tags":["List Members"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the list."},"required":true,"description":"ID of the project that owns the list."},{"in":"path","name":"contactListId","schema":{"type":"string","description":"ID of the contact list to remove them from."},"required":true,"description":"ID of the contact list to remove them from."},{"in":"query","name":"contactDistinctId","schema":{"type":"string","description":"Distinct ID of the contact to remove from the list."},"required":true,"description":"Distinct ID of the contact to remove from the list."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"contactListId":{"type":"string"},"contactDistinctId":{"type":"string"}},"required":["id","createdAt","updatedAt","projectId","contactListId","contactDistinctId"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contact-lists/{contactListId}/members/{contactListMemberId}":{"get":{"operationId":"crm-getContactListMember","summary":"Get List Member","description":"Fetches a single list-membership record by its own ID. Note this is the membership ID, not the contact's distinct ID. To check whether a given contact is in a list, use List Members with `contactDistinctId`.","tags":["List Members"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the list."},"required":true,"description":"ID of the project that owns the list."},{"in":"path","name":"contactListId","schema":{"type":"string","description":"ID of the contact list."},"required":true,"description":"ID of the contact list."},{"in":"path","name":"contactListMemberId","schema":{"type":"string","description":"ID of the membership record itself, not the contact's distinct ID."},"required":true,"description":"ID of the membership record itself, not the contact's distinct ID."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"contactListId":{"type":"string"},"contactDistinctId":{"type":"string"}},"required":["id","createdAt","updatedAt","projectId","contactListId","contactDistinctId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contact-lists/{contactListId}/members/query":{"post":{"operationId":"crm-listContactListMembersQuery","summary":"Query List Members","description":"The same result as List Members, but as a POST so it can carry a filter group in the body, for narrowing a list to a sub-segment, or naming exactly which contact properties to return. Use this when the query is too rich for a query string.","tags":["List Members"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the list."},"required":true,"description":"ID of the project that owns the list."},{"in":"path","name":"contactListId","schema":{"type":"string","description":"ID of the contact list to read."},"required":true,"description":"ID of the contact list to read."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactDistinctId":{"type":"string","description":"Only return the membership for this contact."},"orderBy":{"type":"string","enum":["name","createdAt","updatedAt"],"description":"Field to sort by."},"orderDirection":{"type":"string","enum":["asc","desc"],"description":"Sort direction. Ignored unless `orderBy` is set."},"skip":{"default":0,"description":"Number of members to skip before collecting results.","type":"number"},"take":{"default":24,"description":"Maximum number of members to return.","type":"number"},"attributes":{"type":"array","items":{"type":"string"},"description":"Property names to include on each member. Omit for the default set."},"contactsFilterGroup":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","operator","value"]},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"]}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"description":"Extra attribute and event conditions applied on top of list membership."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"],"additionalProperties":false}}},"required":["count","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contacts/{contactDistinctId}/contact-lists":{"get":{"operationId":"crm-listMemberContactLists","summary":"Get Contact Lists","description":"Lists every contact list one contact belongs to: the list-membership view for a contact detail page. The inverse of List Members.","tags":["List Members"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."},{"in":"path","name":"contactDistinctId","schema":{"type":"string","description":"Distinct ID of the contact whose list memberships to return."},"required":true,"description":"Distinct ID of the contact whose list memberships to return."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"default":"static","type":"string","enum":["static","dynamic"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","name","type","contactsFilterGroups","projectId"],"additionalProperties":false}}},"required":["count","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/count-subscribed-contacts":{"post":{"operationId":"crm-countSubscribedContacts","summary":"Count Subscribed","description":"Counts how many contacts match an audience *and* are still subscribed: the number that would actually receive a campaign, which is lower than a plain contact count once unsubscribes are excluded. Use it to size an audience before sending. Returns only the count, so it is much cheaper than paging List Contacts.","tags":["Contacts"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to count contacts in."},"required":true,"description":"ID of the project to count contacts in."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactListId":{"anyOf":[{"type":"string","description":"Restrict the count to members of this list. Combine with `contactsFilterGroup`, or omit to count across the whole project."},{"type":"null"}]},"contactsFilterGroup":{"anyOf":[{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","operator","value"]},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"]}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"description":"Attribute and event conditions the contact must satisfy."},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/contacts/migrate-distinct-id":{"post":{"operationId":"crm-migrateDistinctId","summary":"Migrate Distinct Id","description":"Re-keys a contact from one distinct ID to another, carrying their properties and history across. The usual case is promoting a soft identity to a real one: someone first seen by email gets a `soft_`-prefixed ID, and when they later sign in you migrate that to your own user ID so the two do not persist as separate contacts. Rewriting the analytics history is expensive, so this is not a bulk operation.","tags":["Contacts"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newDistinctId":{"type":"string","description":"The distinct ID to move the contact to, typically your own user ID."},"oldDistinctId":{"type":"string","description":"The contact's current distinct ID, often a generated `soft_` one."}},"required":["newDistinctId","oldDistinctId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/clean/settings":{"get":{"operationId":"crm-getCleanSettings","summary":"Get Clean Settings","description":"Returns the project's list-hygiene settings, which control whether new contacts have their email addresses validated automatically as they arrive.","tags":["Clean"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project whose clean settings to read."},"required":true,"description":"ID of the project whose clean settings to read."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"autoValidateNewContacts":{"type":"boolean","description":"Validate the email address of every new contact as it is created. Validation is billed per contact, so this trades spend for list quality."}},"required":["autoValidateNewContacts"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"crm-updateCleanSettings","summary":"Update Clean Settings","description":"Replaces the project's list-hygiene settings. Unlike most update endpoints here, `settings` is written whole rather than merged, so send the complete object. Enabling automatic validation applies to contacts created from then on; it does not retroactively validate existing ones.","tags":["Clean"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project whose clean settings to write."},"required":true,"description":"ID of the project whose clean settings to write."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"autoValidateNewContacts":{"type":"boolean","description":"Validate the email address of every new contact as it is created. Validation is billed per contact, so this trades spend for list quality."}},"required":["autoValidateNewContacts"],"description":"The complete settings object. Written as-is, replacing what is stored."}},"required":["settings"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"autoValidateNewContacts":{"type":"boolean","description":"Validate the email address of every new contact as it is created. Validation is billed per contact, so this trades spend for list quality."}},"required":["autoValidateNewContacts"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/custom-contact-links":{"post":{"operationId":"crm-createCustomContactLink","summary":"Create Custom Link","description":"Creates a custom contact link: a templated URL shown on every contact page, with contact properties substituted in. Use it to jump straight from a contact to that same person in another system, for example a Stripe customer or an internal admin page.","tags":["Custom Links"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that will own the link."},"required":true,"description":"ID of the project that will own the link."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"urlJSON":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/__schema0"}},"type":{"type":"string","const":"doc"}},"required":["type"]},"urlHTML":{"type":"string"}},"required":["label","urlJSON","urlHTML"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"label":{"type":"string"},"urlJSON":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/__schema1"}},"type":{"type":"string","const":"doc"}},"required":["type"],"additionalProperties":false},"urlHTML":{"type":"string"}},"required":["id","createdAt","updatedAt","projectId","label","urlJSON","urlHTML"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"crm-listCustomContactLinks","summary":"List Custom Links","description":"Lists the project's custom contact links: the templates, not the resolved URLs for any particular contact.","tags":["Custom Links"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to list custom links from."},"required":true,"description":"ID of the project to list custom links from."},{"in":"query","name":"skip","schema":{"type":"number","description":"Number of links to skip before collecting results."}},{"in":"query","name":"take","schema":{"type":"number","description":"Maximum number of links to return."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"label":{"type":"string"},"urlJSON":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/__schema1"}},"type":{"type":"string","const":"doc"}},"required":["type"],"additionalProperties":false},"urlHTML":{"type":"string"}},"required":["id","createdAt","updatedAt","projectId","label","urlJSON","urlHTML"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/crm/custom-contact-links/{customContactLinkId}":{"get":{"operationId":"crm-getCustomContactLink","summary":"Get Custom Link","description":"Fetches a single custom contact link template. Returns 404 if it does not exist.","tags":["Custom Links"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the link."},"required":true,"description":"ID of the project that owns the link."},{"in":"path","name":"customContactLinkId","schema":{"type":"string","description":"ID of the custom link to fetch."},"required":true,"description":"ID of the custom link to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"label":{"type":"string"},"urlJSON":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/__schema1"}},"type":{"type":"string","const":"doc"}},"required":["type"],"additionalProperties":false},"urlHTML":{"type":"string"}},"required":["id","createdAt","updatedAt","projectId","label","urlJSON","urlHTML"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"crm-updateCustomContactLink","summary":"Update Custom Link","description":"Updates a custom contact link's label or URL template. Only the fields present in the body are written. The template is stored in two forms. Send `urlHTML` and `urlJSON` together when changing the URL, since the server does not derive one from the other.","tags":["Custom Links"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the link."},"required":true,"description":"ID of the project that owns the link."},{"in":"path","name":"customContactLinkId","schema":{"type":"string","description":"ID of the custom link to update."},"required":true,"description":"ID of the custom link to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","description":"Text shown for the link on the contact page."},"urlHTML":{"type":"string","description":"The URL template rendered as HTML. Update alongside `urlJSON`. The two are the same template in different forms and are not derived from each other."},"urlJSON":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/__schema0"}},"type":{"type":"string","const":"doc"}},"required":["type"],"description":"The URL template as editor document JSON, holding the contact-property placeholders that get substituted per contact."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"label":{"type":"string"},"urlJSON":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/__schema1"}},"type":{"type":"string","const":"doc"}},"required":["type"],"additionalProperties":false},"urlHTML":{"type":"string"}},"required":["id","createdAt","updatedAt","projectId","label","urlJSON","urlHTML"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"crm-deleteCustomContactLink","summary":"Delete Custom Link","description":"Deletes a custom contact link, removing it from every contact page in the project. Contacts and their properties are unaffected. Cannot be undone.","tags":["Custom Links"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the link."},"required":true,"description":"ID of the project that owns the link."},{"in":"path","name":"customContactLinkId","schema":{"type":"string","description":"ID of the custom link to delete."},"required":true,"description":"ID of the custom link to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"label":{"type":"string"},"urlJSON":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/__schema1"}},"type":{"type":"string","const":"doc"}},"required":["type"],"additionalProperties":false},"urlHTML":{"type":"string"}},"required":["id","createdAt","updatedAt","projectId","label","urlJSON","urlHTML"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/activate-email-receiving":{"post":{"operationId":"domains-activateEmailReceiving","summary":"Activate Email Receiving","description":"Turns inbound email on for the domain. The hostname stays registered; this only enables receiving. DNS still has to pass Verify Email Receiving DNS before mail is accepted.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/activate-email":{"post":{"operationId":"domains-activateEmailSending","summary":"Activate Email Sending","description":"Registers the domain with Resend and turns on open/click tracking through trackingSubdomain, defaulting to links. Does not start verification — call Verify Email DNS after the records exist. Sets sending status to PENDING.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trackingSubdomain":{"type":"string","description":"Subdomain to serve open and click tracking from, e.g. links for links.acme.com. Defaults to links."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains":{"post":{"operationId":"domains-createDomain","summary":"Create Domain","description":"Registers a hostname on the project. Names are unique across Saasco. Reusing one that belongs to another project returns 400. Creating one does not enable sending, receiving, or shortlinks — those are separate activate calls.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that will own the domain."},"required":true,"description":"ID of the project that will own the domain."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Hostname to register, without a protocol. Must be unique across Saasco."}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"domains-listDomains","summary":"List Domains","description":"Lists the project's domains. Filter by sending status, shortlink state, or readyToSend (ACTIVE and tracking verified — use that when picking a from-domain).","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to list domains from."},"required":true,"description":"ID of the project to list domains from."},{"in":"query","name":"emailStatus","schema":{"type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"],"description":"Restrict the result to this sending status: INACTIVE, PENDING, ACTIVE, or ERROR."}},{"in":"query","name":"readyToSend","schema":{"type":"boolean","description":"When true, only domains that are ACTIVE and have verified link tracking. Use this when picking a from-domain to send from. Leave it off to include domains still waiting on DNS."}},{"in":"query","name":"shortlinkEnabled","schema":{"type":"boolean","description":"Restrict the result to domains with shortlinks on or off."}},{"in":"query","name":"vercelConfigured","schema":{"type":"boolean","description":"Restrict the result to domains that have been added to Vercel for shortlinks."}},{"in":"query","name":"vercelVerificationStatus","schema":{"type":"string","enum":["PENDING","VALID","INVALID"],"description":"Restrict the result to this shortlink DNS status: PENDING, VALID, or INVALID."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}":{"delete":{"operationId":"domains-deleteDomain","summary":"Delete Domain","description":"Permanently removes the domain from the project. Returns 404 if it does not exist. Cannot be undone.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"domains-getDomain","summary":"Get Domain","description":"Fetches a domain plus its email DNS config and whether verification jobs are still running. Returns 404 if no domain matches.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false},"emailConfig":{"anyOf":[{"type":"object","properties":{"capabilities":{"anyOf":[{"type":"object","properties":{"receiving":{"type":"string"},"sending":{"type":"string"}},"required":["receiving","sending"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"records":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"ttl":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["name","ttl","type","value"],"additionalProperties":false}},"region":{"type":"string"},"status":{"type":"string","enum":["pending","verified","failed","temporary_failure","not_started","partially_verified","partially_failed"]}},"required":["created_at","id","name","records","region","status"],"additionalProperties":false},{"type":"null"}]},"emailVerificationJobActive":{"type":"boolean"},"emailVerificationStarted":{"type":"boolean"},"receivingVerificationJobActive":{"type":"boolean"},"receivingVerificationStarted":{"type":"boolean"},"shortlinkVerificationJobActive":{"type":"boolean"},"shortlinkVerificationStarted":{"type":"boolean"}},"required":["domain","emailConfig","emailVerificationJobActive","emailVerificationStarted","receivingVerificationJobActive","receivingVerificationStarted","shortlinkVerificationJobActive","shortlinkVerificationStarted"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"domains-updateDomain","summary":"Update Domain","description":"Updates client-writable domain fields. Only the keys present in changes are written. Reputation, warmup, and the tracking subdomain are stripped even if sent — those are server-managed. Prefer the activate, disable, and verify endpoints for capability changes.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain to update."},"required":true,"description":"ID of the domain to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","properties":{"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailStatus":{"type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"shortlinkEnabled":{"type":"boolean"},"trackingVerificationStatus":{"type":"string","enum":["PENDING","VALID","INVALID"]},"vercelConfigured":{"type":"boolean"},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"]}},{"type":"null"}]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationStatus":{"type":"string","enum":["PENDING","VALID","INVALID"]}},"description":"Fields to change. Anything omitted is left as-is. Reputation, warmup, and the tracking subdomain are ignored even if sent."}},"required":["changes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/email-receiving":{"delete":{"operationId":"domains-disableEmailReceiving","summary":"Disable Email Receiving","description":"Turns inbound email off. If sending still uses the Resend registration, only receiving is disabled. If sending is already off, the registration is removed. Sets receiving status to INACTIVE.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/email":{"delete":{"operationId":"domains-disableEmailSending","summary":"Disable Email Sending","description":"Turns sending off and clears tracking state. If inbound still uses the same Resend registration, that registration is kept and only sending is disabled. Otherwise the domain is removed from Resend. Re-activating issues a new record set rather than reusing a stale one.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/shortlink":{"delete":{"operationId":"domains-disableShortlink","summary":"Disable Shortlink","description":"Removes the hostname from Vercel and turns custom-domain shortlinks off.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"domains-enableShortlink","summary":"Enable Shortlink","description":"Adds the hostname to Vercel so custom-domain shortlinks resolve. If DNS already verifies, project members get a verification email. Otherwise status stays PENDING until Verify Shortlink succeeds.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/domains/by-name/{domainName}":{"get":{"operationId":"domains-getDomainByName","summary":"Get Domain By Name","description":"Public lookup of a domain by hostname. Not project-scoped. Returns 404 if no domain matches.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"domainName","schema":{"type":"string","description":"Hostname to look up, without a protocol."},"required":true,"description":"Hostname to look up, without a protocol."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/receiving-config":{"get":{"operationId":"domains-getReceivingConfig","summary":"Get Email Receiving Config","description":"Returns inbound capability state, the MX records to add, and receiving status.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"capabilityEnabled":{"type":"boolean"},"records":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"record":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"ttl":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["name","ttl","type","value"],"additionalProperties":false}},"status":{"type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]}},"required":["capabilityEnabled","records","status"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/sender-reputation":{"get":{"operationId":"domains-getSenderReputation","summary":"Get Sender Reputation","description":"Returns the cached sender reputation score (0–100), refreshing it if the cache is stale.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100}},"required":["senderReputation"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/by-name/{domainName}/sender-reputation":{"get":{"operationId":"domains-getSenderReputationByDomainName","summary":"Get Sender Reputation By Domain Name","description":"Same sender reputation score as Get Sender Reputation, looked up by hostname within the project. Returns null if the domain is not on the project.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainName","schema":{"type":"string","description":"Hostname to look up, without a protocol, e.g. mail.example.com."},"required":true,"description":"Hostname to look up, without a protocol, e.g. mail.example.com."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100}},"required":["senderReputation"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/by-name/{domainName}/warmup-status":{"get":{"operationId":"domains-getWarmupStatus","summary":"Get Domain Warmup Status","description":"Current warmup ramp for a sending domain: day, daily cap, remaining sends, and whether the send window is open. Returns null if the domain is not warming.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainName","schema":{"type":"string","description":"Hostname to look up, without a protocol, e.g. mail.example.com."},"required":true,"description":"Hostname to look up, without a protocol, e.g. mail.example.com."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"advanceThresholdPct":{"type":"number"},"dailyCap":{"anyOf":[{"type":"number"},{"type":"null"}]},"day":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxWarmupDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remaining":{"anyOf":[{"type":"number"},{"type":"null"}]},"sentInWindow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["PENDING","WARMING","COMPLETED"]},"windowEndsAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"windowOpen":{"type":"boolean"}},"required":["advanceThresholdPct","dailyCap","day","maxWarmupDay","remaining","sentInWindow","status","windowEndsAt","windowOpen"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/warmup/complete":{"post":{"operationId":"domains-completeWarmup","summary":"Complete Domain Warmup","description":"Fast-forwards an actively WARMING domain to COMPLETED. Idempotent if it is already completed. Returns 400 if the domain is still PENDING, because skipping the ramp would also block the first-verification start.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/sender-reputation/refresh":{"post":{"operationId":"domains-refreshSenderReputation","summary":"Refresh Sender Reputation","description":"Forces a recomputation of the sender reputation score instead of returning the cached value.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100}},"required":["senderReputation"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/link-tracking":{"post":{"operationId":"domains-setTrackingSubdomain","summary":"Enable Link Tracking","description":"Sets the tracking host to trackingSubdomain (default links) and issues the tracking CNAME. Changing it re-issues DNS, and Resend allows one change per 24 hours.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trackingSubdomain":{"type":"string","description":"Subdomain to serve open and click tracking from, e.g. links for links.acme.com. Defaults to links."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/verify-email-dns":{"post":{"operationId":"domains-verifyEmailDNS","summary":"Verify Email DNS","description":"Asks Resend to re-check sending and tracking records and starts the verification job. The job is what emails 'verified'. verified is sending-only; trackingVerified is reported separately so a pending links CNAME does not look fully done. Returns 400 if the domain is not connected to an email provider.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"trackingVerified":{"type":"boolean"},"verified":{"type":"boolean"}},"required":["message","trackingVerified","verified"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/verify-email-receiving":{"post":{"operationId":"domains-verifyEmailReceiving","summary":"Verify Email Receiving DNS","description":"Re-checks inbound MX records and starts the inbound verification job, which is what emails 'verified'. Returns verified: true when receiving is ACTIVE. Returns 400 if inbound email is not enabled for the domain.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"verified":{"type":"boolean"}},"required":["message","verified"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/domains/{domainId}/verify-shortlink":{"post":{"operationId":"domains-verifyShortlink","summary":"Verify Shortlink","description":"Re-checks Vercel DNS for custom-domain shortlinks and updates verification status. Project members are emailed on the first VALID transition. Starts a verification job if the records are still invalid. Returns 400 if shortlinks are not enabled.","tags":["Domains"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the domain."},"required":true,"description":"ID of the project that owns the domain."},{"in":"path","name":"domainId","schema":{"type":"string","description":"ID of the domain."},"required":true,"description":"ID of the domain."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"emailStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailProvider":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailProviderDomainId":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailReceivingStatus":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PENDING","ACTIVE","ERROR"]},"emailReceivingProviderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingSubdomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"trackingVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"shortlinkEnabled":{"type":"boolean"},"vercelConfigured":{"type":"boolean"},"vercelVerificationStatus":{"default":"PENDING","type":"string","enum":["PENDING","VALID","INVALID"]},"vercelVerificationError":{"anyOf":[{"type":"string"},{"type":"null"}]},"vercelVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"emailVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivingVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"shortlinkVerificationRequestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderReputationComputedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupStatus":{"default":"PENDING","type":"string","enum":["PENDING","WARMING","COMPLETED"]},"warmupStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"warmupWindowStartedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"projectId":{"type":"string"},"name":{"type":"string"},"senderReputation":{"default":50,"type":"integer","minimum":0,"maximum":100},"warmupDay":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"warmupSentCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","emailStatus","emailReceivingStatus","trackingVerificationStatus","shortlinkEnabled","vercelConfigured","vercelVerificationStatus","warmupStatus","projectId","name","senderReputation","warmupDay","warmupSentCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/{campaignId}/email-count":{"get":{"operationId":"emailMarketing-countEmailsForEmailCampaign","summary":"Count Campaign Emails","description":"How many emails the campaign covers. The meaning shifts with campaign state: while it is still SENDING this is a live count of contacts currently matching the audience, so it can move between calls as contacts subscribe or unsubscribe. In every other state it counts the Email rows actually created. Treat it as a projection before the send finishes and a fact afterwards.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the campaign to count."},"required":true,"description":"ID of the campaign to count."},{"in":"query","name":"messageId","schema":{"type":"string","description":"Count only emails sent from this campaign message, useful for a single A/B variant. Ignored while the campaign is still SENDING."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns":{"post":{"operationId":"emailMarketing-createEmailCampaign","summary":"Create Email Campaign","description":"Creates a campaign together with its first message (subject, body, sender) in one transaction. New campaigns always start as a DRAFT. Creating one never sends anything. Define the audience with `contactListId`, `contactsFilterGroups`, or both; set `type` to `AB_TEST` and supply `abTestConfig` for a split test.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"Project that owns the campaign."},"required":true,"description":"Project that owns the campaign."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Campaign name shown in the dashboard and reports."},"status":{"default":"DRAFT","description":"Lifecycle status. New campaigns default to DRAFT. Only name and projectId are required to create a draft; sender, subject, and body can be filled in later.","type":"string","enum":["DRAFT","SCHEDULED","SENDING","SENT","PAUSED","CANCELLED"]},"type":{"default":"STANDARD","description":"STANDARD is a single message. AB_TEST requires a second message via the campaign-message endpoints. AUTOMATION is for workflow-created campaigns.","type":"string","enum":["STANDARD","AUTOMATION","AB_TEST"]},"workflowId":{"description":"Workflow that created this campaign, if any.","anyOf":[{"type":"string"},{"type":"null"}]},"workflowStepId":{"description":"Workflow step that created this campaign, if any.","anyOf":[{"type":"string"},{"type":"null"}]},"contactListId":{"description":"Limit the audience to members of this contact list. Combine with contactsFilterGroups, or omit to use filters only.","anyOf":[{"type":"string"},{"type":"null"}]},"contactsFilterGroups":{"default":[],"description":"Audience filter groups. An empty group matches everyone. The server seeds one empty AND group when this is omitted.","type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","operator","value"]},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"]}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"]}},"sendOrderByProperty":{"description":"Contact property and direction used to order the send. Omit to use the project default.","anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"]},{"type":"null"}]},"abTestConfig":{"description":"A/B test settings. Only used when type is AB_TEST; omit for a standard campaign.","anyOf":[{"type":"object","properties":{"variable":{"type":"string","enum":["SUBJECT","FROM_NAME","CONTENT","SEND_TIME"],"description":"What differs across variants: subject, from name, content, or send time."},"samplePercent":{"default":20,"description":"Percent of the audience that receives the sample variants.","type":"number","minimum":1,"maximum":100},"winnerMetric":{"default":"OPEN_RATE","description":"Metric used to pick the winning variant.","type":"string","enum":["OPEN_RATE","CLICK_RATE"]},"winnerWaitHours":{"default":4,"description":"How long to wait after the sample before picking a winner.","type":"number","minimum":0},"winnerWaitUnit":{"default":"HOURS","description":"Unit for winnerWaitHours.","type":"string","enum":["HOURS","MINUTES"]},"sendTimeDelayHours":{"default":2,"description":"Delay between sample sends when variable is SEND_TIME.","type":"number","minimum":0},"sendTimeDelayUnit":{"default":"HOURS","description":"Unit for sendTimeDelayHours.","type":"string","enum":["HOURS","MINUTES"]},"winnerMessageId":{"description":"Winning message id. Set by the runtime after the test resolves.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerSelectedAt":{"description":"ISO timestamp when the winner was selected.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerRolloutAt":{"description":"ISO timestamp when the winner was rolled out to the rest of the list.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerWaitStartedAt":{"description":"ISO timestamp when the winner-wait countdown started.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"default":"AWAITING_SAMPLE","description":"A/B test phase. Omit on create; the runtime advances this.","type":"string","enum":["AWAITING_SAMPLE","AWAITING_WINNER","ROLLED_OUT"]},"samplePaginationEnd":{"description":"Send cursor at the end of the sample phase. Set by the runtime.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["variable"]},{"type":"null"}]},"utmConfig":{"description":"UTM tags appended to links in the email. Omit to use source=saasco, medium=email, and campaign=<name>.","anyOf":[{"type":"object","properties":{"enabled":{"default":true,"description":"When false, links are left untagged.","type":"boolean"},"params":{"default":{"campaign":"","content":"","medium":"","source":"","term":""},"description":"Query-string values appended to http(s) links in the email.","type":"object","properties":{"campaign":{"default":"","description":"utm_campaign. Defaults to the campaign name when utmConfig is omitted.","type":"string"},"content":{"default":"","description":"utm_content.","type":"string"},"medium":{"default":"","description":"utm_medium. Defaults to email.","type":"string"},"source":{"default":"","description":"utm_source. Defaults to saasco.","type":"string"},"term":{"default":"","description":"utm_term.","type":"string"}}}}},{"type":"null"}]},"sendingTargetDurationMs":{"description":"Send-pacing hint. Omit for the default reputation-based pace. `0` skips pacing on qualifying domains.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"bcc":{"description":"BCC address applied to every send from this campaign's first message.","anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"description":"CC address applied to every send from this campaign's first message.","anyOf":[{"type":"string"},{"type":"null"}]},"fromDomain":{"description":"Verified sending domain. Omit to use the project's default email domain, or the first active domain.","type":"string"},"fromEmailUsername":{"description":"Local part of the From address (the part before @). Omit to use the project default.","type":"string"},"fromName":{"description":"Display name in the From header. Omit to use the project default.","type":"string"},"replyTo":{"description":"Reply-To address for this campaign's first message.","anyOf":[{"type":"string"},{"type":"null"}]},"scheduledAt":{"description":"When to send the first message. Ignored until the campaign is actually sent.","anyOf":[{"type":"string"},{"type":"null"}]},"text":{"default":"","description":"Plain-text body fallback. The HTML body is used when both are set.","type":"string"},"theme":{"description":"Editor theme for the first message. Omit to use the default light theme.","anyOf":[{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"]},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"]},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"]},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]}},"required":["h1","h2","h3","p"]}},"required":["body","button","link","template","typography"]},{"type":"null"}]},"subjectHTML":{"description":"Subject line as HTML. Omit to create an empty draft subject.","type":"string"},"subjectJSON":{"description":"Subject as email-editor JSON (TipTap/Novel document). The dashboard writes this; most API callers can omit it and send subjectHTML instead.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextHTML":{"description":"Inbox preview / preheader text as HTML.","type":"string"},"previewTextJSON":{"description":"Inbox preview as email-editor JSON. Omit unless you are driving the dashboard editor.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"bodyHTML":{"description":"Email body as an HTML fragment only — no <!doctype>, <html>, <head>, or <body> tags. Those nest a second document and break open tracking, link rewriting, and the unsubscribe footer.","type":"string"},"bodyJSON":{"description":"Email body as email-editor JSON (TipTap/Novel `{ type: \"doc\", content: [...] }`). The dashboard stores this for editing; send time uses bodyHTML. Omit unless you are driving the editor.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","SENDING","SENT","PAUSED","CANCELLED"]},"type":{"default":"STANDARD","type":"string","enum":["STANDARD","AUTOMATION","AB_TEST"]},"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}]},"workflowStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactListId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactsFilterGroups":{"default":[],"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendOrderByProperty":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},{"type":"null"}]},"abTestConfig":{"anyOf":[{"type":"object","properties":{"variable":{"type":"string","enum":["SUBJECT","FROM_NAME","CONTENT","SEND_TIME"],"description":"What differs across variants: subject, from name, content, or send time."},"samplePercent":{"default":20,"description":"Percent of the audience that receives the sample variants.","type":"number","minimum":1,"maximum":100},"winnerMetric":{"default":"OPEN_RATE","description":"Metric used to pick the winning variant.","type":"string","enum":["OPEN_RATE","CLICK_RATE"]},"winnerWaitHours":{"default":4,"description":"How long to wait after the sample before picking a winner.","type":"number","minimum":0},"winnerWaitUnit":{"default":"HOURS","description":"Unit for winnerWaitHours.","type":"string","enum":["HOURS","MINUTES"]},"sendTimeDelayHours":{"default":2,"description":"Delay between sample sends when variable is SEND_TIME.","type":"number","minimum":0},"sendTimeDelayUnit":{"default":"HOURS","description":"Unit for sendTimeDelayHours.","type":"string","enum":["HOURS","MINUTES"]},"winnerMessageId":{"description":"Winning message id. Set by the runtime after the test resolves.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerSelectedAt":{"description":"ISO timestamp when the winner was selected.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerRolloutAt":{"description":"ISO timestamp when the winner was rolled out to the rest of the list.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerWaitStartedAt":{"description":"ISO timestamp when the winner-wait countdown started.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"default":"AWAITING_SAMPLE","description":"A/B test phase. Omit on create; the runtime advances this.","type":"string","enum":["AWAITING_SAMPLE","AWAITING_WINNER","ROLLED_OUT"]},"samplePaginationEnd":{"description":"Send cursor at the end of the sample phase. Set by the runtime.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["variable","samplePercent","winnerMetric","winnerWaitHours","winnerWaitUnit","sendTimeDelayHours","sendTimeDelayUnit","status"],"additionalProperties":false},{"type":"null"}]},"utmConfig":{"anyOf":[{"type":"object","properties":{"enabled":{"default":true,"description":"When false, links are left untagged.","type":"boolean"},"params":{"default":{"campaign":"","content":"","medium":"","source":"","term":""},"description":"Query-string values appended to http(s) links in the email.","type":"object","properties":{"campaign":{"default":"","description":"utm_campaign. Defaults to the campaign name when utmConfig is omitted.","type":"string"},"content":{"default":"","description":"utm_content.","type":"string"},"medium":{"default":"","description":"utm_medium. Defaults to email.","type":"string"},"source":{"default":"","description":"utm_source. Defaults to saasco.","type":"string"},"term":{"default":"","description":"utm_term.","type":"string"}},"required":["campaign","content","medium","source","term"],"additionalProperties":false}},"required":["enabled","params"],"additionalProperties":false},{"type":"null"}]},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"sendingTargetDurationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"sendPaginationCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"label":{"type":"string"},"fromName":{"type":"string"},"fromEmailUsername":{"type":"string"},"fromDomain":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"type":"string"},"subjectHTML":{"type":"string"},"previewTextHTML":{"type":"string"},"bodyHTML":{"type":"string"},"scheduledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"subjectJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"theme":{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","label","fromName","fromEmailUsername","fromDomain","text","subjectHTML","previewTextHTML","bodyHTML","bodyJSON","previewTextJSON","sendCount","subjectJSON","theme"],"additionalProperties":false}},"bcc":{"description":"@deprecated Use messages[0].bcc","anyOf":[{"type":"string"},{"type":"null"}]},"bodyHTML":{"description":"@deprecated Use messages[0].bodyHTML","anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"description":"@deprecated Use messages[0].bodyJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"cc":{"description":"@deprecated Use messages[0].cc","anyOf":[{"type":"string"},{"type":"null"}]},"fromDomain":{"description":"@deprecated Use messages[0].fromDomain","anyOf":[{"type":"string"},{"type":"null"}]},"fromEmailUsername":{"description":"@deprecated Use messages[0].fromEmailUsername","anyOf":[{"type":"string"},{"type":"null"}]},"fromName":{"description":"@deprecated Use messages[0].fromName","anyOf":[{"type":"string"},{"type":"null"}]},"previewTextHTML":{"description":"@deprecated Use messages[0].previewTextHTML","anyOf":[{"type":"string"},{"type":"null"}]},"previewTextJSON":{"description":"@deprecated Use messages[0].previewTextJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"replyTo":{"description":"@deprecated Use messages[0].replyTo","anyOf":[{"type":"string"},{"type":"null"}]},"scheduledAt":{"description":"@deprecated Use messages[0].scheduledAt","anyOf":[{"type":"string"},{"type":"null"}]},"subjectHTML":{"description":"@deprecated Use messages[0].subjectHTML","anyOf":[{"type":"string"},{"type":"null"}]},"subjectJSON":{"description":"@deprecated Use messages[0].subjectJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"text":{"description":"@deprecated Use messages[0].text","anyOf":[{"type":"string"},{"type":"null"}]},"theme":{"description":"@deprecated Use messages[0].theme","anyOf":[{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","name","status","type","contactsFilterGroups","sendCount","sendPaginationCount","messages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"emailMarketing-listEmailCampaigns","summary":"List Email Campaigns","description":"Lists the project's campaigns with their messages, status, and send progress. Optionally narrow to one kind with `type`. This is unpaginated and returns every campaign in the project.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to list campaigns for."},"required":true,"description":"ID of the project to list campaigns for."},{"in":"query","name":"type","schema":{"type":"string","enum":["STANDARD","AUTOMATION","AB_TEST"],"description":"Return only campaigns of this kind: `STANDARD` for a one-off broadcast, `AUTOMATION` for a triggered send, `AB_TEST` for a split test. Omit for all three."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","SENDING","SENT","PAUSED","CANCELLED"]},"type":{"default":"STANDARD","type":"string","enum":["STANDARD","AUTOMATION","AB_TEST"]},"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}]},"workflowStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactListId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactsFilterGroups":{"default":[],"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendOrderByProperty":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},{"type":"null"}]},"abTestConfig":{"anyOf":[{"type":"object","properties":{"variable":{"type":"string","enum":["SUBJECT","FROM_NAME","CONTENT","SEND_TIME"],"description":"What differs across variants: subject, from name, content, or send time."},"samplePercent":{"default":20,"description":"Percent of the audience that receives the sample variants.","type":"number","minimum":1,"maximum":100},"winnerMetric":{"default":"OPEN_RATE","description":"Metric used to pick the winning variant.","type":"string","enum":["OPEN_RATE","CLICK_RATE"]},"winnerWaitHours":{"default":4,"description":"How long to wait after the sample before picking a winner.","type":"number","minimum":0},"winnerWaitUnit":{"default":"HOURS","description":"Unit for winnerWaitHours.","type":"string","enum":["HOURS","MINUTES"]},"sendTimeDelayHours":{"default":2,"description":"Delay between sample sends when variable is SEND_TIME.","type":"number","minimum":0},"sendTimeDelayUnit":{"default":"HOURS","description":"Unit for sendTimeDelayHours.","type":"string","enum":["HOURS","MINUTES"]},"winnerMessageId":{"description":"Winning message id. Set by the runtime after the test resolves.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerSelectedAt":{"description":"ISO timestamp when the winner was selected.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerRolloutAt":{"description":"ISO timestamp when the winner was rolled out to the rest of the list.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerWaitStartedAt":{"description":"ISO timestamp when the winner-wait countdown started.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"default":"AWAITING_SAMPLE","description":"A/B test phase. Omit on create; the runtime advances this.","type":"string","enum":["AWAITING_SAMPLE","AWAITING_WINNER","ROLLED_OUT"]},"samplePaginationEnd":{"description":"Send cursor at the end of the sample phase. Set by the runtime.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["variable","samplePercent","winnerMetric","winnerWaitHours","winnerWaitUnit","sendTimeDelayHours","sendTimeDelayUnit","status"],"additionalProperties":false},{"type":"null"}]},"utmConfig":{"anyOf":[{"type":"object","properties":{"enabled":{"default":true,"description":"When false, links are left untagged.","type":"boolean"},"params":{"default":{"campaign":"","content":"","medium":"","source":"","term":""},"description":"Query-string values appended to http(s) links in the email.","type":"object","properties":{"campaign":{"default":"","description":"utm_campaign. Defaults to the campaign name when utmConfig is omitted.","type":"string"},"content":{"default":"","description":"utm_content.","type":"string"},"medium":{"default":"","description":"utm_medium. Defaults to email.","type":"string"},"source":{"default":"","description":"utm_source. Defaults to saasco.","type":"string"},"term":{"default":"","description":"utm_term.","type":"string"}},"required":["campaign","content","medium","source","term"],"additionalProperties":false}},"required":["enabled","params"],"additionalProperties":false},{"type":"null"}]},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"sendingTargetDurationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"sendPaginationCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"label":{"type":"string"},"fromName":{"type":"string"},"fromEmailUsername":{"type":"string"},"fromDomain":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"type":"string"},"subjectHTML":{"type":"string"},"previewTextHTML":{"type":"string"},"bodyHTML":{"type":"string"},"scheduledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"subjectJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"theme":{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","label","fromName","fromEmailUsername","fromDomain","text","subjectHTML","previewTextHTML","bodyHTML","bodyJSON","previewTextJSON","sendCount","subjectJSON","theme"],"additionalProperties":false}},"bcc":{"description":"@deprecated Use messages[0].bcc","anyOf":[{"type":"string"},{"type":"null"}]},"bodyHTML":{"description":"@deprecated Use messages[0].bodyHTML","anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"description":"@deprecated Use messages[0].bodyJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"cc":{"description":"@deprecated Use messages[0].cc","anyOf":[{"type":"string"},{"type":"null"}]},"fromDomain":{"description":"@deprecated Use messages[0].fromDomain","anyOf":[{"type":"string"},{"type":"null"}]},"fromEmailUsername":{"description":"@deprecated Use messages[0].fromEmailUsername","anyOf":[{"type":"string"},{"type":"null"}]},"fromName":{"description":"@deprecated Use messages[0].fromName","anyOf":[{"type":"string"},{"type":"null"}]},"previewTextHTML":{"description":"@deprecated Use messages[0].previewTextHTML","anyOf":[{"type":"string"},{"type":"null"}]},"previewTextJSON":{"description":"@deprecated Use messages[0].previewTextJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"replyTo":{"description":"@deprecated Use messages[0].replyTo","anyOf":[{"type":"string"},{"type":"null"}]},"scheduledAt":{"description":"@deprecated Use messages[0].scheduledAt","anyOf":[{"type":"string"},{"type":"null"}]},"subjectHTML":{"description":"@deprecated Use messages[0].subjectHTML","anyOf":[{"type":"string"},{"type":"null"}]},"subjectJSON":{"description":"@deprecated Use messages[0].subjectJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"text":{"description":"@deprecated Use messages[0].text","anyOf":[{"type":"string"},{"type":"null"}]},"theme":{"description":"@deprecated Use messages[0].theme","anyOf":[{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","name","status","type","contactsFilterGroups","sendCount","sendPaginationCount","messages"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/{campaignId}":{"delete":{"operationId":"emailMarketing-deleteEmailCampaign","summary":"Delete Email Campaign","description":"Permanently deletes a campaign and its messages. Only campaigns still in DRAFT can be deleted. Once a campaign has started sending it is rejected with 400, so delivery history is never destroyed this way. Cannot be undone.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the campaign to delete."},"required":true,"description":"ID of the campaign to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"emailMarketing-getEmailCampaign","summary":"Get Email Campaign","description":"Fetches a single campaign with its messages, audience definition, status, and send progress. Returns 404 if the campaign does not exist in this project.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the campaign to fetch."},"required":true,"description":"ID of the campaign to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","SENDING","SENT","PAUSED","CANCELLED"]},"type":{"default":"STANDARD","type":"string","enum":["STANDARD","AUTOMATION","AB_TEST"]},"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}]},"workflowStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactListId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactsFilterGroups":{"default":[],"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendOrderByProperty":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},{"type":"null"}]},"abTestConfig":{"anyOf":[{"type":"object","properties":{"variable":{"type":"string","enum":["SUBJECT","FROM_NAME","CONTENT","SEND_TIME"],"description":"What differs across variants: subject, from name, content, or send time."},"samplePercent":{"default":20,"description":"Percent of the audience that receives the sample variants.","type":"number","minimum":1,"maximum":100},"winnerMetric":{"default":"OPEN_RATE","description":"Metric used to pick the winning variant.","type":"string","enum":["OPEN_RATE","CLICK_RATE"]},"winnerWaitHours":{"default":4,"description":"How long to wait after the sample before picking a winner.","type":"number","minimum":0},"winnerWaitUnit":{"default":"HOURS","description":"Unit for winnerWaitHours.","type":"string","enum":["HOURS","MINUTES"]},"sendTimeDelayHours":{"default":2,"description":"Delay between sample sends when variable is SEND_TIME.","type":"number","minimum":0},"sendTimeDelayUnit":{"default":"HOURS","description":"Unit for sendTimeDelayHours.","type":"string","enum":["HOURS","MINUTES"]},"winnerMessageId":{"description":"Winning message id. Set by the runtime after the test resolves.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerSelectedAt":{"description":"ISO timestamp when the winner was selected.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerRolloutAt":{"description":"ISO timestamp when the winner was rolled out to the rest of the list.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerWaitStartedAt":{"description":"ISO timestamp when the winner-wait countdown started.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"default":"AWAITING_SAMPLE","description":"A/B test phase. Omit on create; the runtime advances this.","type":"string","enum":["AWAITING_SAMPLE","AWAITING_WINNER","ROLLED_OUT"]},"samplePaginationEnd":{"description":"Send cursor at the end of the sample phase. Set by the runtime.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["variable","samplePercent","winnerMetric","winnerWaitHours","winnerWaitUnit","sendTimeDelayHours","sendTimeDelayUnit","status"],"additionalProperties":false},{"type":"null"}]},"utmConfig":{"anyOf":[{"type":"object","properties":{"enabled":{"default":true,"description":"When false, links are left untagged.","type":"boolean"},"params":{"default":{"campaign":"","content":"","medium":"","source":"","term":""},"description":"Query-string values appended to http(s) links in the email.","type":"object","properties":{"campaign":{"default":"","description":"utm_campaign. Defaults to the campaign name when utmConfig is omitted.","type":"string"},"content":{"default":"","description":"utm_content.","type":"string"},"medium":{"default":"","description":"utm_medium. Defaults to email.","type":"string"},"source":{"default":"","description":"utm_source. Defaults to saasco.","type":"string"},"term":{"default":"","description":"utm_term.","type":"string"}},"required":["campaign","content","medium","source","term"],"additionalProperties":false}},"required":["enabled","params"],"additionalProperties":false},{"type":"null"}]},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"sendingTargetDurationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"sendPaginationCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"label":{"type":"string"},"fromName":{"type":"string"},"fromEmailUsername":{"type":"string"},"fromDomain":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"type":"string"},"subjectHTML":{"type":"string"},"previewTextHTML":{"type":"string"},"bodyHTML":{"type":"string"},"scheduledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"subjectJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"theme":{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","label","fromName","fromEmailUsername","fromDomain","text","subjectHTML","previewTextHTML","bodyHTML","bodyJSON","previewTextJSON","sendCount","subjectJSON","theme"],"additionalProperties":false}},"bcc":{"description":"@deprecated Use messages[0].bcc","anyOf":[{"type":"string"},{"type":"null"}]},"bodyHTML":{"description":"@deprecated Use messages[0].bodyHTML","anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"description":"@deprecated Use messages[0].bodyJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"cc":{"description":"@deprecated Use messages[0].cc","anyOf":[{"type":"string"},{"type":"null"}]},"fromDomain":{"description":"@deprecated Use messages[0].fromDomain","anyOf":[{"type":"string"},{"type":"null"}]},"fromEmailUsername":{"description":"@deprecated Use messages[0].fromEmailUsername","anyOf":[{"type":"string"},{"type":"null"}]},"fromName":{"description":"@deprecated Use messages[0].fromName","anyOf":[{"type":"string"},{"type":"null"}]},"previewTextHTML":{"description":"@deprecated Use messages[0].previewTextHTML","anyOf":[{"type":"string"},{"type":"null"}]},"previewTextJSON":{"description":"@deprecated Use messages[0].previewTextJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"replyTo":{"description":"@deprecated Use messages[0].replyTo","anyOf":[{"type":"string"},{"type":"null"}]},"scheduledAt":{"description":"@deprecated Use messages[0].scheduledAt","anyOf":[{"type":"string"},{"type":"null"}]},"subjectHTML":{"description":"@deprecated Use messages[0].subjectHTML","anyOf":[{"type":"string"},{"type":"null"}]},"subjectJSON":{"description":"@deprecated Use messages[0].subjectJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"text":{"description":"@deprecated Use messages[0].text","anyOf":[{"type":"string"},{"type":"null"}]},"theme":{"description":"@deprecated Use messages[0].theme","anyOf":[{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","name","status","type","contactsFilterGroups","sendCount","sendPaginationCount","messages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"emailMarketing-updateEmailCampaign","summary":"Update Email Campaign","description":"Updates a campaign's settings. Despite the PUT, only the fields present in `changes` are written. Anything omitted keeps its current value. Editing a campaign that has already sent changes future behaviour only; it does not alter or resend emails already delivered.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the campaign to update."},"required":true,"description":"ID of the campaign to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","properties":{"abTestConfig":{"anyOf":[{"type":"object","properties":{"variable":{"type":"string","enum":["SUBJECT","FROM_NAME","CONTENT","SEND_TIME"],"description":"What differs across variants: subject, from name, content, or send time."},"samplePercent":{"default":20,"description":"Percent of the audience that receives the sample variants.","type":"number","minimum":1,"maximum":100},"winnerMetric":{"default":"OPEN_RATE","description":"Metric used to pick the winning variant.","type":"string","enum":["OPEN_RATE","CLICK_RATE"]},"winnerWaitHours":{"default":4,"description":"How long to wait after the sample before picking a winner.","type":"number","minimum":0},"winnerWaitUnit":{"default":"HOURS","description":"Unit for winnerWaitHours.","type":"string","enum":["HOURS","MINUTES"]},"sendTimeDelayHours":{"default":2,"description":"Delay between sample sends when variable is SEND_TIME.","type":"number","minimum":0},"sendTimeDelayUnit":{"default":"HOURS","description":"Unit for sendTimeDelayHours.","type":"string","enum":["HOURS","MINUTES"]},"winnerMessageId":{"description":"Winning message id. Set by the runtime after the test resolves.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerSelectedAt":{"description":"ISO timestamp when the winner was selected.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerRolloutAt":{"description":"ISO timestamp when the winner was rolled out to the rest of the list.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerWaitStartedAt":{"description":"ISO timestamp when the winner-wait countdown started.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"default":"AWAITING_SAMPLE","description":"A/B test phase. Omit on create; the runtime advances this.","type":"string","enum":["AWAITING_SAMPLE","AWAITING_WINNER","ROLLED_OUT"]},"samplePaginationEnd":{"description":"Send cursor at the end of the sample phase. Set by the runtime.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["variable"]},{"type":"null"}]},"contactListId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","operator","value"]},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"]}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"]}},"name":{"type":"string"},"sendOrderByProperty":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"]},{"type":"null"}]},"status":{"type":"string","enum":["DRAFT","SCHEDULED","SENDING","SENT","PAUSED","CANCELLED"]},"utmConfig":{"anyOf":[{"type":"object","properties":{"enabled":{"default":true,"description":"When false, links are left untagged.","type":"boolean"},"params":{"default":{"campaign":"","content":"","medium":"","source":"","term":""},"description":"Query-string values appended to http(s) links in the email.","type":"object","properties":{"campaign":{"default":"","description":"utm_campaign. Defaults to the campaign name when utmConfig is omitted.","type":"string"},"content":{"default":"","description":"utm_content.","type":"string"},"medium":{"default":"","description":"utm_medium. Defaults to email.","type":"string"},"source":{"default":"","description":"utm_source. Defaults to saasco.","type":"string"},"term":{"default":"","description":"utm_term.","type":"string"}}}}},{"type":"null"}]},"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}]},"workflowStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendingTargetDurationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"bcc":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyHTML":{"type":"string"},"cc":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromDomain":{"type":"string"},"fromEmailUsername":{"type":"string"},"fromName":{"type":"string"},"previewTextHTML":{"type":"string"},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"scheduledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"subjectHTML":{"type":"string"},"text":{"type":"string"},"theme":{"anyOf":[{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"]},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"]},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"]},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]}},"required":["h1","h2","h3","p"]}},"required":["body","button","link","template","typography"]},{"type":"null"}]},"bodyJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"subjectJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"description":"Fields to change. Anything omitted is left as-is."}},"required":["changes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","SENDING","SENT","PAUSED","CANCELLED"]},"type":{"default":"STANDARD","type":"string","enum":["STANDARD","AUTOMATION","AB_TEST"]},"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}]},"workflowStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactListId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactsFilterGroups":{"default":[],"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendOrderByProperty":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},{"type":"null"}]},"abTestConfig":{"anyOf":[{"type":"object","properties":{"variable":{"type":"string","enum":["SUBJECT","FROM_NAME","CONTENT","SEND_TIME"],"description":"What differs across variants: subject, from name, content, or send time."},"samplePercent":{"default":20,"description":"Percent of the audience that receives the sample variants.","type":"number","minimum":1,"maximum":100},"winnerMetric":{"default":"OPEN_RATE","description":"Metric used to pick the winning variant.","type":"string","enum":["OPEN_RATE","CLICK_RATE"]},"winnerWaitHours":{"default":4,"description":"How long to wait after the sample before picking a winner.","type":"number","minimum":0},"winnerWaitUnit":{"default":"HOURS","description":"Unit for winnerWaitHours.","type":"string","enum":["HOURS","MINUTES"]},"sendTimeDelayHours":{"default":2,"description":"Delay between sample sends when variable is SEND_TIME.","type":"number","minimum":0},"sendTimeDelayUnit":{"default":"HOURS","description":"Unit for sendTimeDelayHours.","type":"string","enum":["HOURS","MINUTES"]},"winnerMessageId":{"description":"Winning message id. Set by the runtime after the test resolves.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerSelectedAt":{"description":"ISO timestamp when the winner was selected.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerRolloutAt":{"description":"ISO timestamp when the winner was rolled out to the rest of the list.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerWaitStartedAt":{"description":"ISO timestamp when the winner-wait countdown started.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"default":"AWAITING_SAMPLE","description":"A/B test phase. Omit on create; the runtime advances this.","type":"string","enum":["AWAITING_SAMPLE","AWAITING_WINNER","ROLLED_OUT"]},"samplePaginationEnd":{"description":"Send cursor at the end of the sample phase. Set by the runtime.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["variable","samplePercent","winnerMetric","winnerWaitHours","winnerWaitUnit","sendTimeDelayHours","sendTimeDelayUnit","status"],"additionalProperties":false},{"type":"null"}]},"utmConfig":{"anyOf":[{"type":"object","properties":{"enabled":{"default":true,"description":"When false, links are left untagged.","type":"boolean"},"params":{"default":{"campaign":"","content":"","medium":"","source":"","term":""},"description":"Query-string values appended to http(s) links in the email.","type":"object","properties":{"campaign":{"default":"","description":"utm_campaign. Defaults to the campaign name when utmConfig is omitted.","type":"string"},"content":{"default":"","description":"utm_content.","type":"string"},"medium":{"default":"","description":"utm_medium. Defaults to email.","type":"string"},"source":{"default":"","description":"utm_source. Defaults to saasco.","type":"string"},"term":{"default":"","description":"utm_term.","type":"string"}},"required":["campaign","content","medium","source","term"],"additionalProperties":false}},"required":["enabled","params"],"additionalProperties":false},{"type":"null"}]},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"sendingTargetDurationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"sendPaginationCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"label":{"type":"string"},"fromName":{"type":"string"},"fromEmailUsername":{"type":"string"},"fromDomain":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"type":"string"},"subjectHTML":{"type":"string"},"previewTextHTML":{"type":"string"},"bodyHTML":{"type":"string"},"scheduledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"subjectJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"theme":{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","label","fromName","fromEmailUsername","fromDomain","text","subjectHTML","previewTextHTML","bodyHTML","bodyJSON","previewTextJSON","sendCount","subjectJSON","theme"],"additionalProperties":false}},"bcc":{"description":"@deprecated Use messages[0].bcc","anyOf":[{"type":"string"},{"type":"null"}]},"bodyHTML":{"description":"@deprecated Use messages[0].bodyHTML","anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"description":"@deprecated Use messages[0].bodyJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"cc":{"description":"@deprecated Use messages[0].cc","anyOf":[{"type":"string"},{"type":"null"}]},"fromDomain":{"description":"@deprecated Use messages[0].fromDomain","anyOf":[{"type":"string"},{"type":"null"}]},"fromEmailUsername":{"description":"@deprecated Use messages[0].fromEmailUsername","anyOf":[{"type":"string"},{"type":"null"}]},"fromName":{"description":"@deprecated Use messages[0].fromName","anyOf":[{"type":"string"},{"type":"null"}]},"previewTextHTML":{"description":"@deprecated Use messages[0].previewTextHTML","anyOf":[{"type":"string"},{"type":"null"}]},"previewTextJSON":{"description":"@deprecated Use messages[0].previewTextJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"replyTo":{"description":"@deprecated Use messages[0].replyTo","anyOf":[{"type":"string"},{"type":"null"}]},"scheduledAt":{"description":"@deprecated Use messages[0].scheduledAt","anyOf":[{"type":"string"},{"type":"null"}]},"subjectHTML":{"description":"@deprecated Use messages[0].subjectHTML","anyOf":[{"type":"string"},{"type":"null"}]},"subjectJSON":{"description":"@deprecated Use messages[0].subjectJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"text":{"description":"@deprecated Use messages[0].text","anyOf":[{"type":"string"},{"type":"null"}]},"theme":{"description":"@deprecated Use messages[0].theme","anyOf":[{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","name","status","type","contactsFilterGroups","sendCount","sendPaginationCount","messages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/{campaignId}/duplicate":{"post":{"operationId":"emailMarketing-duplicateEmailCampaign","summary":"Duplicate Email Campaign","description":"Copies a campaign (its messages, audience, and settings) into a new DRAFT. The copy is named `\"<original> (Copy)\"`, incrementing to `(Copy 2)` and beyond if that name is taken. Send counts, sent timestamps, and any A/B winner are reset, so the duplicate behaves like a fresh campaign rather than inheriting the original's results.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the campaign to copy."},"required":true,"description":"ID of the campaign to copy."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","SENDING","SENT","PAUSED","CANCELLED"]},"type":{"default":"STANDARD","type":"string","enum":["STANDARD","AUTOMATION","AB_TEST"]},"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}]},"workflowStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactListId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactsFilterGroups":{"default":[],"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendOrderByProperty":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},{"type":"null"}]},"abTestConfig":{"anyOf":[{"type":"object","properties":{"variable":{"type":"string","enum":["SUBJECT","FROM_NAME","CONTENT","SEND_TIME"],"description":"What differs across variants: subject, from name, content, or send time."},"samplePercent":{"default":20,"description":"Percent of the audience that receives the sample variants.","type":"number","minimum":1,"maximum":100},"winnerMetric":{"default":"OPEN_RATE","description":"Metric used to pick the winning variant.","type":"string","enum":["OPEN_RATE","CLICK_RATE"]},"winnerWaitHours":{"default":4,"description":"How long to wait after the sample before picking a winner.","type":"number","minimum":0},"winnerWaitUnit":{"default":"HOURS","description":"Unit for winnerWaitHours.","type":"string","enum":["HOURS","MINUTES"]},"sendTimeDelayHours":{"default":2,"description":"Delay between sample sends when variable is SEND_TIME.","type":"number","minimum":0},"sendTimeDelayUnit":{"default":"HOURS","description":"Unit for sendTimeDelayHours.","type":"string","enum":["HOURS","MINUTES"]},"winnerMessageId":{"description":"Winning message id. Set by the runtime after the test resolves.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerSelectedAt":{"description":"ISO timestamp when the winner was selected.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerRolloutAt":{"description":"ISO timestamp when the winner was rolled out to the rest of the list.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerWaitStartedAt":{"description":"ISO timestamp when the winner-wait countdown started.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"default":"AWAITING_SAMPLE","description":"A/B test phase. Omit on create; the runtime advances this.","type":"string","enum":["AWAITING_SAMPLE","AWAITING_WINNER","ROLLED_OUT"]},"samplePaginationEnd":{"description":"Send cursor at the end of the sample phase. Set by the runtime.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["variable","samplePercent","winnerMetric","winnerWaitHours","winnerWaitUnit","sendTimeDelayHours","sendTimeDelayUnit","status"],"additionalProperties":false},{"type":"null"}]},"utmConfig":{"anyOf":[{"type":"object","properties":{"enabled":{"default":true,"description":"When false, links are left untagged.","type":"boolean"},"params":{"default":{"campaign":"","content":"","medium":"","source":"","term":""},"description":"Query-string values appended to http(s) links in the email.","type":"object","properties":{"campaign":{"default":"","description":"utm_campaign. Defaults to the campaign name when utmConfig is omitted.","type":"string"},"content":{"default":"","description":"utm_content.","type":"string"},"medium":{"default":"","description":"utm_medium. Defaults to email.","type":"string"},"source":{"default":"","description":"utm_source. Defaults to saasco.","type":"string"},"term":{"default":"","description":"utm_term.","type":"string"}},"required":["campaign","content","medium","source","term"],"additionalProperties":false}},"required":["enabled","params"],"additionalProperties":false},{"type":"null"}]},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"sendingTargetDurationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"sendPaginationCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"label":{"type":"string"},"fromName":{"type":"string"},"fromEmailUsername":{"type":"string"},"fromDomain":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"type":"string"},"subjectHTML":{"type":"string"},"previewTextHTML":{"type":"string"},"bodyHTML":{"type":"string"},"scheduledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"subjectJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"theme":{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","label","fromName","fromEmailUsername","fromDomain","text","subjectHTML","previewTextHTML","bodyHTML","bodyJSON","previewTextJSON","sendCount","subjectJSON","theme"],"additionalProperties":false}},"bcc":{"description":"@deprecated Use messages[0].bcc","anyOf":[{"type":"string"},{"type":"null"}]},"bodyHTML":{"description":"@deprecated Use messages[0].bodyHTML","anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"description":"@deprecated Use messages[0].bodyJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"cc":{"description":"@deprecated Use messages[0].cc","anyOf":[{"type":"string"},{"type":"null"}]},"fromDomain":{"description":"@deprecated Use messages[0].fromDomain","anyOf":[{"type":"string"},{"type":"null"}]},"fromEmailUsername":{"description":"@deprecated Use messages[0].fromEmailUsername","anyOf":[{"type":"string"},{"type":"null"}]},"fromName":{"description":"@deprecated Use messages[0].fromName","anyOf":[{"type":"string"},{"type":"null"}]},"previewTextHTML":{"description":"@deprecated Use messages[0].previewTextHTML","anyOf":[{"type":"string"},{"type":"null"}]},"previewTextJSON":{"description":"@deprecated Use messages[0].previewTextJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"replyTo":{"description":"@deprecated Use messages[0].replyTo","anyOf":[{"type":"string"},{"type":"null"}]},"scheduledAt":{"description":"@deprecated Use messages[0].scheduledAt","anyOf":[{"type":"string"},{"type":"null"}]},"subjectHTML":{"description":"@deprecated Use messages[0].subjectHTML","anyOf":[{"type":"string"},{"type":"null"}]},"subjectJSON":{"description":"@deprecated Use messages[0].subjectJSON","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"text":{"description":"@deprecated Use messages[0].text","anyOf":[{"type":"string"},{"type":"null"}]},"theme":{"description":"@deprecated Use messages[0].theme","anyOf":[{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","name","status","type","contactsFilterGroups","sendCount","sendPaginationCount","messages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/{campaignId}/stats":{"get":{"operationId":"emailMarketing-emailStats","summary":"Get Email Stats","description":"Aggregate delivery and engagement figures for one campaign: sent, delivered, opened, clicked, bounced, complained, and delivery-delayed. Each comes back as a raw `total`, a `unique` count that collapses repeat events from the same recipient, and a `rate`, so open rate is not just opens divided by sends. For the per-recipient breakdown behind these numbers use List Emails.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the campaign to report on."},"required":true,"description":"ID of the campaign to report on."},{"in":"query","name":"dateFrom","schema":{"type":"string","description":"Only count events on or after this `YYYY-MM-DD` date. Omit for the campaign's whole lifetime."}},{"in":"query","name":"dateTo","schema":{"type":"string","description":"Only count events on or before this `YYYY-MM-DD` date."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"bounced":{"type":"object","properties":{"rate":{"type":"number"},"total":{"type":"number"},"unique":{"type":"number"}},"required":["rate","total","unique"],"additionalProperties":false},"clicked":{"type":"object","properties":{"rate":{"type":"number"},"total":{"type":"number"},"unique":{"type":"number"}},"required":["rate","total","unique"],"additionalProperties":false},"complained":{"type":"object","properties":{"rate":{"type":"number"},"total":{"type":"number"},"unique":{"type":"number"}},"required":["rate","total","unique"],"additionalProperties":false},"delivered":{"type":"object","properties":{"rate":{"type":"number"},"total":{"type":"number"},"unique":{"type":"number"}},"required":["rate","total","unique"],"additionalProperties":false},"deliveryDelayed":{"type":"object","properties":{"rate":{"type":"number"},"total":{"type":"number"},"unique":{"type":"number"}},"required":["rate","total","unique"],"additionalProperties":false},"opened":{"type":"object","properties":{"rate":{"type":"number"},"total":{"type":"number"},"unique":{"type":"number"}},"required":["rate","total","unique"],"additionalProperties":false},"sent":{"type":"object","properties":{"rate":{"type":"number"},"total":{"type":"number"},"unique":{"type":"number"}},"required":["rate","total","unique"],"additionalProperties":false}},"required":["bounced","clicked","complained","delivered","deliveryDelayed","opened","sent"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/{campaignId}/emails/{emailId}":{"get":{"operationId":"emailMarketing-getEmail","summary":"Get Email","description":"Fetches one sent email (its recipient, status, and delivery timestamps) together with the rendered subject and body as that recipient actually received it, personalisation included. The content is fetched from the email provider, so this is heavier than the row returned by List Emails.","tags":["Emails"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the campaign the email belongs to."},"required":true,"description":"ID of the campaign the email belongs to."},{"in":"path","name":"emailId","schema":{"type":"string","description":"ID of the email to fetch."},"required":true,"description":"ID of the email to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"messageId":{"type":"string"},"distinctId":{"type":"string"},"to":{"type":"string"},"contactDistinctId":{"type":"string"},"subject":{"type":"string"},"lastEventAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sent":{"type":"boolean"},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"delivered":{"type":"boolean"},"deliveredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"opened":{"type":"boolean"},"openedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"clicked":{"type":"boolean"},"clickedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bounced":{"type":"boolean"},"bouncedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"complained":{"type":"boolean"},"complainedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"suppressed":{"type":"boolean"},"suppressedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendPhase":{"default":"sample","type":"string","enum":["sample","rollout"]},"status":{"type":"string","enum":["pending","sent","delivered","opened","clicked","bounced","complained","suppressed","deliveryDelayed"]},"html":{"type":"string"},"text":{"type":"string"}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","messageId","distinctId","to","contactDistinctId","subject","sent","delivered","opened","clicked","bounced","complained","suppressed","sendPhase","status","html","text"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/{campaignId}/emails/{emailId}/events":{"get":{"operationId":"emailMarketing-getEmailEvents","summary":"Get Email Events","description":"The delivery timeline for a single email: an ordered list of `{ type, timestamp }` entries covering pending, sent, delivered, opened, clicked, bounced, complained, suppressed, and delivery-delayed. Types can repeat: a recipient who opens twice produces two `opened` entries.","tags":["Emails"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the campaign the email belongs to."},"required":true,"description":"ID of the campaign the email belongs to."},{"in":"path","name":"emailId","schema":{"type":"string","description":"ID of the email whose events to return."},"required":true,"description":"ID of the email whose events to return."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"timestamp":{"type":"string"},"type":{"type":"string","enum":["pending","sent","delivered","opened","clicked","bounced","complained","suppressed","deliveryDelayed"]}},"required":["timestamp","type"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/sender-status":{"get":{"operationId":"emailMarketing-getSenderStatus","summary":"Get Sender Status","description":"Reports whether the project is currently allowed to send email. Saasco blocks sending for projects with poor deliverability or abuse signals; when blocked, `canSend` is false and `statusReason` explains why. Send Email Campaign and Send Test Email both enforce this, so check it before offering a send action in your own UI.","tags":["Sender"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to check."},"required":true,"description":"ID of the project to check."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"canSend":{"type":"boolean"},"status":{"type":"string","enum":["allowed","blocked"]},"statusReason":{"type":"string"}},"required":["canSend","status"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/contacts/{contactDistinctId}/emails":{"get":{"operationId":"emailMarketing-listContactEmails","summary":"List Contact Emails","description":"Every email this project has sent to one contact, across all campaigns: the per-person send history you would show on a contact detail page. Use List Emails instead to work from the campaign side.","tags":["Emails"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that sent the emails."},"required":true,"description":"ID of the project that sent the emails."},{"in":"path","name":"contactDistinctId","schema":{"type":"string","description":"Distinct ID of the contact whose emails to list."},"required":true,"description":"Distinct ID of the contact whose emails to list."},{"in":"query","name":"skip","schema":{"type":"number","description":"Number of emails to skip before collecting results."}},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["sentAt","deliveredAt","openedAt","clickedAt","bouncedAt","suppressedAt","to","status","lastEventAt"],"description":"Field to sort by, e.g. `sentAt` or `lastEventAt`."}},{"in":"query","name":"sortOrder","schema":{"type":"string","enum":["asc","desc"],"description":"Sort direction."}},{"in":"query","name":"take","schema":{"type":"number","description":"Maximum number of emails to return."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"messageId":{"type":"string"},"distinctId":{"type":"string"},"to":{"type":"string"},"contactDistinctId":{"type":"string"},"subject":{"type":"string"},"lastEventAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sent":{"type":"boolean"},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"delivered":{"type":"boolean"},"deliveredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"opened":{"type":"boolean"},"openedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"clicked":{"type":"boolean"},"clickedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bounced":{"type":"boolean"},"bouncedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"complained":{"type":"boolean"},"complainedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"suppressed":{"type":"boolean"},"suppressedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendPhase":{"default":"sample","type":"string","enum":["sample","rollout"]},"status":{"type":"string","enum":["pending","sent","delivered","opened","clicked","bounced","complained","suppressed","deliveryDelayed"]}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","messageId","distinctId","to","contactDistinctId","subject","sent","delivered","opened","clicked","bounced","complained","suppressed","sendPhase","status"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/{campaignId}/emails":{"get":{"operationId":"emailMarketing-listEmails","summary":"List Emails","description":"The per-recipient send log for one campaign: who it went to, current status, and delivery timestamps. Paginated, and returns `total` alongside the rows so you can page without a second call. Filter by `status` to answer questions like \"who bounced\", or by `messageId` / `sendPhase` to isolate one side of an A/B test.","tags":["Emails"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the campaign whose emails to list."},"required":true,"description":"ID of the campaign whose emails to list."},{"in":"query","name":"dateFrom","schema":{"type":"string","description":"Only include emails sent on or after this `YYYY-MM-DD` date."}},{"in":"query","name":"dateTo","schema":{"type":"string","description":"Only include emails sent on or before this `YYYY-MM-DD` date."}},{"in":"query","name":"messageId","schema":{"type":"string","description":"Only include emails sent from this campaign message, one A/B variant, for example."}},{"in":"query","name":"sendPhase","schema":{"type":"string","enum":["sample","rollout"],"description":"For A/B campaigns, restrict to one phase: `sample` for the initial test split, `rollout` for the winning variant sent to the remaining audience."}},{"in":"query","name":"skip","schema":{"type":"number","description":"Number of emails to skip before collecting results."}},{"in":"query","name":"sortBy","schema":{"type":"string","enum":["sentAt","deliveredAt","openedAt","clickedAt","bouncedAt","suppressedAt","to","status","lastEventAt"],"description":"Field to sort by, e.g. `sentAt` or `lastEventAt`."}},{"in":"query","name":"sortOrder","schema":{"type":"string","enum":["asc","desc"],"description":"Sort direction."}},{"in":"query","name":"status","schema":{"type":"string","enum":["pending","sent","delivered","opened","clicked","bounced","complained","suppressed","deliveryDelayed"],"description":"Only include emails currently in this delivery state, e.g. `bounced` or `opened`."}},{"in":"query","name":"take","schema":{"type":"number","description":"Maximum number of emails to return."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"messageId":{"type":"string"},"distinctId":{"type":"string"},"to":{"type":"string"},"contactDistinctId":{"type":"string"},"subject":{"type":"string"},"lastEventAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sent":{"type":"boolean"},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"delivered":{"type":"boolean"},"deliveredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"opened":{"type":"boolean"},"openedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"clicked":{"type":"boolean"},"clickedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bounced":{"type":"boolean"},"bouncedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"complained":{"type":"boolean"},"complainedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"suppressed":{"type":"boolean"},"suppressedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendPhase":{"default":"sample","type":"string","enum":["sample","rollout"]},"status":{"type":"string","enum":["pending","sent","delivered","opened","clicked","bounced","complained","suppressed","deliveryDelayed"]}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","messageId","distinctId","to","contactDistinctId","subject","sent","delivered","opened","clicked","bounced","complained","suppressed","sendPhase","status"],"additionalProperties":false}},"total":{"type":"number"}},"required":["emails","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/{campaignId}/resume":{"post":{"operationId":"emailMarketing-resumeSendingCampaign","summary":"Resume Sending Email Campaign","description":"Resumes a paused campaign. Sending continues from the contact pagination cursor where it stopped, so recipients already sent to are not emailed twice. Requires sufficient project balance and an unblocked sender, the same as Send Email Campaign.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the paused campaign to resume."},"required":true,"description":"ID of the paused campaign to resume."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","SENDING","SENT","PAUSED","CANCELLED"]},"type":{"default":"STANDARD","type":"string","enum":["STANDARD","AUTOMATION","AB_TEST"]},"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}]},"workflowStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactListId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactsFilterGroups":{"default":[],"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendOrderByProperty":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},{"type":"null"}]},"abTestConfig":{"anyOf":[{"type":"object","properties":{"variable":{"type":"string","enum":["SUBJECT","FROM_NAME","CONTENT","SEND_TIME"],"description":"What differs across variants: subject, from name, content, or send time."},"samplePercent":{"default":20,"description":"Percent of the audience that receives the sample variants.","type":"number","minimum":1,"maximum":100},"winnerMetric":{"default":"OPEN_RATE","description":"Metric used to pick the winning variant.","type":"string","enum":["OPEN_RATE","CLICK_RATE"]},"winnerWaitHours":{"default":4,"description":"How long to wait after the sample before picking a winner.","type":"number","minimum":0},"winnerWaitUnit":{"default":"HOURS","description":"Unit for winnerWaitHours.","type":"string","enum":["HOURS","MINUTES"]},"sendTimeDelayHours":{"default":2,"description":"Delay between sample sends when variable is SEND_TIME.","type":"number","minimum":0},"sendTimeDelayUnit":{"default":"HOURS","description":"Unit for sendTimeDelayHours.","type":"string","enum":["HOURS","MINUTES"]},"winnerMessageId":{"description":"Winning message id. Set by the runtime after the test resolves.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerSelectedAt":{"description":"ISO timestamp when the winner was selected.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerRolloutAt":{"description":"ISO timestamp when the winner was rolled out to the rest of the list.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerWaitStartedAt":{"description":"ISO timestamp when the winner-wait countdown started.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"default":"AWAITING_SAMPLE","description":"A/B test phase. Omit on create; the runtime advances this.","type":"string","enum":["AWAITING_SAMPLE","AWAITING_WINNER","ROLLED_OUT"]},"samplePaginationEnd":{"description":"Send cursor at the end of the sample phase. Set by the runtime.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["variable","samplePercent","winnerMetric","winnerWaitHours","winnerWaitUnit","sendTimeDelayHours","sendTimeDelayUnit","status"],"additionalProperties":false},{"type":"null"}]},"utmConfig":{"anyOf":[{"type":"object","properties":{"enabled":{"default":true,"description":"When false, links are left untagged.","type":"boolean"},"params":{"default":{"campaign":"","content":"","medium":"","source":"","term":""},"description":"Query-string values appended to http(s) links in the email.","type":"object","properties":{"campaign":{"default":"","description":"utm_campaign. Defaults to the campaign name when utmConfig is omitted.","type":"string"},"content":{"default":"","description":"utm_content.","type":"string"},"medium":{"default":"","description":"utm_medium. Defaults to email.","type":"string"},"source":{"default":"","description":"utm_source. Defaults to saasco.","type":"string"},"term":{"default":"","description":"utm_term.","type":"string"}},"required":["campaign","content","medium","source","term"],"additionalProperties":false}},"required":["enabled","params"],"additionalProperties":false},{"type":"null"}]},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"sendingTargetDurationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"sendPaginationCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"label":{"type":"string"},"fromName":{"type":"string"},"fromEmailUsername":{"type":"string"},"fromDomain":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"type":"string"},"subjectHTML":{"type":"string"},"previewTextHTML":{"type":"string"},"bodyHTML":{"type":"string"},"scheduledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"subjectJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"theme":{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","label","fromName","fromEmailUsername","fromDomain","text","subjectHTML","previewTextHTML","bodyHTML","bodyJSON","previewTextJSON","sendCount","subjectJSON","theme"],"additionalProperties":false}}},"required":["id","createdAt","updatedAt","projectId","name","status","type","contactsFilterGroups","sendCount","sendPaginationCount","messages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/{campaignId}/send":{"post":{"operationId":"emailMarketing-sendCampaign","summary":"Send Email Campaign","description":"Starts sending a campaign to its audience. The campaign is validated first (missing subject, sender, or audience returns 400 with the specific problems listed) and the project must have an unblocked sender and enough balance. Sending then runs in the background in batches, so a 200 means the send has started, not that it has finished; poll Get Email Campaign for progress. Emails already on their way cannot be recalled.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the campaign to send."},"required":true,"description":"ID of the campaign to send."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/emails/send-test":{"post":{"operationId":"emailMarketing-sendTestEmail","summary":"Send Test Email","description":"Sends a one-off preview of a campaign message to specific contacts, rendered with their data so personalisation can be checked before the real send. Note the unusual shape: the campaign, message, and project are passed in the request body rather than looked up by ID, so this can preview unsaved edits. Test sends do not touch campaign status or stats, but they do consume balance and respect sender blocking.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project sending the test."},"required":true,"description":"ID of the project sending the test."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","SENDING","SENT","PAUSED","CANCELLED"]},"type":{"default":"STANDARD","type":"string","enum":["STANDARD","AUTOMATION","AB_TEST"]},"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}]},"workflowStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactListId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactsFilterGroups":{"default":[],"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","operator","value"]},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"]}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"]}},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendOrderByProperty":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"]},{"type":"null"}]},"abTestConfig":{"anyOf":[{"type":"object","properties":{"variable":{"type":"string","enum":["SUBJECT","FROM_NAME","CONTENT","SEND_TIME"],"description":"What differs across variants: subject, from name, content, or send time."},"samplePercent":{"default":20,"description":"Percent of the audience that receives the sample variants.","type":"number","minimum":1,"maximum":100},"winnerMetric":{"default":"OPEN_RATE","description":"Metric used to pick the winning variant.","type":"string","enum":["OPEN_RATE","CLICK_RATE"]},"winnerWaitHours":{"default":4,"description":"How long to wait after the sample before picking a winner.","type":"number","minimum":0},"winnerWaitUnit":{"default":"HOURS","description":"Unit for winnerWaitHours.","type":"string","enum":["HOURS","MINUTES"]},"sendTimeDelayHours":{"default":2,"description":"Delay between sample sends when variable is SEND_TIME.","type":"number","minimum":0},"sendTimeDelayUnit":{"default":"HOURS","description":"Unit for sendTimeDelayHours.","type":"string","enum":["HOURS","MINUTES"]},"winnerMessageId":{"description":"Winning message id. Set by the runtime after the test resolves.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerSelectedAt":{"description":"ISO timestamp when the winner was selected.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerRolloutAt":{"description":"ISO timestamp when the winner was rolled out to the rest of the list.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerWaitStartedAt":{"description":"ISO timestamp when the winner-wait countdown started.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"default":"AWAITING_SAMPLE","description":"A/B test phase. Omit on create; the runtime advances this.","type":"string","enum":["AWAITING_SAMPLE","AWAITING_WINNER","ROLLED_OUT"]},"samplePaginationEnd":{"description":"Send cursor at the end of the sample phase. Set by the runtime.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["variable"]},{"type":"null"}]},"utmConfig":{"anyOf":[{"type":"object","properties":{"enabled":{"default":true,"description":"When false, links are left untagged.","type":"boolean"},"params":{"default":{"campaign":"","content":"","medium":"","source":"","term":""},"description":"Query-string values appended to http(s) links in the email.","type":"object","properties":{"campaign":{"default":"","description":"utm_campaign. Defaults to the campaign name when utmConfig is omitted.","type":"string"},"content":{"default":"","description":"utm_content.","type":"string"},"medium":{"default":"","description":"utm_medium. Defaults to email.","type":"string"},"source":{"default":"","description":"utm_source. Defaults to saasco.","type":"string"},"term":{"default":"","description":"utm_term.","type":"string"}}}}},{"type":"null"}]},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"sendingTargetDurationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"sendPaginationCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"label":{"type":"string"},"fromName":{"type":"string"},"fromEmailUsername":{"type":"string"},"fromDomain":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"type":"string"},"subjectHTML":{"type":"string"},"previewTextHTML":{"type":"string"},"bodyHTML":{"type":"string"},"scheduledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"subjectJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"theme":{"anyOf":[{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"]},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"]},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"]},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]}},"required":["h1","h2","h3","p"]}},"required":["body","button","link","template","typography"]},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","label","fromName","fromEmailUsername","fromDomain","text","subjectHTML","previewTextHTML","bodyHTML","bodyJSON","previewTextJSON","subjectJSON"]}}},"required":["id","createdAt","updatedAt","projectId","name","status"],"description":"The campaign to preview. Passed in full rather than by ID so unsaved changes can be tested."},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$subscribed":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"anyOf":[{"type":"boolean"},{"type":"string"}]},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"]},"description":"Contacts to send the preview to. Their properties drive personalisation, so use real contacts to see realistic output."},"message":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"label":{"type":"string"},"fromName":{"type":"string"},"fromEmailUsername":{"type":"string"},"fromDomain":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"type":"string"},"subjectHTML":{"type":"string"},"previewTextHTML":{"type":"string"},"bodyHTML":{"type":"string"},"scheduledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"subjectJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"theme":{"anyOf":[{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"]},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"]},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"]},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"]}},"required":["h1","h2","h3","p"]}},"required":["body","button","link","template","typography"]},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","label","fromName","fromEmailUsername","fromDomain","text","subjectHTML","previewTextHTML","bodyHTML","bodyJSON","previewTextJSON","subjectJSON"],"description":"The specific message (subject, body, sender) to render. Pick one variant for an A/B campaign."},"project":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"balance":{"type":"number"},"balanceVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbnail":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"testStripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoTopUpEnabled":{"type":"boolean"},"meta":{"anyOf":[{"type":"object","properties":{"completedSetupSteps":{"type":"array","items":{"type":"string","enum":["sdk","event","domain","team"]}},"contactListVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"]}},"defaultEmailCampaignSendOrder":{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"]},"defaultEmailFromDomain":{"type":"string"},"defaultEmailFromName":{"type":"string"},"defaultEmailFromUsername":{"type":"string"},"hasCompletedOnboarding":{"type":"boolean"},"knowledgeArticlesVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"]}},"timezone":{"type":"string","minLength":1,"maxLength":64},"useCases":{"type":"array","items":{"type":"string","enum":["onboarding","support","marketing"]}}}},{"type":"null"}]},"autoTopUpAmount":{"anyOf":[{"type":"number","minimum":20},{"type":"null"}]},"autoTopUpThreshold":{"anyOf":[{"type":"number","minimum":10},{"type":"null"}]}},"required":["id","createdAt","updatedAt","name","slug","balance","balanceVersion","autoTopUpEnabled"],"description":"The sending project, supplying branding and sender identity for the render."}},"required":["campaign","contacts","message","project"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"success":{"type":"boolean"}},"required":["message","success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/email-campaigns/{campaignId}/stop":{"post":{"operationId":"emailMarketing-stopSendingCampaign","summary":"Stop Sending Email Campaign","description":"Pauses a campaign that is currently sending. Any in-flight batch is cancelled and the campaign moves to PAUSED, keeping its pagination cursor so Resume Sending Email Campaign can pick up where it stopped. Emails already handed to the provider still go out.","tags":["Campaigns"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the campaign."},"required":true,"description":"ID of the project that owns the campaign."},{"in":"path","name":"campaignId","schema":{"type":"string","description":"ID of the sending campaign to pause."},"required":true,"description":"ID of the sending campaign to pause."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SCHEDULED","SENDING","SENT","PAUSED","CANCELLED"]},"type":{"default":"STANDARD","type":"string","enum":["STANDARD","AUTOMATION","AB_TEST"]},"workflowId":{"anyOf":[{"type":"string"},{"type":"null"}]},"workflowStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactListId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactsFilterGroups":{"default":[],"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendOrderByProperty":{"anyOf":[{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},{"type":"null"}]},"abTestConfig":{"anyOf":[{"type":"object","properties":{"variable":{"type":"string","enum":["SUBJECT","FROM_NAME","CONTENT","SEND_TIME"],"description":"What differs across variants: subject, from name, content, or send time."},"samplePercent":{"default":20,"description":"Percent of the audience that receives the sample variants.","type":"number","minimum":1,"maximum":100},"winnerMetric":{"default":"OPEN_RATE","description":"Metric used to pick the winning variant.","type":"string","enum":["OPEN_RATE","CLICK_RATE"]},"winnerWaitHours":{"default":4,"description":"How long to wait after the sample before picking a winner.","type":"number","minimum":0},"winnerWaitUnit":{"default":"HOURS","description":"Unit for winnerWaitHours.","type":"string","enum":["HOURS","MINUTES"]},"sendTimeDelayHours":{"default":2,"description":"Delay between sample sends when variable is SEND_TIME.","type":"number","minimum":0},"sendTimeDelayUnit":{"default":"HOURS","description":"Unit for sendTimeDelayHours.","type":"string","enum":["HOURS","MINUTES"]},"winnerMessageId":{"description":"Winning message id. Set by the runtime after the test resolves.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerSelectedAt":{"description":"ISO timestamp when the winner was selected.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerRolloutAt":{"description":"ISO timestamp when the winner was rolled out to the rest of the list.","anyOf":[{"type":"string"},{"type":"null"}]},"winnerWaitStartedAt":{"description":"ISO timestamp when the winner-wait countdown started.","anyOf":[{"type":"string"},{"type":"null"}]},"status":{"default":"AWAITING_SAMPLE","description":"A/B test phase. Omit on create; the runtime advances this.","type":"string","enum":["AWAITING_SAMPLE","AWAITING_WINNER","ROLLED_OUT"]},"samplePaginationEnd":{"description":"Send cursor at the end of the sample phase. Set by the runtime.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["variable","samplePercent","winnerMetric","winnerWaitHours","winnerWaitUnit","sendTimeDelayHours","sendTimeDelayUnit","status"],"additionalProperties":false},{"type":"null"}]},"utmConfig":{"anyOf":[{"type":"object","properties":{"enabled":{"default":true,"description":"When false, links are left untagged.","type":"boolean"},"params":{"default":{"campaign":"","content":"","medium":"","source":"","term":""},"description":"Query-string values appended to http(s) links in the email.","type":"object","properties":{"campaign":{"default":"","description":"utm_campaign. Defaults to the campaign name when utmConfig is omitted.","type":"string"},"content":{"default":"","description":"utm_content.","type":"string"},"medium":{"default":"","description":"utm_medium. Defaults to email.","type":"string"},"source":{"default":"","description":"utm_source. Defaults to saasco.","type":"string"},"term":{"default":"","description":"utm_term.","type":"string"}},"required":["campaign","content","medium","source","term"],"additionalProperties":false}},"required":["enabled","params"],"additionalProperties":false},{"type":"null"}]},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"sendingTargetDurationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"sendPaginationCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"messages":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"emailCampaignId":{"type":"string"},"label":{"type":"string"},"fromName":{"type":"string"},"fromEmailUsername":{"type":"string"},"fromDomain":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"type":"string"},"subjectHTML":{"type":"string"},"previewTextHTML":{"type":"string"},"bodyHTML":{"type":"string"},"scheduledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSuccessContactCreatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"bodyJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"previewTextJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"sendCount":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"subjectJSON":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"theme":{"type":"object","properties":{"body":{"type":"object","properties":{"align":{"anyOf":[{"type":"string","const":"left"},{"type":"string","const":"center"},{"type":"string","const":"right"}]},"background":{"type":"string"},"container":{"type":"string"}},"required":["align","background","container"],"additionalProperties":false},"button":{"type":"object","properties":{"background":{"type":"string"},"borderColor":{"type":"string"},"borderSize":{"type":"number"},"color":{"type":"string"},"radius":{"type":"number"}},"required":["background","borderColor","borderSize","color","radius"],"additionalProperties":false},"link":{"type":"object","properties":{"color":{"type":"string"}},"required":["color"],"additionalProperties":false},"template":{"type":"string"},"typography":{"type":"object","properties":{"h1":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h2":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"h3":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false},"p":{"type":"object","properties":{"color":{"type":"string"},"fontSize":{"type":"number"},"lineHeight":{"type":"number"}},"required":["color","fontSize","lineHeight"],"additionalProperties":false}},"required":["h1","h2","h3","p"],"additionalProperties":false}},"required":["body","button","link","template","typography"],"additionalProperties":false}},"required":["id","createdAt","updatedAt","projectId","emailCampaignId","label","fromName","fromEmailUsername","fromDomain","text","subjectHTML","previewTextHTML","bodyHTML","bodyJSON","previewTextJSON","sendCount","subjectJSON","theme"],"additionalProperties":false}}},"required":["id","createdAt","updatedAt","projectId","name","status","type","contactsFilterGroups","sendCount","sendPaginationCount","messages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/files":{"post":{"operationId":"files-createFile","summary":"Create File","tags":["Files"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileUrl":{"type":"string"},"fileSizeInBytes":{"type":"number"}},"required":["fileUrl","fileSizeInBytes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"files-listFiles","summary":"List Files","tags":["Files"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"query","name":"cursor","schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"in":"query","name":"kind","schema":{"default":"all","type":"string","enum":["all","image","video","other"]}},{"in":"query","name":"limit","schema":{"default":30,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"search","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"fileUrl":{"type":"string"},"projectId":{"type":"string"},"fileSizeInBytes":{"type":"number"}},"required":["id","createdAt","updatedAt","fileUrl","projectId","fileSizeInBytes"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["files","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/files/{fileId}":{"delete":{"operationId":"files-deleteFile","summary":"Delete File","tags":["Files"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"fileId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"files-getSignedUrl","summary":"Get Signed Url","tags":["Files"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"fileId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/files/upload-image":{"post":{"operationId":"files-uploadImage","summary":"Upload Image","tags":["Files"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contentType":{"type":"string","minLength":1},"dataBase64":{"type":"string","minLength":1},"fileName":{"type":"string","minLength":1,"maxLength":200},"pathPrefix":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[a-zA-Z0-9_-]+$"},"registerAsProjectFile":{"default":true,"type":"boolean"}},"required":["contentType","dataBase64"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"fileUrl":{"type":"string","format":"uri"}},"required":["fileUrl"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/files/upload":{"post":{"operationId":"files-uploadFile","summary":"Upload File","tags":["Files"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contentType":{"type":"string","minLength":1},"dataBase64":{"type":"string","minLength":1},"fileName":{"type":"string","minLength":1,"maxLength":200},"pathPrefix":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[a-zA-Z0-9_-]+$"},"registerAsProjectFile":{"default":true,"type":"boolean"}},"required":["contentType","dataBase64"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"fileUrl":{"type":"string","format":"uri"}},"required":["fileUrl"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/knowledge/articles/{articleId}/reactions":{"post":{"operationId":"knowledge-addReaction","summary":"Add Article Reaction","description":"Records a reader's helpfulness rating on an article, incrementing that article's happy, neutral, or sad counter. Public and unauthenticated, so it can be called straight from a help-center page. There is no deduplication. The same reader can react repeatedly.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"articleId","schema":{"type":"string","description":"ID of the article being reacted to."},"required":true,"description":"ID of the article being reacted to."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reaction":{"type":"string","enum":["happy","neutral","sad"],"description":"How helpful the reader found the article."}},"required":["reaction"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"boolean"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/articles":{"post":{"operationId":"knowledge-createArticle","summary":"Create Article","description":"Creates a knowledge-base article. The URL slug is generated from the title rather than supplied. Public articles belong to a collection and appear on the help center once published; internal articles are not browsable and exist to answer support questions. Requires a logged-in user. The caller becomes the article's author, so an API key alone is not enough.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that will own the article."},"required":true,"description":"ID of the project that will own the article."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["public","internal"],"description":"Audience for the article: public articles appear on the help center, internal ones are only used to answer support questions."},"title":{"type":"string","minLength":1,"description":"Article title."},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"type":"string","enum":["draft","published"],"description":"Publication state. Only published articles are visible on the help center or returned by public search."},"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["type","title","body","state"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"type":{"default":"public","type":"string","enum":["public","internal"]},"title":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"default":"draft","type":"string","enum":["draft","published"]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorId":{"type":"string"},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"happyReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"neutralReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sadReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","projectId","type","title","slug","body","state","order","authorId","views","conversions","happyReactions","neutralReactions","sadReactions"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"knowledge-listArticles","summary":"List Articles","description":"Lists a project's articles for management views, covering drafts and internal articles that never appear in public search. Paginated, returning `data` alongside a `total` for the filter you applied.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to list articles from."},"required":true,"description":"ID of the project to list articles from."},{"in":"query","name":"collectionId","schema":{"type":"string","description":"Only return articles in this collection."}},{"in":"query","name":"helpCenterId","schema":{"type":"string","description":"Only return articles belonging to this help center."}},{"in":"query","name":"orderBy","schema":{"type":"string","description":"Article field to sort by, e.g. `createdAt` or `title`."}},{"in":"query","name":"orderDirection","schema":{"type":"string","enum":["asc","desc"],"description":"Sort direction."}},{"in":"query","name":"skip","schema":{"type":"number","description":"Number of articles to skip before collecting results."}},{"in":"query","name":"state","schema":{"type":"string","enum":["draft","published"],"description":"Only return articles in this publication state."}},{"in":"query","name":"take","schema":{"type":"number","description":"Maximum number of articles to return."}},{"in":"query","name":"type","schema":{"type":"string","enum":["public","internal"],"description":"Only return articles for this audience: `public` for help-center content, `internal` for articles used solely to answer support questions."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"type":{"default":"public","type":"string","enum":["public","internal"]},"title":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"default":"draft","type":"string","enum":["draft","published"]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorId":{"type":"string"},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"happyReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"neutralReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sadReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},{"type":"null"}]},"collection":{"anyOf":[{"type":"object","properties":{"helpCenterId":{"type":"string"},"name":{"type":"string"}},"required":["helpCenterId","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","type","title","slug","body","state","order","authorId","views","conversions","happyReactions","neutralReactions","sadReactions"],"additionalProperties":false}},"total":{"type":"number"}},"required":["data","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/collections":{"post":{"operationId":"knowledge-createCollection","summary":"Create Collection","description":"Creates a collection: the folder that groups articles in a help center's navigation. Collections can nest via `parentId`, up to 3 levels deep.","tags":["Collections"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that will own the collection."},"required":true,"description":"ID of the project that will own the collection."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"helpCenterId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["helpCenterId","name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"helpCenterId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","helpCenterId","name","order"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"knowledge-listCollections","summary":"List Collections","description":"Lists a help center's collections, each with its articles and nested child collections, for building the navigation tree. Includes drafts and internal articles. Use List Public Collections for the reader-facing version.","tags":["Collections"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the help center."},"required":true,"description":"ID of the project that owns the help center."},{"in":"query","name":"helpCenterId","schema":{"type":"string","description":"ID of the help center whose collections to list."},"required":true,"description":"ID of the help center whose collections to list."},{"in":"query","name":"parentId","schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only return children of this collection. Pass `null` for top-level collections; omit for all of them."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/__schema2"}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/help-centers":{"post":{"operationId":"knowledge-createHelpCenter","summary":"Create Help Center","description":"Creates a help center: the public site that hosts a project's collections and articles. It starts on a Saasco-hosted URL; attach your own hostname afterwards with Set Help Center Custom Domain.","tags":["Help Center"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that will own the help center."},"required":true,"description":"ID of the project that will own the help center."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string"},"googleAnalyticsId":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteEnabled":{"default":true,"type":"boolean"},"theme":{"anyOf":[{"type":"object","properties":{"backgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"secondaryFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"cornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"showArticleAuthors":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"]}},{"type":"null"}]},"headerBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"headerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroWelcomeMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"heroBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"heroTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroHeight":{"anyOf":[{"type":"number","minimum":200,"maximum":800},{"type":"null"}]},"heroSearchBarWidth":{"anyOf":[{"type":"number","minimum":300,"maximum":1000},{"type":"null"}]},"heroAlignment":{"anyOf":[{"type":"string","enum":["left","center","right"]},{"type":"null"}]},"heroCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"collectionsShowDescriptions":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowToc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowRelated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"cardStyle":{"anyOf":[{"type":"string","enum":["card","floating"]},{"type":"null"}]},"cardDisplayMode":{"anyOf":[{"type":"string","enum":["default","compact","minimal"]},{"type":"null"}]},"cardShowMedia":{"anyOf":[{"type":"string","enum":["icon","image","none"]},{"type":"null"}]},"cardColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sectionOrder":{"anyOf":[{"type":"array","items":{"type":"string","enum":["articles","collections","tickets","content"]}},{"type":"null"}]},"articlesSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ticketsSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articlesSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"articlesSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"articlesSectionArticleIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"collectionsSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"collectionsSectionStyle":{"anyOf":[{"type":"string","enum":["classic","visual","compact"]},{"type":"null"}]},"collectionsIconColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconColors":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"collectionsIconBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"collectionsIconBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconBackgroundType":{"anyOf":[{"type":"string","enum":["color","gradient"]},{"type":"null"}]},"collectionsIconGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionTitleColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescriptionColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionStyle":{"anyOf":[{"type":"string","enum":["card","full"]},{"type":"null"}]},"contentSectionBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"contentSectionBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionButtonEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionButtonText":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"contentSectionButtonColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"footerLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerLayout":{"anyOf":[{"type":"string","enum":["simple","classic","multi_level"]},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerSocialDisplay":{"anyOf":[{"type":"string","enum":["label","icon"]},{"type":"null"}]},"footerSocialLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"url":{"type":"string"}},"required":["platform","url"]}},{"type":"null"}]},"footerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"]}},{"type":"null"}]},"footerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}},"required":["displayName"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"displayName":{"type":"string"},"url":{"type":"string"},"customDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"customDomainVerified":{"type":"boolean"},"customDomainVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"googleAnalyticsId":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteEnabled":{"default":true,"type":"boolean"},"theme":{"anyOf":[{"type":"object","properties":{"backgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"secondaryFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"cornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"showArticleAuthors":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"headerBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"headerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroWelcomeMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"heroBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"heroTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroHeight":{"anyOf":[{"type":"number","minimum":200,"maximum":800},{"type":"null"}]},"heroSearchBarWidth":{"anyOf":[{"type":"number","minimum":300,"maximum":1000},{"type":"null"}]},"heroAlignment":{"anyOf":[{"type":"string","enum":["left","center","right"]},{"type":"null"}]},"heroCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"collectionsShowDescriptions":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowToc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowRelated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"cardStyle":{"anyOf":[{"type":"string","enum":["card","floating"]},{"type":"null"}]},"cardDisplayMode":{"anyOf":[{"type":"string","enum":["default","compact","minimal"]},{"type":"null"}]},"cardShowMedia":{"anyOf":[{"type":"string","enum":["icon","image","none"]},{"type":"null"}]},"cardColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sectionOrder":{"anyOf":[{"type":"array","items":{"type":"string","enum":["articles","collections","tickets","content"]}},{"type":"null"}]},"articlesSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ticketsSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articlesSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"articlesSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"articlesSectionArticleIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"collectionsSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"collectionsSectionStyle":{"anyOf":[{"type":"string","enum":["classic","visual","compact"]},{"type":"null"}]},"collectionsIconColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconColors":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"collectionsIconBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"collectionsIconBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconBackgroundType":{"anyOf":[{"type":"string","enum":["color","gradient"]},{"type":"null"}]},"collectionsIconGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionTitleColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescriptionColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionStyle":{"anyOf":[{"type":"string","enum":["card","full"]},{"type":"null"}]},"contentSectionBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"contentSectionBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionButtonEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionButtonText":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"contentSectionButtonColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"footerLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerLayout":{"anyOf":[{"type":"string","enum":["simple","classic","multi_level"]},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerSocialDisplay":{"anyOf":[{"type":"string","enum":["label","icon"]},{"type":"null"}]},"footerSocialLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"url":{"type":"string"}},"required":["platform","url"],"additionalProperties":false}},{"type":"null"}]},"footerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"footerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","displayName","url","customDomainVerified","websiteEnabled"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/articles/{id}":{"delete":{"operationId":"knowledge-deleteArticle","summary":"Delete Article","description":"Permanently deletes an article and the screenshots it uploaded. Idempotent: deleting an article that does not exist still returns `true` rather than 404, so the response is not a reliable existence check. Cannot be undone.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the article."},"required":true,"description":"ID of the project that owns the article."},{"in":"path","name":"id","schema":{"type":"string","description":"ID of the article to delete."},"required":true,"description":"ID of the article to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"boolean"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"knowledge-getArticle","summary":"Get Article","description":"Fetches one article by ID for editing, including drafts and internal articles. Returns `null` rather than 404 when nothing matches. Use Get Public Article for the reader-facing lookup, which is by slug and only returns published content.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the article."},"required":true,"description":"ID of the project that owns the article."},{"in":"path","name":"id","schema":{"type":"string","description":"ID of the article to fetch."},"required":true,"description":"ID of the article to fetch."},{"in":"query","name":"helpCenterId","schema":{"type":"string","description":"Only return the article if it belongs to this help center. Omit to search the whole project."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"type":{"default":"public","type":"string","enum":["public","internal"]},"title":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"default":"draft","type":"string","enum":["draft","published"]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorId":{"type":"string"},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"happyReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"neutralReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sadReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},{"type":"null"}]},"collection":{"anyOf":[{"type":"object","properties":{"helpCenterId":{"type":"string"},"name":{"type":"string"}},"required":["helpCenterId","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","type","title","slug","body","state","order","authorId","views","conversions","happyReactions","neutralReactions","sadReactions"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"knowledge-updateArticle","summary":"Update Article","description":"Updates an article. Despite the PUT, only the fields present in the body are written. Two side effects are worth knowing: changing the title regenerates the URL slug, which breaks existing links to the article; and switching `type` to `internal` clears its collection, removing it from help-center navigation. Moving between `draft` and `published` is what controls public visibility.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the article."},"required":true,"description":"ID of the project that owns the article."},{"in":"path","name":"id","schema":{"type":"string","description":"ID of the article to update."},"required":true,"description":"ID of the article to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"authorId":{"type":"string"},"body":{"type":"string"},"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"state":{"type":"string","enum":["draft","published"]},"type":{"type":"string","enum":["public","internal"]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"type":"string","minLength":1,"description":"Article title. Omit to leave unchanged."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"type":{"default":"public","type":"string","enum":["public","internal"]},"title":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"default":"draft","type":"string","enum":["draft","published"]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorId":{"type":"string"},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"happyReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"neutralReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sadReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","projectId","type","title","slug","body","state","order","authorId","views","conversions","happyReactions","neutralReactions","sadReactions"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/collections/{id}":{"delete":{"operationId":"knowledge-deleteCollection","summary":"Delete Collection","description":"Deletes a collection. Its articles are **not** deleted. They are unlinked, which drops them out of help-center navigation while leaving the content intact, reachable only by direct search. Move articles to another collection first if you want them to stay browsable. Idempotent: deleting a collection that does not exist still returns `true`.","tags":["Collections"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the collection."},"required":true,"description":"ID of the project that owns the collection."},{"in":"path","name":"id","schema":{"type":"string","description":"ID of the collection to delete."},"required":true,"description":"ID of the collection to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"boolean"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"knowledge-getCollection","summary":"Get Collection","description":"Fetches a single collection by ID. Returns `null` rather than 404 when nothing matches.","tags":["Collections"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the collection."},"required":true,"description":"ID of the project that owns the collection."},{"in":"path","name":"id","schema":{"type":"string","description":"ID of the collection to fetch."},"required":true,"description":"ID of the collection to fetch."},{"in":"query","name":"helpCenterId","schema":{"type":"string","description":"ID of the help center the collection belongs to."},"required":true,"description":"ID of the help center the collection belongs to."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"helpCenterId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","helpCenterId","name","order"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"knowledge-updateCollection","summary":"Update Collection","description":"Updates a collection's name, description, icon, or position. Only the fields present in the body are written. Re-parent it by setting `parentId`, keeping within the 3-level nesting limit.","tags":["Collections"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the collection."},"required":true,"description":"ID of the project that owns the collection."},{"in":"path","name":"id","schema":{"type":"string","description":"ID of the collection to update."},"required":true,"description":"ID of the collection to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"helpCenterId":{"type":"string"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"helpCenterId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","helpCenterId","name","order"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/help-centers/{id}":{"delete":{"operationId":"knowledge-deleteHelpCenter","summary":"Delete Help Center","description":"Deletes a help center and every collection inside it. Articles survive but are unlinked from their collections, so they disappear from navigation while their content remains. Returns 404 if the help center does not exist. Cannot be undone.","tags":["Help Center"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the help center."},"required":true,"description":"ID of the project that owns the help center."},{"in":"path","name":"id","schema":{"type":"string","description":"ID of the help center to delete."},"required":true,"description":"ID of the help center to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"boolean"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"knowledge-updateHelpCenter","summary":"Update Help Center","description":"Updates a help center's presentation and settings: display name, theme, Google Analytics ID, and whether the public site is enabled. Only the fields present in the body are written. Custom domains are managed separately through the domain endpoints.","tags":["Help Center"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the help center."},"required":true,"description":"ID of the project that owns the help center."},{"in":"path","name":"id","schema":{"type":"string","description":"ID of the help center to update."},"required":true,"description":"ID of the help center to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string"},"googleAnalyticsId":{"anyOf":[{"type":"string"},{"type":"null"}]},"theme":{"anyOf":[{"type":"object","properties":{"backgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"secondaryFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"cornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"showArticleAuthors":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"]}},{"type":"null"}]},"headerBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"headerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroWelcomeMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"heroBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"heroTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroHeight":{"anyOf":[{"type":"number","minimum":200,"maximum":800},{"type":"null"}]},"heroSearchBarWidth":{"anyOf":[{"type":"number","minimum":300,"maximum":1000},{"type":"null"}]},"heroAlignment":{"anyOf":[{"type":"string","enum":["left","center","right"]},{"type":"null"}]},"heroCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"collectionsShowDescriptions":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowToc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowRelated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"cardStyle":{"anyOf":[{"type":"string","enum":["card","floating"]},{"type":"null"}]},"cardDisplayMode":{"anyOf":[{"type":"string","enum":["default","compact","minimal"]},{"type":"null"}]},"cardShowMedia":{"anyOf":[{"type":"string","enum":["icon","image","none"]},{"type":"null"}]},"cardColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sectionOrder":{"anyOf":[{"type":"array","items":{"type":"string","enum":["articles","collections","tickets","content"]}},{"type":"null"}]},"articlesSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ticketsSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articlesSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"articlesSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"articlesSectionArticleIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"collectionsSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"collectionsSectionStyle":{"anyOf":[{"type":"string","enum":["classic","visual","compact"]},{"type":"null"}]},"collectionsIconColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconColors":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"collectionsIconBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"collectionsIconBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconBackgroundType":{"anyOf":[{"type":"string","enum":["color","gradient"]},{"type":"null"}]},"collectionsIconGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionTitleColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescriptionColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionStyle":{"anyOf":[{"type":"string","enum":["card","full"]},{"type":"null"}]},"contentSectionBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"contentSectionBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionButtonEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionButtonText":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"contentSectionButtonColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"footerLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerLayout":{"anyOf":[{"type":"string","enum":["simple","classic","multi_level"]},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerSocialDisplay":{"anyOf":[{"type":"string","enum":["label","icon"]},{"type":"null"}]},"footerSocialLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"url":{"type":"string"}},"required":["platform","url"]}},{"type":"null"}]},"footerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"]}},{"type":"null"}]},"footerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"websiteEnabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"displayName":{"type":"string"},"url":{"type":"string"},"customDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"customDomainVerified":{"type":"boolean"},"customDomainVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"googleAnalyticsId":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteEnabled":{"default":true,"type":"boolean"},"theme":{"anyOf":[{"type":"object","properties":{"backgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"secondaryFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"cornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"showArticleAuthors":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"headerBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"headerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroWelcomeMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"heroBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"heroTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroHeight":{"anyOf":[{"type":"number","minimum":200,"maximum":800},{"type":"null"}]},"heroSearchBarWidth":{"anyOf":[{"type":"number","minimum":300,"maximum":1000},{"type":"null"}]},"heroAlignment":{"anyOf":[{"type":"string","enum":["left","center","right"]},{"type":"null"}]},"heroCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"collectionsShowDescriptions":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowToc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowRelated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"cardStyle":{"anyOf":[{"type":"string","enum":["card","floating"]},{"type":"null"}]},"cardDisplayMode":{"anyOf":[{"type":"string","enum":["default","compact","minimal"]},{"type":"null"}]},"cardShowMedia":{"anyOf":[{"type":"string","enum":["icon","image","none"]},{"type":"null"}]},"cardColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sectionOrder":{"anyOf":[{"type":"array","items":{"type":"string","enum":["articles","collections","tickets","content"]}},{"type":"null"}]},"articlesSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ticketsSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articlesSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"articlesSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"articlesSectionArticleIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"collectionsSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"collectionsSectionStyle":{"anyOf":[{"type":"string","enum":["classic","visual","compact"]},{"type":"null"}]},"collectionsIconColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconColors":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"collectionsIconBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"collectionsIconBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconBackgroundType":{"anyOf":[{"type":"string","enum":["color","gradient"]},{"type":"null"}]},"collectionsIconGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionTitleColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescriptionColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionStyle":{"anyOf":[{"type":"string","enum":["card","full"]},{"type":"null"}]},"contentSectionBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"contentSectionBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionButtonEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionButtonText":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"contentSectionButtonColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"footerLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerLayout":{"anyOf":[{"type":"string","enum":["simple","classic","multi_level"]},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerSocialDisplay":{"anyOf":[{"type":"string","enum":["label","icon"]},{"type":"null"}]},"footerSocialLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"url":{"type":"string"}},"required":["platform","url"],"additionalProperties":false}},{"type":"null"}]},"footerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"footerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","displayName","url","customDomainVerified","websiteEnabled"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/gaps/{id}/dismiss":{"post":{"operationId":"knowledge-dismissKnowledgeGap","summary":"Dismiss Knowledge Gap","description":"Marks a knowledge gap as dismissed so it no longer appears in Gap Finder or coverage. Use this when the question is off-topic or not worth an article.","tags":["Knowledge Gaps"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the gap."},"required":true,"description":"ID of the project that owns the gap."},{"in":"path","name":"id","schema":{"type":"string","description":"ID of the knowledge gap."},"required":true,"description":"ID of the knowledge gap."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"boolean"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/extract-brand":{"post":{"operationId":"knowledge-extractBrand","summary":"Extract Brand Info","description":"Fetches a website and infers its branding (logo URL and primary colour) for pre-filling help-center theming instead of asking the user to enter it by hand. Both fields are best-effort and either may be absent if nothing usable is found.","tags":["Help Center"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project making the request."},"required":true,"description":"ID of the project making the request."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","format":"uri","description":"Full URL of the site to inspect, including scheme, e.g. `https://example.com`."}},"required":["domain"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"logo":{"type":"string"},"primaryColor":{"type":"string"}},"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/help-center":{"get":{"operationId":"knowledge-getHelpCenter","summary":"Get Help Center","description":"Fetches the project's help center with its full configuration: theme, custom domain and verification state, analytics ID. Returns `null` if the project has no help center yet.","tags":["Help Center"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project whose help center to fetch."},"required":true,"description":"ID of the project whose help center to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"displayName":{"type":"string"},"url":{"type":"string"},"customDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"customDomainVerified":{"type":"boolean"},"customDomainVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"googleAnalyticsId":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteEnabled":{"default":true,"type":"boolean"},"theme":{"anyOf":[{"type":"object","properties":{"backgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"secondaryFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"cornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"showArticleAuthors":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"headerBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"headerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroWelcomeMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"heroBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"heroTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroHeight":{"anyOf":[{"type":"number","minimum":200,"maximum":800},{"type":"null"}]},"heroSearchBarWidth":{"anyOf":[{"type":"number","minimum":300,"maximum":1000},{"type":"null"}]},"heroAlignment":{"anyOf":[{"type":"string","enum":["left","center","right"]},{"type":"null"}]},"heroCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"collectionsShowDescriptions":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowToc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowRelated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"cardStyle":{"anyOf":[{"type":"string","enum":["card","floating"]},{"type":"null"}]},"cardDisplayMode":{"anyOf":[{"type":"string","enum":["default","compact","minimal"]},{"type":"null"}]},"cardShowMedia":{"anyOf":[{"type":"string","enum":["icon","image","none"]},{"type":"null"}]},"cardColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sectionOrder":{"anyOf":[{"type":"array","items":{"type":"string","enum":["articles","collections","tickets","content"]}},{"type":"null"}]},"articlesSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ticketsSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articlesSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"articlesSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"articlesSectionArticleIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"collectionsSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"collectionsSectionStyle":{"anyOf":[{"type":"string","enum":["classic","visual","compact"]},{"type":"null"}]},"collectionsIconColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconColors":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"collectionsIconBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"collectionsIconBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconBackgroundType":{"anyOf":[{"type":"string","enum":["color","gradient"]},{"type":"null"}]},"collectionsIconGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionTitleColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescriptionColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionStyle":{"anyOf":[{"type":"string","enum":["card","full"]},{"type":"null"}]},"contentSectionBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"contentSectionBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionButtonEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionButtonText":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"contentSectionButtonColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"footerLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerLayout":{"anyOf":[{"type":"string","enum":["simple","classic","multi_level"]},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerSocialDisplay":{"anyOf":[{"type":"string","enum":["label","icon"]},{"type":"null"}]},"footerSocialLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"url":{"type":"string"}},"required":["platform","url"],"additionalProperties":false}},{"type":"null"}]},"footerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"footerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","displayName","url","customDomainVerified","websiteEnabled"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/knowledge/articles/{slug}":{"get":{"operationId":"knowledge-getPublicArticle","summary":"Get Public Article","description":"Fetches a published article by its URL slug: the reader-facing lookup behind a help-center page. Public and unauthenticated. Drafts and internal articles are never returned; anything not publicly visible comes back as `null`.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"slug","schema":{"type":"string","description":"URL slug of the article, generated from its title when it was created."},"required":true,"description":"URL slug of the article, generated from its title when it was created."},{"in":"query","name":"helpCenterId","schema":{"type":"string","description":"ID of the help center publishing the article."},"required":true,"description":"ID of the help center publishing the article."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"type":{"default":"public","type":"string","enum":["public","internal"]},"title":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"default":"draft","type":"string","enum":["draft","published"]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorId":{"type":"string"},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"happyReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"neutralReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sadReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},{"type":"null"}]},"collection":{"anyOf":[{"type":"object","properties":{"helpCenterId":{"type":"string"},"name":{"type":"string"}},"required":["helpCenterId","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","type","title","slug","body","state","order","authorId","views","conversions","happyReactions","neutralReactions","sadReactions"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/knowledge/articles/by-ids":{"get":{"operationId":"knowledge-getPublicArticlesByIds","summary":"Get Public Articles By IDs","description":"Fetches several published articles in one call, for rendering a curated or recommended set without a request per article. Unknown or non-public IDs are skipped, so the response can be shorter than the list you sent and the order is not guaranteed to match.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"query","name":"helpCenterId","schema":{"type":"string","description":"ID of the help center publishing the articles."},"required":true,"description":"ID of the help center publishing the articles."},{"in":"query","name":"ids","schema":{"type":"array","items":{"type":"string"},"description":"IDs of the articles to fetch."},"required":true,"description":"IDs of the articles to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"type":{"default":"public","type":"string","enum":["public","internal"]},"title":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"default":"draft","type":"string","enum":["draft","published"]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorId":{"type":"string"},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"happyReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"neutralReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sadReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},{"type":"null"}]},"collection":{"anyOf":[{"type":"object","properties":{"helpCenterId":{"type":"string"},"name":{"type":"string"}},"required":["helpCenterId","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","type","title","slug","body","state","order","authorId","views","conversions","happyReactions","neutralReactions","sadReactions"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/knowledge/help-centers/{projectId}":{"get":{"operationId":"knowledge-getPublicHelpCenter","summary":"Get Public Help Center","description":"Fetches a project's help center as readers see it: the public configuration used to render the site. Returns `null` when the help center exists but is not published.","tags":["Help Center"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project whose help center to fetch."},"required":true,"description":"ID of the project whose help center to fetch."},{"in":"query","name":"preview","schema":{"type":"boolean","description":"Return the help center even when it is unpublished, for previewing before launch. Honoured only for signed-in members of the project; ignored for everyone else, including API-key callers."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"displayName":{"type":"string"},"url":{"type":"string"},"customDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"customDomainVerified":{"type":"boolean"},"customDomainVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"googleAnalyticsId":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteEnabled":{"default":true,"type":"boolean"},"theme":{"anyOf":[{"type":"object","properties":{"backgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"secondaryFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"cornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"showArticleAuthors":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"headerBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"headerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroWelcomeMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"heroBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"heroTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroHeight":{"anyOf":[{"type":"number","minimum":200,"maximum":800},{"type":"null"}]},"heroSearchBarWidth":{"anyOf":[{"type":"number","minimum":300,"maximum":1000},{"type":"null"}]},"heroAlignment":{"anyOf":[{"type":"string","enum":["left","center","right"]},{"type":"null"}]},"heroCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"collectionsShowDescriptions":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowToc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowRelated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"cardStyle":{"anyOf":[{"type":"string","enum":["card","floating"]},{"type":"null"}]},"cardDisplayMode":{"anyOf":[{"type":"string","enum":["default","compact","minimal"]},{"type":"null"}]},"cardShowMedia":{"anyOf":[{"type":"string","enum":["icon","image","none"]},{"type":"null"}]},"cardColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sectionOrder":{"anyOf":[{"type":"array","items":{"type":"string","enum":["articles","collections","tickets","content"]}},{"type":"null"}]},"articlesSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ticketsSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articlesSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"articlesSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"articlesSectionArticleIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"collectionsSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"collectionsSectionStyle":{"anyOf":[{"type":"string","enum":["classic","visual","compact"]},{"type":"null"}]},"collectionsIconColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconColors":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"collectionsIconBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"collectionsIconBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconBackgroundType":{"anyOf":[{"type":"string","enum":["color","gradient"]},{"type":"null"}]},"collectionsIconGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionTitleColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescriptionColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionStyle":{"anyOf":[{"type":"string","enum":["card","full"]},{"type":"null"}]},"contentSectionBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"contentSectionBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionButtonEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionButtonText":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"contentSectionButtonColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"footerLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerLayout":{"anyOf":[{"type":"string","enum":["simple","classic","multi_level"]},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerSocialDisplay":{"anyOf":[{"type":"string","enum":["label","icon"]},{"type":"null"}]},"footerSocialLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"url":{"type":"string"}},"required":["platform","url"],"additionalProperties":false}},{"type":"null"}]},"footerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"footerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","displayName","url","customDomainVerified","websiteEnabled"],"additionalProperties":false},{"type":"null"}]}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/knowledge/articles/{articleId}/related":{"get":{"operationId":"knowledge-getRelatedArticles","summary":"Get Related Articles","description":"Suggests further reading for an article, for a \"related articles\" block at the foot of a help-center page. Relatedness is text similarity: the source article's title and description are matched against other articles in the same help center. Only published public articles are considered on both sides, so an unpublished or internal source article returns an empty list rather than an error. Defaults to 5 results.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"articleId","schema":{"type":"string","description":"ID of the article to find related articles for."},"required":true,"description":"ID of the article to find related articles for."},{"in":"query","name":"helpCenterId","schema":{"type":"string","description":"ID of the help center to draw related articles from."},"required":true,"description":"ID of the help center to draw related articles from."},{"in":"query","name":"limit","schema":{"type":"number","minimum":1,"maximum":10,"description":"Maximum number of related articles to return, between 1 and 10."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"}},"required":["collectionId","description","id","slug","title"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/knowledge/articles/{articleId}/views":{"post":{"operationId":"knowledge-incrementViews","summary":"Increment Article Views","description":"Adds one to an article's view counter. Public and unauthenticated, intended to be called on page load. Every call counts. There is no per-reader deduplication, so this measures page views rather than unique readers.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"articleId","schema":{"type":"string","description":"ID of the article whose view count to increment."},"required":true,"description":"ID of the article whose view count to increment."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"boolean"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/knowledge/instant-search":{"get":{"operationId":"knowledge-instantSearchArticles","summary":"Instant Search Articles","description":"Type-ahead search for a help-center search box. Returns at most 5 published public articles as lightweight hits (title, slug, collection name, and a short snippet) with `totalCount` reporting how many matched overall so you can offer \"see all results\". Falls back to fuzzy matching when the phrase is too short or malformed for full-text search, so partial words and typos still return something. Use Search Articles for the full result page.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"query","name":"helpCenterId","schema":{"type":"string","description":"ID of the help center to search within."},"required":true,"description":"ID of the help center to search within."},{"in":"query","name":"phrase","schema":{"type":"string","minLength":1,"description":"The search text. Must not be empty."},"required":true,"description":"The search text. Must not be empty."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"collectionName":{"type":"string"},"id":{"type":"string"},"slug":{"type":"string"},"snippet":{"type":"string"},"title":{"type":"string"}},"required":["id","slug","snippet","title"],"additionalProperties":false}},"totalCount":{"type":"number"}},"required":["results","totalCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/gaps":{"get":{"operationId":"knowledge-listKnowledgeGaps","summary":"List Knowledge Gaps","description":"Lists unanswered and answered knowledge gaps the support agent filed when it could not answer a customer. Dismissed gaps are omitted. Also returns coverage: the share of remaining gaps that have a published Help Center article.","tags":["Knowledge Gaps"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project whose gaps to list."},"required":true,"description":"ID of the project whose gaps to list."},{"in":"query","name":"skip","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Number of gaps to skip before collecting results."}},{"in":"query","name":"status","schema":{"anyOf":[{"type":"string","enum":["unanswered","answered"]},{"type":"string","const":"all"}],"description":"Only return gaps in this state. `answered` means the linked article is published. `all` is unanswered and answered, not dismissed."}},{"in":"query","name":"take","schema":{"type":"integer","minimum":1,"maximum":100,"description":"Maximum number of gaps to return."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"coverage":{"type":"object","properties":{"answered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"percent":{"type":"integer","minimum":0,"maximum":100},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unanswered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["answered","percent","total","unanswered"],"additionalProperties":false},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"kind":{"type":"string","enum":["missing_knowledge","product_limitation"]},"status":{"default":"unanswered","type":"string","enum":["unanswered","answered","dismissed"]},"customerQuestion":{"type":"string"},"customerGoal":{"type":"string"},"whyUnanswered":{"type":"string"},"suggestedArticleTitle":{"type":"string"},"suggestedArticleOutline":{"type":"array","items":{"type":"string"}},"searchQueriesTried":{"type":"array","items":{"type":"string"}},"occurrenceCount":{"default":1,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastOccurredAt":{"type":"string"},"channel":{"type":"string","enum":["chat","email"]},"conversationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"articleId":{"anyOf":[{"type":"string"},{"type":"null"}]},"answeredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"article":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"state":{"type":"string","enum":["draft","published"]},"title":{"type":"string"}},"required":["id","slug","state","title"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","kind","status","customerQuestion","customerGoal","whyUnanswered","suggestedArticleTitle","suggestedArticleOutline","searchQueriesTried","occurrenceCount","lastOccurredAt","channel"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["coverage","data","total"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/knowledge/help-centers/{helpCenterId}/collections":{"get":{"operationId":"knowledge-listPublicCollections","summary":"List Public Collections","description":"The reader-facing navigation tree for a help center: collections with their nested children and published public articles only. Public and unauthenticated, so it is safe to call from a help-center front end.","tags":["Collections"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"helpCenterId","schema":{"type":"string","description":"ID of the help center whose collections to list."},"required":true,"description":"ID of the help center whose collections to list."},{"in":"query","name":"parentId","schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only return children of this collection. Pass `null` for top-level collections; omit for all of them."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/__schema2"}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/help-center/domain":{"delete":{"operationId":"knowledge-removeHelpCenterDomain","summary":"Remove Help Center Custom Domain","description":"Detaches the custom domain from the help center and clears its verification state. The help center stays available on its Saasco-hosted URL. Returns 404 if no custom domain is configured. DNS records at your registrar are not touched. Remove them yourself.","tags":["Help Center"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the help center."},"required":true,"description":"ID of the project that owns the help center."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"displayName":{"type":"string"},"url":{"type":"string"},"customDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"customDomainVerified":{"type":"boolean"},"customDomainVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"googleAnalyticsId":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteEnabled":{"default":true,"type":"boolean"},"theme":{"anyOf":[{"type":"object","properties":{"backgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"secondaryFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"cornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"showArticleAuthors":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"headerBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"headerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroWelcomeMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"heroBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"heroTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroHeight":{"anyOf":[{"type":"number","minimum":200,"maximum":800},{"type":"null"}]},"heroSearchBarWidth":{"anyOf":[{"type":"number","minimum":300,"maximum":1000},{"type":"null"}]},"heroAlignment":{"anyOf":[{"type":"string","enum":["left","center","right"]},{"type":"null"}]},"heroCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"collectionsShowDescriptions":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowToc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowRelated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"cardStyle":{"anyOf":[{"type":"string","enum":["card","floating"]},{"type":"null"}]},"cardDisplayMode":{"anyOf":[{"type":"string","enum":["default","compact","minimal"]},{"type":"null"}]},"cardShowMedia":{"anyOf":[{"type":"string","enum":["icon","image","none"]},{"type":"null"}]},"cardColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sectionOrder":{"anyOf":[{"type":"array","items":{"type":"string","enum":["articles","collections","tickets","content"]}},{"type":"null"}]},"articlesSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ticketsSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articlesSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"articlesSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"articlesSectionArticleIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"collectionsSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"collectionsSectionStyle":{"anyOf":[{"type":"string","enum":["classic","visual","compact"]},{"type":"null"}]},"collectionsIconColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconColors":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"collectionsIconBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"collectionsIconBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconBackgroundType":{"anyOf":[{"type":"string","enum":["color","gradient"]},{"type":"null"}]},"collectionsIconGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionTitleColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescriptionColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionStyle":{"anyOf":[{"type":"string","enum":["card","full"]},{"type":"null"}]},"contentSectionBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"contentSectionBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionButtonEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionButtonText":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"contentSectionButtonColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"footerLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerLayout":{"anyOf":[{"type":"string","enum":["simple","classic","multi_level"]},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerSocialDisplay":{"anyOf":[{"type":"string","enum":["label","icon"]},{"type":"null"}]},"footerSocialLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"url":{"type":"string"}},"required":["platform","url"],"additionalProperties":false}},{"type":"null"}]},"footerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"footerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","displayName","url","customDomainVerified","websiteEnabled"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"knowledge-setHelpCenterDomain","summary":"Set Help Center Custom Domain","description":"Points a hostname you own at the project's help center. The domain is registered with the hosting layer and the DNS records you need to add are returned on the help center as `customDomainVerificationDNS`. It does not serve traffic until DNS is in place and Verify Help Center Custom Domain reports success. Setting a new domain replaces any existing one, and a hostname already claimed by another help center is rejected with 409.","tags":["Help Center"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the help center."},"required":true,"description":"ID of the project that owns the help center."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"Hostname to serve the help center from, e.g. `help.example.com`. Supply the bare hostname without a scheme or trailing slash."}},"required":["domain"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"displayName":{"type":"string"},"url":{"type":"string"},"customDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"customDomainVerified":{"type":"boolean"},"customDomainVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"googleAnalyticsId":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteEnabled":{"default":true,"type":"boolean"},"theme":{"anyOf":[{"type":"object","properties":{"backgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"secondaryFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"cornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"showArticleAuthors":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"headerBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"headerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroWelcomeMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"heroBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"heroTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroHeight":{"anyOf":[{"type":"number","minimum":200,"maximum":800},{"type":"null"}]},"heroSearchBarWidth":{"anyOf":[{"type":"number","minimum":300,"maximum":1000},{"type":"null"}]},"heroAlignment":{"anyOf":[{"type":"string","enum":["left","center","right"]},{"type":"null"}]},"heroCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"collectionsShowDescriptions":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowToc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowRelated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"cardStyle":{"anyOf":[{"type":"string","enum":["card","floating"]},{"type":"null"}]},"cardDisplayMode":{"anyOf":[{"type":"string","enum":["default","compact","minimal"]},{"type":"null"}]},"cardShowMedia":{"anyOf":[{"type":"string","enum":["icon","image","none"]},{"type":"null"}]},"cardColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sectionOrder":{"anyOf":[{"type":"array","items":{"type":"string","enum":["articles","collections","tickets","content"]}},{"type":"null"}]},"articlesSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ticketsSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articlesSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"articlesSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"articlesSectionArticleIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"collectionsSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"collectionsSectionStyle":{"anyOf":[{"type":"string","enum":["classic","visual","compact"]},{"type":"null"}]},"collectionsIconColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconColors":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"collectionsIconBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"collectionsIconBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconBackgroundType":{"anyOf":[{"type":"string","enum":["color","gradient"]},{"type":"null"}]},"collectionsIconGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionTitleColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescriptionColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionStyle":{"anyOf":[{"type":"string","enum":["card","full"]},{"type":"null"}]},"contentSectionBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"contentSectionBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionButtonEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionButtonText":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"contentSectionButtonColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"footerLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerLayout":{"anyOf":[{"type":"string","enum":["simple","classic","multi_level"]},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerSocialDisplay":{"anyOf":[{"type":"string","enum":["label","icon"]},{"type":"null"}]},"footerSocialLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"url":{"type":"string"}},"required":["platform","url"],"additionalProperties":false}},{"type":"null"}]},"footerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"footerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","displayName","url","customDomainVerified","websiteEnabled"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/knowledge/search":{"get":{"operationId":"knowledge-searchArticles","summary":"Search Articles","description":"Full search across a help center's published articles, returning complete articles ranked by relevance plus a `totalCount`. Set `highlight` to also receive the matched fragments of each title and summary, ready to render as emphasised text. This endpoint is public, so it always restricts to published articles no matter what `state` is sent.","tags":["Articles"],"security":[{"Authorization":[]}],"parameters":[{"in":"query","name":"helpCenterId","schema":{"type":"string","description":"ID of the help center to search within."},"required":true,"description":"ID of the help center to search within."},{"in":"query","name":"highlight","schema":{"type":"boolean","description":"Also return a `highlights` array marking which parts of each title and summary matched, as alternating plain/highlight fragments ready to render."}},{"in":"query","name":"phrase","schema":{"type":"string","description":"The search text."},"required":true,"description":"The search text."},{"in":"query","name":"state","schema":{"type":"string","enum":["draft","published","all"],"description":"Which articles to search. The public Search Articles endpoint forces `published` regardless of what is sent here."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"articles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"type":{"default":"public","type":"string","enum":["public","internal"]},"title":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"default":"draft","type":"string","enum":["draft","published"]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorId":{"type":"string"},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"happyReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"neutralReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sadReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},{"type":"null"}]},"collection":{"anyOf":[{"type":"object","properties":{"helpCenterId":{"type":"string"},"name":{"type":"string"}},"required":["helpCenterId","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","type","title","slug","body","state","order","authorId","views","conversions","happyReactions","neutralReactions","sadReactions"],"additionalProperties":false}},"highlights":{"type":"array","items":{"type":"object","properties":{"articleId":{"type":"string"},"highlightedSummary":{"type":"array","items":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"type":{"type":"string","enum":["plain","highlight"]}},"required":["text","type"],"additionalProperties":false}}},"highlightedTitle":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"type":{"type":"string","enum":["plain","highlight"]}},"required":["text","type"],"additionalProperties":false}}},"required":["articleId","highlightedSummary","highlightedTitle"],"additionalProperties":false}},"totalCount":{"type":"number"}},"required":["articles","totalCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/gaps/{id}/article":{"post":{"operationId":"knowledge-saveKnowledgeGapArticle","summary":"Save Knowledge Gap Article","description":"Creates a draft Help Center article titled with the gap's detected topic and nothing else. The gap stays unanswered until that article is published. If the gap already has an article, returns that article instead of creating another.","tags":["Knowledge Gaps"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the gap."},"required":true,"description":"ID of the project that owns the gap."},{"in":"path","name":"id","schema":{"type":"string","description":"ID of the knowledge gap."},"required":true,"description":"ID of the knowledge gap."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"collectionId":{"type":"string","description":"Collection to save the article into. Omit to use the first top-level collection, or none."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"articleId":{"type":"string"},"created":{"type":"boolean"}},"required":["articleId","created"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/knowledge/help-center/domain/verify":{"post":{"operationId":"knowledge-verifyHelpCenterDomain","summary":"Verify Help Center Custom Domain","description":"Re-checks the DNS for the configured custom domain and stores the result on the help center as `customDomainVerified`. Poll this after adding the DNS records; it is safe to call repeatedly. A domain that is still misconfigured comes back with `customDomainVerified: false` rather than an error. Only a project with no custom domain set returns 404.","tags":["Help Center"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the help center."},"required":true,"description":"ID of the project that owns the help center."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"displayName":{"type":"string"},"url":{"type":"string"},"customDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"customDomainVerified":{"type":"boolean"},"customDomainVerificationDNS":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"}},"required":["domain","type","value"],"additionalProperties":false}},{"type":"null"}]},"googleAnalyticsId":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteEnabled":{"default":true,"type":"boolean"},"theme":{"anyOf":[{"type":"object","properties":{"backgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"fontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"secondaryFontFamily":{"anyOf":[{"type":"string"},{"type":"null"}]},"cornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"showArticleAuthors":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"headerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"headerBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"headerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroWelcomeMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"heroBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"heroTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"heroHeight":{"anyOf":[{"type":"number","minimum":200,"maximum":800},{"type":"null"}]},"heroSearchBarWidth":{"anyOf":[{"type":"number","minimum":300,"maximum":1000},{"type":"null"}]},"heroAlignment":{"anyOf":[{"type":"string","enum":["left","center","right"]},{"type":"null"}]},"heroCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"collectionsShowDescriptions":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowToc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articleShowRelated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"cardStyle":{"anyOf":[{"type":"string","enum":["card","floating"]},{"type":"null"}]},"cardDisplayMode":{"anyOf":[{"type":"string","enum":["default","compact","minimal"]},{"type":"null"}]},"cardShowMedia":{"anyOf":[{"type":"string","enum":["icon","image","none"]},{"type":"null"}]},"cardColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"sectionOrder":{"anyOf":[{"type":"array","items":{"type":"string","enum":["articles","collections","tickets","content"]}},{"type":"null"}]},"articlesSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ticketsSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"articlesSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"articlesSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"articlesSectionArticleIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"collectionsSectionLayout":{"anyOf":[{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3}]},{"type":"null"}]},"collectionsSectionStyle":{"anyOf":[{"type":"string","enum":["classic","visual","compact"]},{"type":"null"}]},"collectionsIconColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconColors":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"collectionsIconBackgroundEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"collectionsIconBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"collectionsIconBackgroundType":{"anyOf":[{"type":"string","enum":["color","gradient"]},{"type":"null"}]},"collectionsIconGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionTitleColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionDescriptionColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionStyle":{"anyOf":[{"type":"string","enum":["card","full"]},{"type":"null"}]},"contentSectionBackgroundType":{"anyOf":[{"type":"string","enum":["color","image","gradient"]},{"type":"null"}]},"contentSectionBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionBackgroundImage":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionGradientColors":{"anyOf":[{"maxItems":3,"type":"array","items":{"type":"string"}},{"type":"null"}]},"contentSectionButtonEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"contentSectionButtonText":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"contentSectionButtonColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentSectionButtonCornerRadius":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"footerLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerLayout":{"anyOf":[{"type":"string","enum":["simple","classic","multi_level"]},{"type":"null"}]},"footerText":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerSocialDisplay":{"anyOf":[{"type":"string","enum":["label","icon"]},{"type":"null"}]},"footerSocialLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"url":{"type":"string"}},"required":["platform","url"],"additionalProperties":false}},{"type":"null"}]},"footerLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["title","url"],"additionalProperties":false}},{"type":"null"}]},"footerBackgroundColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"footerTextColor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","displayName","url","customDomainVerified","websiteEnabled"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}":{"get":{"operationId":"projects-getProject","summary":"Get Project","description":"Fetches a single project along with its app configs: one entry per Saasco app the project has enabled, carrying that app's activation and setup-completion state. Returns 404 if the project does not exist.","tags":["Projects"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to fetch."},"required":true,"description":"ID of the project to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"balance":{"type":"number"},"balanceVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbnail":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"testStripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoTopUpEnabled":{"type":"boolean"},"meta":{"anyOf":[{"type":"object","properties":{"completedSetupSteps":{"type":"array","items":{"type":"string","enum":["sdk","event","domain","team"]}},"contactListVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"],"additionalProperties":false}},"defaultEmailCampaignSendOrder":{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},"defaultEmailFromDomain":{"type":"string"},"defaultEmailFromName":{"type":"string"},"defaultEmailFromUsername":{"type":"string"},"hasCompletedOnboarding":{"type":"boolean"},"knowledgeArticlesVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"],"additionalProperties":false}},"timezone":{"type":"string","minLength":1,"maxLength":64},"useCases":{"type":"array","items":{"type":"string","enum":["onboarding","support","marketing"]}}},"additionalProperties":false},{"type":"null"}]},"autoTopUpAmount":{"anyOf":[{"type":"number","minimum":20},{"type":"null"}]},"autoTopUpThreshold":{"anyOf":[{"type":"number","minimum":10},{"type":"null"}]},"appConfigs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"appId":{"type":"string"},"activated":{"type":"boolean"},"setupCompleted":{"type":"boolean"},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","appId","activated","setupCompleted","projectId"],"additionalProperties":false}}},"required":["id","createdAt","updatedAt","name","slug","balance","balanceVersion","autoTopUpEnabled","appConfigs"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"post":{"operationId":"projects-updateProject","summary":"Update Project","description":"Updates a project's settings. Only the fields present in `changes` are written, so this is a partial update despite the POST. Slugs are unique across Saasco. Reusing one that belongs to another project returns 409.","tags":["Projects"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to update."},"required":true,"description":"ID of the project to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","properties":{"autoTopUpEnabled":{"description":"Whether automatic credit top-up is enabled.","type":"boolean"},"meta":{"description":"Project metadata bag.","anyOf":[{"type":"object","properties":{"completedSetupSteps":{"type":"array","items":{"type":"string","enum":["sdk","event","domain","team"]}},"contactListVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"]}},"defaultEmailCampaignSendOrder":{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"]},"defaultEmailFromDomain":{"type":"string"},"defaultEmailFromName":{"type":"string"},"defaultEmailFromUsername":{"type":"string"},"hasCompletedOnboarding":{"type":"boolean"},"knowledgeArticlesVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"]}},"timezone":{"type":"string","minLength":1,"maxLength":64},"useCases":{"type":"array","items":{"type":"string","enum":["onboarding","support","marketing"]}}}},{"type":"null"}]},"name":{"description":"Display name of the project.","type":"string"},"slug":{"description":"Unique URL slug across Saasco. Reusing one that belongs to another project returns 409.","type":"string"},"stripeCustomerId":{"description":"Live Stripe customer ID.","anyOf":[{"type":"string"},{"type":"null"}]},"tagline":{"description":"Short description shown on the project.","anyOf":[{"type":"string"},{"type":"null"}]},"testStripeCustomerId":{"description":"Test-mode Stripe customer ID.","anyOf":[{"type":"string"},{"type":"null"}]},"thumbnail":{"description":"Image URL for the project.","anyOf":[{"type":"string"},{"type":"null"}]},"autoTopUpAmount":{"anyOf":[{"type":"number","minimum":20,"description":"USD to charge when an auto top-up triggers. Minimum $20. Null clears it."},{"type":"null"}]},"autoTopUpThreshold":{"anyOf":[{"type":"number","minimum":10,"description":"Balance in USD that triggers an auto top-up. Minimum $10. Null clears it."},{"type":"null"}]}},"description":"Fields to change. Anything omitted is left as-is."}},"required":["changes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"balance":{"type":"number"},"balanceVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbnail":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"testStripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoTopUpEnabled":{"type":"boolean"},"meta":{"anyOf":[{"type":"object","properties":{"completedSetupSteps":{"type":"array","items":{"type":"string","enum":["sdk","event","domain","team"]}},"contactListVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"],"additionalProperties":false}},"defaultEmailCampaignSendOrder":{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},"defaultEmailFromDomain":{"type":"string"},"defaultEmailFromName":{"type":"string"},"defaultEmailFromUsername":{"type":"string"},"hasCompletedOnboarding":{"type":"boolean"},"knowledgeArticlesVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"],"additionalProperties":false}},"timezone":{"type":"string","minLength":1,"maxLength":64},"useCases":{"type":"array","items":{"type":"string","enum":["onboarding","support","marketing"]}}},"additionalProperties":false},{"type":"null"}]},"autoTopUpAmount":{"anyOf":[{"type":"number","minimum":20},{"type":"null"}]},"autoTopUpThreshold":{"anyOf":[{"type":"number","minimum":10},{"type":"null"}]},"appConfigs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"appId":{"type":"string"},"activated":{"type":"boolean"},"setupCompleted":{"type":"boolean"},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","appId","activated","setupCompleted","projectId"],"additionalProperties":false}}},"required":["id","createdAt","updatedAt","name","slug","balance","balanceVersion","autoTopUpEnabled","appConfigs"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"projects-deleteProject","summary":"Delete Project","description":"Permanently deletes a project and everything cascading from it. Any queued usage is settled against the balance first, and the delete is refused with 403 if that leaves the project owing money. Top up before retrying. Returns the deleted project as it was at the point of deletion. This cannot be undone.","tags":["Projects"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to delete."},"required":true,"description":"ID of the project to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"balance":{"type":"number"},"balanceVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbnail":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"testStripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoTopUpEnabled":{"type":"boolean"},"meta":{"anyOf":[{"type":"object","properties":{"completedSetupSteps":{"type":"array","items":{"type":"string","enum":["sdk","event","domain","team"]}},"contactListVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"],"additionalProperties":false}},"defaultEmailCampaignSendOrder":{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},"defaultEmailFromDomain":{"type":"string"},"defaultEmailFromName":{"type":"string"},"defaultEmailFromUsername":{"type":"string"},"hasCompletedOnboarding":{"type":"boolean"},"knowledgeArticlesVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"],"additionalProperties":false}},"timezone":{"type":"string","minLength":1,"maxLength":64},"useCases":{"type":"array","items":{"type":"string","enum":["onboarding","support","marketing"]}}},"additionalProperties":false},{"type":"null"}]},"autoTopUpAmount":{"anyOf":[{"type":"number","minimum":20},{"type":"null"}]},"autoTopUpThreshold":{"anyOf":[{"type":"number","minimum":10},{"type":"null"}]}},"required":["id","createdAt","updatedAt","name","slug","balance","balanceVersion","autoTopUpEnabled"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects":{"get":{"operationId":"projects-listProjects","summary":"List Projects","description":"Lists the projects the caller can reach, each with its app configs. API keys are scoped to a single project, so an API-key caller always gets exactly that one project back. The paging and sorting parameters are only meaningful for session callers, who receive every project they are a member of.","tags":["Projects"],"security":[{"Authorization":[]}],"parameters":[{"in":"query","name":"id","schema":{"type":"string","description":"Return only the project with this ID."}},{"in":"query","name":"orderBy","schema":{"type":"string","enum":["name","description","createdAt"],"description":"Field to sort by. Omit to keep the default ordering."}},{"in":"query","name":"orderDirection","schema":{"type":"string","enum":["asc","desc"],"description":"Sort direction. Defaults to `desc`. Ignored unless `orderBy` is set."}},{"in":"query","name":"skip","schema":{"default":0,"description":"Number of projects to skip before collecting results.","type":"number"}},{"in":"query","name":"take","schema":{"default":24,"description":"Maximum number of projects to return.","type":"number"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"balance":{"type":"number"},"balanceVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbnail":{"anyOf":[{"type":"string"},{"type":"null"}]},"stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"testStripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"autoTopUpEnabled":{"type":"boolean"},"meta":{"anyOf":[{"type":"object","properties":{"completedSetupSteps":{"type":"array","items":{"type":"string","enum":["sdk","event","domain","team"]}},"contactListVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"],"additionalProperties":false}},"defaultEmailCampaignSendOrder":{"type":"object","properties":{"direction":{"type":"string","enum":["asc","desc"],"description":"Sort direction for the contact property."},"propertyKey":{"type":"string","minLength":1,"description":"Contact property key to order the send by, e.g. $id or $email."}},"required":["direction","propertyKey"],"additionalProperties":false},"defaultEmailFromDomain":{"type":"string"},"defaultEmailFromName":{"type":"string"},"defaultEmailFromUsername":{"type":"string"},"hasCompletedOnboarding":{"type":"boolean"},"knowledgeArticlesVisibleColumns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"order":{"type":"number"}},"required":["id","order"],"additionalProperties":false}},"timezone":{"type":"string","minLength":1,"maxLength":64},"useCases":{"type":"array","items":{"type":"string","enum":["onboarding","support","marketing"]}}},"additionalProperties":false},{"type":"null"}]},"autoTopUpAmount":{"anyOf":[{"type":"number","minimum":20},{"type":"null"}]},"autoTopUpThreshold":{"anyOf":[{"type":"number","minimum":10},{"type":"null"}]},"appConfigs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"appId":{"type":"string"},"activated":{"type":"boolean"},"setupCompleted":{"type":"boolean"},"projectId":{"type":"string"}},"required":["id","createdAt","updatedAt","appId","activated","setupCompleted","projectId"],"additionalProperties":false}}},"required":["id","createdAt","updatedAt","name","slug","balance","balanceVersion","autoTopUpEnabled","appConfigs"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/support/conversations/{conversationId}/messages/seen":{"post":{"operationId":"support-markMessagesSeen","summary":"Mark Messages Seen","description":"Marks customer comments on a conversation as seen by the team. Stamps `seenByTeamAt` on the given message ids that are still unseen. Project-wide, not per member: the first teammate (or API key) to open the thread clears the unread count for everyone.","tags":["Messages"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the conversation."},"required":true,"description":"ID of the project that owns the conversation."},{"in":"path","name":"conversationId","schema":{"type":"string","description":"ID of the conversation whose messages to mark seen."},"required":true,"description":"ID of the conversation whose messages to mark seen."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"messageIds":{"minItems":1,"type":"array","items":{"type":"string"},"description":"IDs of the customer comments to mark seen."}},"required":["messageIds"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/support/conversations":{"get":{"operationId":"support-getConversations","summary":"List Conversations","description":"Lists Support inbox conversations (chat and email) with a preview line and unread count, not the transcript. Filter by state; omitted `state` returns open conversations. `spam` is its own view: `open` excludes it and `all` includes it so nothing is unreachable.","tags":["Conversations"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project whose inbox to list."},"required":true,"description":"ID of the project whose inbox to list."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"state","schema":{"type":"string","enum":["all","open","closed","spam"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"anonymousEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"default":"open","type":"string","enum":["open","closed","snoozed","spam"]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string","enum":["email","chat","push","sms","facebook","twitter"]},"snoozedUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownerChangedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignedToUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignee":{"anyOf":[{"type":"object","properties":{"email":{"type":"string"},"id":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["email","id","image","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"],"additionalProperties":false},{"type":"null"}]},"owner":{"type":"string","enum":["agent","member"]},"lastMessage":{"anyOf":[{"type":"object","properties":{"authorRole":{"type":"string","enum":["user","team","bot"]},"createdAt":{"type":"string"},"id":{"type":"string"},"preview":{"type":"string"}},"required":["authorRole","createdAt","id","preview"],"additionalProperties":false},{"type":"null"}]},"unseenCustomerMessageCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","projectId","state","source","assignee","contact","owner","lastMessage","unseenCustomerMessageCount"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/support/contacts/{contactId}/conversations":{"get":{"operationId":"support-getContactConversations","summary":"List Contact Conversations","description":"Lists every Support conversation for one CRM contact, including closed and spam threads. Each row is the same listing shape as List Conversations: a preview line, not the transcript.","tags":["Conversations"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the contact."},"required":true,"description":"ID of the project that owns the contact."},{"in":"path","name":"contactId","schema":{"type":"string","description":"ID of the CRM contact whose conversations to list."},"required":true,"description":"ID of the CRM contact whose conversations to list."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"anonymousEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"default":"open","type":"string","enum":["open","closed","snoozed","spam"]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string","enum":["email","chat","push","sms","facebook","twitter"]},"snoozedUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownerChangedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignedToUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignee":{"anyOf":[{"type":"object","properties":{"email":{"type":"string"},"id":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["email","id","image","name"],"additionalProperties":false},{"type":"null"}]},"contact":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"distinctId":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"toDelete":{"type":"boolean"},"properties":{"type":"object","properties":{"age":{"anyOf":[{"type":"number"},{"type":"null"}]},"avatar":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"birthday":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"$id":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastSeen":{"anyOf":[{"type":"string"},{"type":"null"}]},"$lastIdentifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$processedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$unsubscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$subscribed":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$unsubscribeReason":{"anyOf":[{"type":"string","enum":["manual","complained","bounced","suppressed","failed_email_validation","deleted"]},{"type":"null"}]},"$unsubscribeSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidated":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$lastEmailValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailValidationResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"$emailScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"$stripeCustomerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"$os":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browser":{"anyOf":[{"type":"string"},{"type":"null"}]},"$browserVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"$screenHeight":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenWidth":{"anyOf":[{"type":"number"},{"type":"null"}]},"$screenDpi":{"anyOf":[{"type":"number"},{"type":"null"}]},"$device":{"anyOf":[{"type":"string"},{"type":"null"}]},"$userAgent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"$timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"$city":{"anyOf":[{"type":"string"},{"type":"null"}]},"$country":{"anyOf":[{"type":"string"},{"type":"null"}]},"$countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"$continent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$region":{"anyOf":[{"type":"string"},{"type":"null"}]},"$locale":{"anyOf":[{"type":"string"},{"type":"null"}]},"$latitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$longitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"$referrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$referringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferrer":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialReferringDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$utmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmSource":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmMedium":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmCampaign":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmTerm":{"anyOf":[{"type":"string"},{"type":"null"}]},"$initialUtmContent":{"anyOf":[{"type":"string"},{"type":"null"}]},"$_toDelete":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"$_emailScoreActions":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string"},{"type":"null"}]}}]}}},"required":["id","createdAt","updatedAt","projectId","distinctId","toDelete","properties"],"additionalProperties":false},{"type":"null"}]},"owner":{"type":"string","enum":["agent","member"]},"lastMessage":{"anyOf":[{"type":"object","properties":{"authorRole":{"type":"string","enum":["user","team","bot"]},"createdAt":{"type":"string"},"id":{"type":"string"},"preview":{"type":"string"}},"required":["authorRole","createdAt","id","preview"],"additionalProperties":false},{"type":"null"}]},"unseenCustomerMessageCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","createdAt","updatedAt","projectId","state","source","assignee","contact","owner","lastMessage","unseenCustomerMessageCount"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/support/conversations/{conversationId}/messages":{"get":{"operationId":"support-getConversationMessages","summary":"List Conversation Messages","description":"Returns the transcript of one conversation. Conversation metadata (contact, assignee, state) is on the listing endpoints, not here. Returns 404 if the conversation does not belong to the project.","tags":["Messages"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the conversation."},"required":true,"description":"ID of the project that owns the conversation."},{"in":"path","name":"conversationId","schema":{"type":"string","description":"ID of the conversation whose messages to fetch."},"required":true,"description":"ID of the conversation whose messages to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"agentUsageCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"authorId":{"type":"string"},"authorRole":{"type":"string","enum":["user","team","bot"]},"bodyOrigin":{"anyOf":[{"type":"string","enum":["email"]},{"type":"null"}]},"closeTrigger":{"anyOf":[{"type":"string","enum":["stale","tool"]},{"type":"null"}]},"content":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"detectedLanguage":{"anyOf":[{"type":"string"},{"type":"null"}]},"handoffDecision":{"anyOf":[{"type":"string","enum":["accepted","declined","unanswered"]},{"type":"null"}]},"handoffToolCallId":{"anyOf":[{"type":"string"},{"type":"null"}]},"id":{"type":"string"},"relatedMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"seenByTeamAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentByEmail":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"source":{"type":"string","enum":["email","chat","push","sms","facebook","twitter"]},"systemMessageType":{"anyOf":[{"type":"string","enum":["assignment","closed","notification","open","spam","tool_call"]},{"type":"null"}]},"translatedText":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"default":"comment","type":"string","enum":["comment","system"]},"agentToolCalls":{"type":"array","items":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/__schema3"},"toolName":{"type":"string"}},"required":["toolName"],"additionalProperties":false}},"teamMember":{"type":"object","properties":{"email":{"type":"string"},"id":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}},"required":["email","id","image","name"],"additionalProperties":false},"email":{"type":"object","properties":{"direction":{"type":"string","enum":["inbound","outbound"]},"fromAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"toAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"authPassed":{"type":"boolean"},"autoSubmitted":{"type":"boolean"},"bcc":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"client":{"type":"string"},"listUnsubscribe":{"type":"boolean"},"replyTo":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"contentDisposition":{"type":"string"},"contentId":{"type":"string"},"contentType":{"type":"string"},"fileName":{"type":"string"},"id":{"type":"string"},"size":{"type":"number","minimum":0}},"required":["id"],"additionalProperties":false}},"mailboxAddress":{"type":"string"},"sentAt":{"type":"number"}},"required":["direction","fromAddress","toAddress"],"additionalProperties":false},"inboxAction":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/__schema4"},"outcome":{"type":"string","enum":["failed","succeeded"]},"result":{"$ref":"#/components/schemas/__schema5"},"staffUserId":{"type":"string"},"toolName":{"type":"string"}},"required":["args","outcome","result","staffUserId","toolName"],"additionalProperties":false}},"required":["authorId","authorRole","content","createdAt","id","source","type"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/support/conversations/search":{"get":{"operationId":"support-searchConversationMessages","summary":"Search Conversation Messages","description":"Returns conversation ids whose message bodies match every search term. Caps at 200 matches. Does not search contact names, emails, or subjects — those live on the listing and are matched there. Omitted `state` searches open conversations.","tags":["Messages"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project whose conversations to search."},"required":true,"description":"ID of the project whose conversations to search."},{"in":"query","name":"search","schema":{"type":"string","description":"Space-separated terms. Every term must appear somewhere in the thread, though not in one message."},"required":true,"description":"Space-separated terms. Every term must appear somewhere in the thread, though not in one message."},{"in":"query","name":"state","schema":{"type":"string","enum":["all","open","closed","spam"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/support/conversations/{conversationId}/messages/{messageId}/attachments/{attachmentId}":{"post":{"operationId":"support-getInboundEmailAttachmentUrl","summary":"Get Inbound Email Attachment","description":"Mints a short-lived download URL for one file on an inbound email. A POST rather than a GET because the URL expires and must not be cached. Returns 404 if the message or attachment does not belong to the project.","tags":["Messages"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the conversation."},"required":true,"description":"ID of the project that owns the conversation."},{"in":"path","name":"attachmentId","schema":{"type":"string","description":"Resend attachment id stored on the inbound message."},"required":true,"description":"Resend attachment id stored on the inbound message."},{"in":"path","name":"conversationId","schema":{"type":"string","description":"ID of the conversation that owns the message."},"required":true,"description":"ID of the conversation that owns the message."},{"in":"path","name":"messageId","schema":{"type":"string","description":"ID of the inbound email message the file belongs to."},"required":true,"description":"ID of the inbound email message the file belongs to."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"fileName":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"type":"string"}},"required":["expiresAt","fileName","url"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/support/widget":{"get":{"operationId":"support-getSupportWidgetSettings","summary":"Get Widget","description":"Returns the project's Support widget settings: whether the widget is enabled, branding, office hours, notifications, trusted domains, and authored tools. Authenticated; the same payload the dashboard settings page reads, including server-tool auth headers. Not the CORS-gated public widget payload visitors fetch.","tags":["Widget"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project whose widget settings to fetch."},"required":true,"description":"ID of the project whose widget settings to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"emailBranding":{"type":"object","properties":{"emailAvatarUrl":{"type":"string","maxLength":2000},"emailFooter":{"type":"string","maxLength":1000},"emailFromName":{"type":"string","maxLength":80},"emailHeaderName":{"type":"string","maxLength":80}},"additionalProperties":false},"enabled":{"type":"boolean"},"notifications":{"type":"object","properties":{"notificationMemberUserIds":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1}},"supportDomain":{"anyOf":[{"type":"string","minLength":1,"maxLength":255},{"type":"null"}]},"supportLocalPart":{"type":"string","pattern":"^[a-zA-Z0-9._-]{1,64}$"}},"additionalProperties":false},"officeHours":{"type":"object","properties":{"officeHoursEnabled":{"default":false,"type":"boolean"},"officeHoursSchedule":{"type":"object","propertyNames":{"type":"string","enum":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},"additionalProperties":{"anyOf":[{"type":"object","properties":{"close":{"type":"string","pattern":"^(?:([01]\\d|2[0-3]):([0-5]\\d)|24:00)$"},"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"}},"required":["close","open"],"additionalProperties":false},{"type":"null"}]}},"officeHoursTimezone":{"type":"string","minLength":1,"maxLength":64},"replyTime":{"type":"string","minLength":1,"maxLength":80}},"required":["officeHoursEnabled"],"additionalProperties":false},"tools":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"inputSchema":{"type":"object","properties":{"type":{"type":"string","const":"object"},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"required":{"type":"array","items":{"type":"string"}},"additionalProperties":{}},"required":["type"],"additionalProperties":{}},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"contextParameters":{"type":"array","items":{"type":"string","minLength":1}},"requestBody":{"type":"string","maxLength":8000},"endpoint":{"type":"string","minLength":1,"maxLength":2000},"serverParameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"source":{"type":"string","enum":["context","attribute","custom","model"]},"attributeKey":{"type":"string","minLength":1},"value":{"type":"string"},"fallback":{"type":"string"}},"required":["name","source"],"additionalProperties":false}},"authType":{"type":"string","enum":["none","bearer","apiKey"]},"authHeaderName":{"type":"string","minLength":1,"maxLength":100},"approval":{"type":"string","enum":["none","user"]},"contentType":{"type":"string","enum":["json","form"]},"responseFields":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1},"included":{"type":"boolean"},"displayName":{"type":"string","minLength":1},"transformations":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false}}},"required":["path","included"],"additionalProperties":false}},"descriptionParts":{"type":"object","properties":{"whatItDoes":{"type":"string"},"whenToUse":{"type":"string"},"whenNotToUse":{"type":"string"}},"additionalProperties":false},"name":{"type":"string","minLength":1,"maxLength":128},"activationConditions":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"operator":{"type":"string","enum":["IS_SET","IS_NOT_SET","EQUALS","NOT_EQUALS","CONTAINS","NOT_CONTAINS","GREATER_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL"]},"value":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["field","operator"],"additionalProperties":false}},"requestHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"],"additionalProperties":false}},"source":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"integration"},"serviceName":{"type":"string","minLength":1},"catalogToolId":{"type":"string","minLength":1}},"required":["kind","serviceName","catalogToolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"preview"},"catalogToolId":{"type":"string","minLength":1}},"required":["kind","catalogToolId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"custom"}},"required":["kind"],"additionalProperties":false}]},"responseExample":{"type":"object","properties":{"json":{"type":"string","minLength":1},"mode":{"type":"string","enum":["live","mock"]}},"required":["json","mode"],"additionalProperties":false},"authSource":{"type":"object","properties":{"kind":{"type":"string","const":"integration"},"integrationId":{"type":"string","minLength":1},"serviceName":{"type":"string","minLength":1}},"required":["kind"],"additionalProperties":false},"enabled":{"type":"boolean"},"execution":{"default":"host","type":"string","enum":["host","server"]},"status":{"type":"string","enum":["draft","active"]}},"required":["description","inputSchema","method","name","enabled","execution","status"],"additionalProperties":false}},"trustedDomains":{"type":"array","items":{"type":"string"}},"widgetBranding":{"type":"object","properties":{"agentLabel":{"type":"string","minLength":1,"maxLength":80},"avatarUrl":{"type":"string","maxLength":2000,"format":"uri"},"greeting":{"type":"string","minLength":1,"maxLength":280},"suggestedQuestions":{"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"teamDescription":{"type":"string","minLength":1,"maxLength":160},"workspaceName":{"type":"string","minLength":1,"maxLength":80}},"additionalProperties":false}},"required":["emailBranding","enabled","notifications","officeHours","tools","trustedDomains","widgetBranding"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"patch":{"operationId":"support-updateSupportWidgetEnabled","summary":"Update Widget Enabled","description":"Turns the visitor-facing Support widget on or off. The analytics SDK probes this on every install and only injects the loader when enabled.","tags":["Widget"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project whose widget to update."},"required":true,"description":"ID of the project whose widget to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the Support widget should load."}},"required":["enabled"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/support/conversations/{conversationId}":{"patch":{"operationId":"support-setConversationState","summary":"Update Conversation State","description":"Sets a conversation to open, closed, or spam. Snooze is not settable here. Manual spam goes through the same writer as the inbox so the audit line and `updatedAt` stay consistent. API-key calls leave the audit unnamed.","tags":["Conversations"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the conversation."},"required":true,"description":"ID of the project that owns the conversation."},{"in":"path","name":"conversationId","schema":{"type":"string","description":"ID of the conversation to update."},"required":true,"description":"ID of the conversation to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["open","closed","spam"],"description":"Target state. `spam` quarantines the thread; `open` and `closed` also leave spam."}},"required":["state"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["open","closed","snoozed","spam"]}},"required":["state"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/usage/balance-transactions":{"get":{"operationId":"usage-getBalanceTransactions","summary":"Get Balance Transactions","description":"Returns the project's prepaid credit ledger for a date window, grouped by UTC day. Each day carries its net change, closing balance, and a per-source breakdown (usage, payments, admin adjustments). `ledgerCoverageFrom` marks the earliest day the ledger has data for. Anything before it predates ledger tracking rather than being a zero-activity day. Defaults to the last 30 days.","tags":["Credits"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the ledger."},"required":true,"description":"ID of the project that owns the ledger."},{"in":"query","name":"dateFrom","schema":{"type":"string","description":"Start of the window as a `YYYY-MM-DD` date, inclusive and read in UTC. Defaults to 30 days before `dateTo`."}},{"in":"query","name":"dateTo","schema":{"type":"string","description":"End of the window as a `YYYY-MM-DD` date, inclusive and read in UTC. Defaults to now."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"byDay":{"type":"array","items":{"type":"object","properties":{"bySource":{"type":"array","items":{"type":"object","properties":{"count":{"type":"number"},"delta":{"type":"number"},"source":{"type":"string","enum":["baseline","usage_queue","payment","admin","stripe_webhook"]}},"required":["count","delta","source"],"additionalProperties":false}},"date":{"type":"string"},"endingBalance":{"type":"number"},"netDelta":{"type":"number"}},"required":["bySource","date","endingBalance","netDelta"],"additionalProperties":false}},"ledgerCoverageFrom":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["byDay","ledgerCoverageFrom"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/usage":{"post":{"operationId":"usage-trackUsage","summary":"Track Usage","description":"Records a single metered usage event against the project: the cost, the provider it was incurred with, and the app and action it belongs to. Events are queued and later drawn down against the project's credit balance, so this is what makes spend show up in Get Usage and the balance ledger.","tags":["Credits"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project billed for this usage."},"required":true,"description":"ID of the project billed for this usage."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cost":{"type":"number","description":"Cost of this event in USD, deducted from the project balance."},"payload":{"type":"string","description":"Optional JSON blob kept alongside the record for debugging."},"service":{"type":"string","enum":["Tinybird","OpenAI","Resend","Inngest","Moz","Vercel","DataForSeo","Gemini","OpenRouter","Vercel AI Gateway","Email Validation","Cloudflare"],"description":"Upstream provider the cost was incurred with."},"sku":{"type":"string","description":"Provider-specific billing unit, e.g. the model name or pipe queried."},"usage":{"type":"number","description":"Quantity consumed, in whatever unit the `sku` bills by (tokens, rows, emails)."},"action":{"type":"string","description":"Operation the spend is attributed to, e.g. `latestEvents` or `sendCampaign`."},"app":{"type":"string","enum":["Core","Waitlist","Changelog","Analytics","Support","ProductHunt Outreach","Workflows","Email Marketing","CRM","Social Proof","Tools","Disputes"],"description":"Saasco app the spend is attributed to."}},"required":["cost","service","sku","usage","action","app"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows":{"post":{"operationId":"workflows-createWorkflow","summary":"Create Workflow","description":"Creates a workflow definition: the trigger event, audience filters, frequency, and delay between runs. Creating one never starts a run and never sends anything. Steps and edges are added separately.","tags":["Workflows"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the workflow."},"required":true,"description":"ID of the project that owns the workflow."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Display name of the workflow."},"triggerEvent":{"type":"string","description":"Name of the analytics event that starts a run, e.g. signup."},"maxRuns":{"description":"Maximum times a contact can go through this workflow. Null means no cap.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayAmount":{"description":"Minimum delay between runs for the same contact. Pair with minDelayUnit.","anyOf":[{"default":5,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayUnit":{"description":"Unit for minDelayAmount: MINUTES, HOURS, or DAYS.","anyOf":[{"default":"MINUTES","type":"string","enum":["MINUTES","HOURS","DAYS"]},{"type":"null"}]},"frequency":{"type":"string","enum":["ONCE","EVERY"],"description":"ONCE runs a contact through at most once. EVERY re-enters them each time the trigger fires, subject to maxRuns and minDelay."},"status":{"type":"string","enum":["INACTIVE","PAUSED","ACTIVE"],"description":"INACTIVE, PAUSED, or ACTIVE."},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","operator","value"]},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"]}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"]},"description":"Audience filter groups. A contact must match at least one group to enter the workflow."}},"required":["name","triggerEvent","frequency","status","contactsFilterGroups"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"projectId":{"type":"string"},"triggerEvent":{"type":"string"},"maxRuns":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayAmount":{"anyOf":[{"default":5,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayUnit":{"anyOf":[{"default":"MINUTES","type":"string","enum":["MINUTES","HOURS","DAYS"]},{"type":"null"}]},"frequency":{"default":"ONCE","type":"string","enum":["ONCE","EVERY"]},"status":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PAUSED","ACTIVE"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}}},"required":["id","createdAt","updatedAt","name","projectId","triggerEvent","frequency","status","contactsFilterGroups"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"workflows-listWorkflows","summary":"List Workflows","description":"Lists the project's workflows. Supports paging and an optional sort.","tags":["Workflows"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project to list workflows from."},"required":true,"description":"ID of the project to list workflows from."},{"in":"query","name":"orderBy","schema":{"type":"string","description":"Field to sort by. Omit to keep the default ordering."}},{"in":"query","name":"orderDirection","schema":{"type":"string","enum":["asc","desc"],"description":"Sort direction. Defaults to `desc`. Ignored unless `orderBy` is set."}},{"in":"query","name":"skip","schema":{"type":"number","description":"Number of workflows to skip before collecting results."}},{"in":"query","name":"take","schema":{"type":"number","description":"Maximum number of workflows to return."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"projectId":{"type":"string"},"triggerEvent":{"type":"string"},"maxRuns":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayAmount":{"anyOf":[{"default":5,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayUnit":{"anyOf":[{"default":"MINUTES","type":"string","enum":["MINUTES","HOURS","DAYS"]},{"type":"null"}]},"frequency":{"default":"ONCE","type":"string","enum":["ONCE","EVERY"]},"status":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PAUSED","ACTIVE"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}}},"required":["id","createdAt","updatedAt","name","projectId","triggerEvent","frequency","status","contactsFilterGroups"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}":{"get":{"operationId":"workflows-getWorkflow","summary":"Get Workflow","description":"Fetches a single workflow by ID. Returns 404 if no workflow matches.","tags":["Workflows"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the workflow."},"required":true,"description":"ID of the project that owns the workflow."},{"in":"path","name":"workflowId","schema":{"type":"string","description":"ID of the workflow to fetch."},"required":true,"description":"ID of the workflow to fetch."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"projectId":{"type":"string"},"triggerEvent":{"type":"string"},"maxRuns":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayAmount":{"anyOf":[{"default":5,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayUnit":{"anyOf":[{"default":"MINUTES","type":"string","enum":["MINUTES","HOURS","DAYS"]},{"type":"null"}]},"frequency":{"default":"ONCE","type":"string","enum":["ONCE","EVERY"]},"status":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PAUSED","ACTIVE"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}}},"required":["id","createdAt","updatedAt","name","projectId","triggerEvent","frequency","status","contactsFilterGroups"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"workflows-updateWorkflow","summary":"Update Workflow","description":"Updates a workflow. Only the fields present in changes are written, so omitted keys stay as they are.","tags":["Workflows"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the workflow."},"required":true,"description":"ID of the project that owns the workflow."},{"in":"path","name":"workflowId","schema":{"type":"string","description":"ID of the workflow to update."},"required":true,"description":"ID of the workflow to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","properties":{"contactsFilterGroups":{"description":"Audience filter groups. A contact must match at least one group to enter the workflow.","type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","operator","value"]},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"]}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"]}},"frequency":{"description":"ONCE runs a contact through at most once. EVERY re-enters them each time the trigger fires, subject to maxRuns and minDelay.","type":"string","enum":["ONCE","EVERY"]},"maxRuns":{"description":"Maximum times a contact can go through this workflow. Null means no cap.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayAmount":{"description":"Minimum delay between runs for the same contact. Pair with minDelayUnit.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayUnit":{"description":"Unit for minDelayAmount: MINUTES, HOURS, or DAYS.","anyOf":[{"type":"string","enum":["MINUTES","HOURS","DAYS"]},{"type":"null"}]},"name":{"description":"Display name of the workflow.","type":"string"},"projectId":{"type":"string"},"status":{"description":"INACTIVE, PAUSED, or ACTIVE.","type":"string","enum":["INACTIVE","PAUSED","ACTIVE"]},"triggerEvent":{"description":"Name of the analytics event that starts a run, e.g. signup.","type":"string"}},"description":"Fields to change. Anything omitted is left as-is."}},"required":["changes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"name":{"type":"string"},"projectId":{"type":"string"},"triggerEvent":{"type":"string"},"maxRuns":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayAmount":{"anyOf":[{"default":5,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"minDelayUnit":{"anyOf":[{"default":"MINUTES","type":"string","enum":["MINUTES","HOURS","DAYS"]},{"type":"null"}]},"frequency":{"default":"ONCE","type":"string","enum":["ONCE","EVERY"]},"status":{"default":"INACTIVE","type":"string","enum":["INACTIVE","PAUSED","ACTIVE"]},"contactsFilterGroups":{"type":"array","items":{"type":"object","properties":{"filters":{"type":"array","items":{"type":"object","properties":{"attributeDistinctId":{"type":"string","description":"Contact attribute distinct id to filter on."},"attributeType":{"default":"string","description":"Attribute type. Defaults to string when omitted.","type":"string","enum":["string","number","boolean","date","url","email"]},"operator":{"type":"string","enum":["equals","contains","notEquals","notContains","gt","gte","lt","lte","on","since","before","between","last"],"description":"Comparison operator for the attribute value."},"value":{"type":"string","description":"Value to compare the attribute against."}},"required":["attributeDistinctId","attributeType","operator","value"],"additionalProperties":false},"description":"Attribute filters combined with groupType."},"oneDayEventFilters":{"description":"Event filters evaluated over the last 24 hours only.","type":"array","items":{"type":"object","properties":{"eventName":{"type":"string","description":"Analytics event name."},"operator":{"type":"string","enum":["performed","notPerformed"],"description":"Whether the contact performed the event in the last 24 hours."}},"required":["eventName","operator"],"additionalProperties":false}},"groupType":{"type":"string","enum":["AND","OR","NOT"],"description":"How filters in this group are combined."},"requireSubscribed":{"description":"When true, the group is ANDed with `$subscribed == true`. Set by email sending, not the filter UI.","type":"boolean"}},"required":["filters","groupType"],"additionalProperties":false}}},"required":["id","createdAt","updatedAt","name","projectId","triggerEvent","frequency","status","contactsFilterGroups"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"workflows-deleteWorkflow","summary":"Delete Workflow","description":"Permanently deletes a workflow and everything cascading from it: steps, edges, runs, and run logs. Cannot be undone.","tags":["Workflows"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the workflow."},"required":true,"description":"ID of the project that owns the workflow."},{"in":"path","name":"workflowId","schema":{"type":"string","description":"ID of the workflow to delete."},"required":true,"description":"ID of the workflow to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}/actions":{"post":{"operationId":"workflows-createWorkflowStep","summary":"Create Workflow Step","description":"Create a new workflow action","tags":["Steps"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{}},"required":["id","value"]}}},"required":["inputFields"]},"actionId":{"type":"string","enum":["sendCampaign","delay","audienceFilter"]}},"required":["id","data","actionId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{}},"required":["id","value"],"additionalProperties":false}}},"required":["inputFields"],"additionalProperties":false},"actionId":{"type":"string","enum":["sendCampaign","delay","audienceFilter"]}},"required":["id","createdAt","updatedAt","workflowId","projectId","data","actionId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"workflows-listWorkflowSteps","summary":"List Workflow Steps","description":"List all workflow actions","tags":["Steps"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{}},"required":["id","value"],"additionalProperties":false}}},"required":["inputFields"],"additionalProperties":false},"actionId":{"type":"string","enum":["sendCampaign","delay","audienceFilter"]}},"required":["id","createdAt","updatedAt","workflowId","projectId","data","actionId"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}/actions/{stepId}":{"get":{"operationId":"workflows-getWorkflowStep","summary":"Get Workflow Step","description":"Get a workflow action by ID","tags":["Steps"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"stepId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{}},"required":["id","value"],"additionalProperties":false}}},"required":["inputFields"],"additionalProperties":false},"actionId":{"type":"string","enum":["sendCampaign","delay","audienceFilter"]}},"required":["id","createdAt","updatedAt","workflowId","projectId","data","actionId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"workflows-updateWorkflowStep","summary":"Update Workflow Step","description":"Update a workflow action by ID","tags":["Steps"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"stepId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","properties":{"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{}},"required":["id","value"]}}},"required":["inputFields"]},"projectId":{"type":"string"},"workflowId":{"type":"string"},"actionId":{"type":"string","enum":["sendCampaign","delay","audienceFilter"]}}}},"required":["changes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{}},"required":["id","value"],"additionalProperties":false}}},"required":["inputFields"],"additionalProperties":false},"actionId":{"type":"string","enum":["sendCampaign","delay","audienceFilter"]}},"required":["id","createdAt","updatedAt","workflowId","projectId","data","actionId"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"workflows-deleteWorkflowStep","summary":"Delete Workflow Step","description":"Delete a workflow action by ID","tags":["Steps"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"stepId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}/edges":{"post":{"operationId":"workflows-createWorkflowEdge","summary":"Create Workflow Edge","description":"Create a new workflow edge","tags":["Edges"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"type":{"type":"string"}},"required":["id","source","target","type"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"workflowId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"type":{"type":"string"}},"required":["id","projectId","workflowId","createdAt","updatedAt","source","target","type"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"workflows-listWorkflowEdges","summary":"List Workflow Edges","description":"List all workflow edges","tags":["Edges"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"workflowId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"type":{"type":"string"}},"required":["id","projectId","workflowId","createdAt","updatedAt","source","target","type"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}/edges/{edgeId}":{"get":{"operationId":"workflows-getWorkflowEdge","summary":"Get Workflow Edge","description":"Get a workflow edge by ID","tags":["Edges"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"edgeId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"workflowId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"type":{"type":"string"}},"required":["id","projectId","workflowId","createdAt","updatedAt","source","target","type"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"workflows-updateWorkflowEdge","summary":"Update Workflow Edge","description":"Update a workflow edge by ID","tags":["Edges"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"edgeId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"type":{"type":"string"},"workflowId":{"type":"string"}}}},"required":["changes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"workflowId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"type":{"type":"string"}},"required":["id","projectId","workflowId","createdAt","updatedAt","source","target","type"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"workflows-deleteWorkflowEdge","summary":"Delete Workflow Edge","description":"Delete a workflow edge by ID","tags":["Edges"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"edgeId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}/runs":{"post":{"operationId":"workflows-createWorkflowRun","summary":"Create Workflow Run","description":"Create a new workflow run","tags":["Runs"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queuedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"erroredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"activeAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactDistinctId":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","properties":{"initialProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"usageIdentifier":{"type":"object","properties":{"action":{"type":"string","description":"Operation the spend is attributed to, e.g. `latestEvents` or `sendCampaign`."},"app":{"type":"string","enum":["Core","Waitlist","Changelog","Analytics","Support","ProductHunt Outreach","Workflows","Email Marketing","CRM","Social Proof","Tools","Disputes"],"description":"Saasco app the spend is attributed to."},"projectId":{"type":"string","description":"ID of the project billed for this usage."}},"required":["action","app","projectId"]}},"required":["initialProperties","usageIdentifier"]},"previousStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorData":{"anyOf":[{},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","completed","queued","errored"]},"frequency":{"type":"string","enum":["ONCE","EVERY"]}},"required":["data","status","frequency"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"queuedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"erroredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"activeAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"runId":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"contactDistinctId":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","properties":{"initialProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"usageIdentifier":{"type":"object","properties":{"action":{"type":"string","description":"Operation the spend is attributed to, e.g. `latestEvents` or `sendCampaign`."},"app":{"type":"string","enum":["Core","Waitlist","Changelog","Analytics","Support","ProductHunt Outreach","Workflows","Email Marketing","CRM","Social Proof","Tools","Disputes"],"description":"Saasco app the spend is attributed to."},"projectId":{"type":"string","description":"ID of the project billed for this usage."}},"required":["action","app","projectId"],"additionalProperties":false}},"required":["initialProperties","usageIdentifier"],"additionalProperties":false},"previousStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorData":{"anyOf":[{},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","completed","queued","errored"]}},"required":["id","createdAt","updatedAt","runId","workflowId","projectId","data","status"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"get":{"operationId":"workflows-listWorkflowRuns","summary":"List Workflow Runs","description":"List all workflow runs","tags":["Runs"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true},{"in":"query","name":"contactDistinctId","schema":{"type":"string"}},{"in":"query","name":"nextStepAtGt","schema":{"type":"string"}},{"in":"query","name":"nextStepAtLt","schema":{"type":"string"}},{"in":"query","name":"orderBy","schema":{"type":"string"}},{"in":"query","name":"orderDirection","schema":{"type":"string","enum":["asc","desc"]}},{"in":"query","name":"skip","schema":{"type":"number"}},{"in":"query","name":"skipCount","schema":{"type":"boolean"}},{"in":"query","name":"status","schema":{"type":"string","enum":["active","paused","completed","queued","errored"]}},{"in":"query","name":"take","schema":{"type":"number"}},{"in":"query","name":"workflowStatus","schema":{"type":"string","enum":["INACTIVE","PAUSED","ACTIVE"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"queuedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"erroredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"activeAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"runId":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"contactDistinctId":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","properties":{"initialProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"usageIdentifier":{"type":"object","properties":{"action":{"type":"string","description":"Operation the spend is attributed to, e.g. `latestEvents` or `sendCampaign`."},"app":{"type":"string","enum":["Core","Waitlist","Changelog","Analytics","Support","ProductHunt Outreach","Workflows","Email Marketing","CRM","Social Proof","Tools","Disputes"],"description":"Saasco app the spend is attributed to."},"projectId":{"type":"string","description":"ID of the project billed for this usage."}},"required":["action","app","projectId"],"additionalProperties":false}},"required":["initialProperties","usageIdentifier"],"additionalProperties":false},"previousStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorData":{"anyOf":[{},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","completed","queued","errored"]}},"required":["id","createdAt","updatedAt","runId","workflowId","projectId","data","status"],"additionalProperties":false}}},"required":["count","data"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}/runs/{workflowRunId}":{"get":{"operationId":"workflows-getWorkflowRun","summary":"Get Workflow Run","description":"Get a workflow run by ID","tags":["Runs"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowRunId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"queuedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"erroredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"activeAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"runId":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"contactDistinctId":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","properties":{"initialProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"usageIdentifier":{"type":"object","properties":{"action":{"type":"string","description":"Operation the spend is attributed to, e.g. `latestEvents` or `sendCampaign`."},"app":{"type":"string","enum":["Core","Waitlist","Changelog","Analytics","Support","ProductHunt Outreach","Workflows","Email Marketing","CRM","Social Proof","Tools","Disputes"],"description":"Saasco app the spend is attributed to."},"projectId":{"type":"string","description":"ID of the project billed for this usage."}},"required":["action","app","projectId"],"additionalProperties":false}},"required":["initialProperties","usageIdentifier"],"additionalProperties":false},"previousStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorData":{"anyOf":[{},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","completed","queued","errored"]}},"required":["id","createdAt","updatedAt","runId","workflowId","projectId","data","status"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"put":{"operationId":"workflows-updateWorkflowRun","summary":"Update Workflow Run","description":"Update a workflow run by ID","tags":["Runs"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowRunId","schema":{"type":"string"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"changes":{"type":"object","properties":{"activeAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactDistinctId":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","properties":{"initialProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"usageIdentifier":{"type":"object","properties":{"action":{"type":"string","description":"Operation the spend is attributed to, e.g. `latestEvents` or `sendCampaign`."},"app":{"type":"string","enum":["Core","Waitlist","Changelog","Analytics","Support","ProductHunt Outreach","Workflows","Email Marketing","CRM","Social Proof","Tools","Disputes"],"description":"Saasco app the spend is attributed to."},"projectId":{"type":"string","description":"ID of the project billed for this usage."}},"required":["action","app","projectId"]}},"required":["initialProperties","usageIdentifier"]},"erroredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"previousStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"queuedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"runId":{"type":"string"},"errorData":{"anyOf":[{},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","completed","queued","errored"]}}}},"required":["changes"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"queuedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"erroredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"activeAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"runId":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"contactDistinctId":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","properties":{"initialProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"usageIdentifier":{"type":"object","properties":{"action":{"type":"string","description":"Operation the spend is attributed to, e.g. `latestEvents` or `sendCampaign`."},"app":{"type":"string","enum":["Core","Waitlist","Changelog","Analytics","Support","ProductHunt Outreach","Workflows","Email Marketing","CRM","Social Proof","Tools","Disputes"],"description":"Saasco app the spend is attributed to."},"projectId":{"type":"string","description":"ID of the project billed for this usage."}},"required":["action","app","projectId"],"additionalProperties":false}},"required":["initialProperties","usageIdentifier"],"additionalProperties":false},"previousStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorData":{"anyOf":[{},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","completed","queued","errored"]}},"required":["id","createdAt","updatedAt","runId","workflowId","projectId","data","status"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}},"delete":{"operationId":"workflows-deleteWorkflowRun","summary":"Delete Workflow Run","description":"Delete a workflow run by ID","tags":["Runs"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowRunId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}/runs/{workflowRunId}/takeNextStep":{"post":{"operationId":"workflows-takeNextStep","summary":"Take Next Step","description":"Take the next action in a workflow run","tags":["Runs"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowRunId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"queuedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"erroredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"activeAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"runId":{"type":"string"},"workflowId":{"type":"string"},"projectId":{"type":"string"},"contactDistinctId":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","properties":{"initialProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"usageIdentifier":{"type":"object","properties":{"action":{"type":"string","description":"Operation the spend is attributed to, e.g. `latestEvents` or `sendCampaign`."},"app":{"type":"string","enum":["Core","Waitlist","Changelog","Analytics","Support","ProductHunt Outreach","Workflows","Email Marketing","CRM","Social Proof","Tools","Disputes"],"description":"Saasco app the spend is attributed to."},"projectId":{"type":"string","description":"ID of the project billed for this usage."}},"required":["action","app","projectId"],"additionalProperties":false}},"required":["initialProperties","usageIdentifier"],"additionalProperties":false},"previousStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextStepAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorData":{"anyOf":[{},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","completed","queued","errored"]}},"required":["id","createdAt","updatedAt","runId","workflowId","projectId","data","status"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}/processWorkflowRuns":{"post":{"operationId":"workflows-processWorkflowRuns","summary":"Process Workflow Runs","description":"Process all actions in a workflow run","tags":["Runs"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}/runs/{workflowRunId}/logs":{"get":{"operationId":"workflows-listWorkflowRunLogs","summary":"List Workflow Run Logs","description":"List all logs for a workflow run","tags":["Runs"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowId","schema":{"type":"string"},"required":true},{"in":"path","name":"workflowRunId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"workflowId":{"type":"string"},"workflowRunId":{"type":"string"},"workflowStepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","workflowId","workflowRunId"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.NOT_FOUND"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}},"/projects/{projectId}/workflows/{workflowId}/verify":{"post":{"operationId":"workflows-verifyWorkflowConfig","summary":"Verify Workflow Config","description":"Checks that each sendCampaign step has a campaign and that the campaign itself verifies. Returns isValid plus per-step errors. Does not activate the workflow or start a run.","tags":["Workflows"],"security":[{"Authorization":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string","description":"ID of the project that owns the workflow."},"required":true,"description":"ID of the project that owns the workflow."},{"in":"path","name":"workflowId","schema":{"type":"string","description":"ID of the workflow to verify."},"required":true,"description":"ID of the workflow to verify."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"error":{"type":"string"},"stepId":{"type":"string"}},"required":["error","stepId"],"additionalProperties":false}},"isValid":{"type":"boolean"}},"required":["errors","isValid"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.FORBIDDEN"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.INTERNAL_SERVER_ERROR"}}}}}}}},"components":{"schemas":{"__schema0":{"type":"object","properties":{"attrs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"content":{"type":"array","items":{"$ref":"#/components/schemas/__schema0"}},"marks":{"type":"array","items":{"type":"object","properties":{"attrs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"type":{"type":"string"}},"required":["type"]}},"text":{"type":"string"},"type":{"type":"string"}},"required":["type"]},"error.BAD_REQUEST":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Invalid input data"},"code":{"type":"string","description":"The error code","example":"BAD_REQUEST"},"issues":{"description":"An array of issues that were responsible for the error","example":[],"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Invalid input data error (400)","description":"The error information","example":{"code":"BAD_REQUEST","message":"Invalid input data","issues":[]}},"error.UNAUTHORIZED":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Authorization not provided"},"code":{"type":"string","description":"The error code","example":"UNAUTHORIZED"},"issues":{"description":"An array of issues that were responsible for the error","example":[],"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Authorization not provided error (401)","description":"The error information","example":{"code":"UNAUTHORIZED","message":"Authorization not provided","issues":[]}},"error.FORBIDDEN":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Insufficient access"},"code":{"type":"string","description":"The error code","example":"FORBIDDEN"},"issues":{"description":"An array of issues that were responsible for the error","example":[],"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Insufficient access error (403)","description":"The error information","example":{"code":"FORBIDDEN","message":"Insufficient access","issues":[]}},"error.INTERNAL_SERVER_ERROR":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Internal server error"},"code":{"type":"string","description":"The error code","example":"INTERNAL_SERVER_ERROR"},"issues":{"description":"An array of issues that were responsible for the error","example":[],"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Internal server error error (500)","description":"The error information","example":{"code":"INTERNAL_SERVER_ERROR","message":"Internal server error","issues":[]}},"error.NOT_FOUND":{"type":"object","properties":{"message":{"type":"string","description":"The error message","example":"Not found"},"code":{"type":"string","description":"The error code","example":"NOT_FOUND"},"issues":{"description":"An array of issues that were responsible for the error","example":[],"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false,"title":"Not found error (404)","description":"The error information","example":{"code":"NOT_FOUND","message":"Not found","issues":[]}},"__schema1":{"type":"object","properties":{"attrs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"content":{"type":"array","items":{"$ref":"#/components/schemas/__schema1"}},"marks":{"type":"array","items":{"type":"object","properties":{"attrs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"type":{"type":"string"}},"required":["type"],"additionalProperties":false}},"text":{"type":"string"},"type":{"type":"string"}},"required":["type"],"additionalProperties":false},"__schema2":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"helpCenterId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"articles":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projectId":{"type":"string"},"type":{"default":"public","type":"string","enum":["public","internal"]},"title":{"type":"string"},"slug":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"default":"draft","type":"string","enum":["draft","published"]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"collectionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorId":{"type":"string"},"views":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"happyReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"neutralReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sadReactions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},{"type":"null"}]},"collection":{"anyOf":[{"type":"object","properties":{"helpCenterId":{"type":"string"},"name":{"type":"string"}},"required":["helpCenterId","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","createdAt","updatedAt","projectId","type","title","slug","body","state","order","authorId","views","conversions","happyReactions","neutralReactions","sadReactions"],"additionalProperties":false}},"children":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/__schema2"}}},"required":["id","createdAt","updatedAt","projectId","helpCenterId","name","order","articles","children"],"additionalProperties":false},"__schema3":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/__schema3"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema3"}}]},"__schema4":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/__schema4"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema4"}}]},"__schema5":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/__schema5"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema5"}}]}},"securitySchemes":{"Authorization":{"type":"http","scheme":"bearer"}}}}