{"openapi":"3.1.2","info":{"title":"SendPulse Pop-up API","version":"1.0","description":"Public REST API of the SendPulse Pop-up service. It lets you manage projects and pop-ups, read pop-up and NPS statistics, tariff limits and subscribers collected by pop-ups.\n\nSuccessful responses are wrapped into `{ \"result\": true, \"data\": ... }`. Paginated lists also contain `pageInfo`. Failed responses are wrapped into `{ \"result\": false, \"errors\": ... }`.\n"},"servers":[{"url":"https:\/\/api.sendpulse.com\/v2\/pop-ups","description":"Production server"}],"tags":[{"name":"Project","description":"Projects (websites) that contain pop-ups"},{"name":"Popup","description":"Pop-ups and their display conditions"},{"name":"Project statistic","description":"Aggregated statistics of all pop-ups in a project"},{"name":"Popup statistic","description":"Statistics of a single pop-up, including NPS results"},{"name":"Tariff","description":"Tariff plan of the account and its limits"},{"name":"Subscribers","description":"Subscribers (leads) collected by pop-ups"}],"security":[{"apiKey":[]},{"oauth2":[]}],"paths":{"\/widgets\/list":{"get":{"operationId":"listProjects","tags":["Project"],"summary":"Get a list of projects","description":"Returns a list of projects with information about each project","parameters":[{"$ref":"#\/components\/parameters\/First"},{"$ref":"#\/components\/parameters\/Offset"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Project"}},"pageInfo":{"$ref":"#\/components\/schemas\/PageInfo"}}}}}},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"}}}},"\/widgets":{"post":{"operationId":"createProject","tags":["Project"],"summary":"Create a project","description":"Creates a new project with the specified properties and returns the created project with its ID","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateProjectRequest"}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/Project"}}}}}},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"}}}},"\/popups\/conditions":{"get":{"operationId":"listPopupConditions","tags":["Popup"],"summary":"Get a list of available display conditions for pop-ups","description":"Returns a list of available display conditions for pop-ups with detailed information","responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/DisplayCondition"}},"pageInfo":{"$ref":"#\/components\/schemas\/PageInfo"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"}}}},"\/popups\/list\/quiz\/{projectId}":{"get":{"operationId":"listQuizPopups","tags":["Popup"],"summary":"Get a list of quiz pop-ups by project ID","description":"Returns a list of quiz pop-ups of the project with information about each pop-up","parameters":[{"$ref":"#\/components\/parameters\/ProjectId"},{"$ref":"#\/components\/parameters\/First"},{"$ref":"#\/components\/parameters\/Offset"}],"responses":{"200":{"$ref":"#\/components\/responses\/PopupList"},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/AccessDenied"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/popups\/list\/{projectId}":{"get":{"operationId":"listPopups","tags":["Popup"],"summary":"Get a list of pop-ups by project ID","description":"Returns a list of pop-ups of the project with information about each pop-up","parameters":[{"$ref":"#\/components\/parameters\/ProjectId"},{"$ref":"#\/components\/parameters\/First"},{"$ref":"#\/components\/parameters\/Offset"}],"responses":{"200":{"$ref":"#\/components\/responses\/PopupList"},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/AccessDenied"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/popups\/{popupId}\/set-state":{"post":{"operationId":"setPopupState","tags":["Popup"],"summary":"Set a pop-up state","description":"Enables or disables a pop-up on your website and returns the updated pop-up","parameters":[{"$ref":"#\/components\/parameters\/PopupId"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SetPopupStateRequest"}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/Popup"}}}}}},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/AccessDenied"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/popups\/{popupId}":{"delete":{"operationId":"deletePopup","tags":["Popup"],"summary":"Delete a pop-up","description":"Deletes the pop-up with the specified ID","parameters":[{"$ref":"#\/components\/parameters\/PopupId"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/AccessDenied"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/statistics\/widget\/{projectId}":{"get":{"operationId":"getProjectStatistics","tags":["Project statistic"],"summary":"Get project statistics","description":"Returns how many website visitors saw all pop-ups of the project and interacted with them","parameters":[{"$ref":"#\/components\/parameters\/ProjectId"},{"$ref":"#\/components\/parameters\/Start"},{"$ref":"#\/components\/parameters\/End"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/ProjectStatistic"}}}}}},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/statistics\/popup\/{popupId}":{"get":{"operationId":"getPopupStatistics","tags":["Popup statistic"],"summary":"Get pop-up statistics","description":"Returns how many website visitors saw the pop-up and interacted with it","parameters":[{"$ref":"#\/components\/parameters\/PopupId"},{"$ref":"#\/components\/parameters\/Start"},{"$ref":"#\/components\/parameters\/End"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/PopupStatistic"}}}}}},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/statistics\/nps\/{popupId}":{"get":{"operationId":"getNpsStatistics","tags":["Popup statistic"],"summary":"Get NPS statistics by variants","description":"Returns a list of NPS variants with the number of votes for each variant per day and base information about the NPS button","parameters":[{"$ref":"#\/components\/parameters\/PopupId"},{"$ref":"#\/components\/parameters\/Start"},{"$ref":"#\/components\/parameters\/End"},{"$ref":"#\/components\/parameters\/First"},{"$ref":"#\/components\/parameters\/Offset"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/NpsStatistic"}}}}}}},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/statistics\/nps\/{popupId}\/aggregated":{"get":{"operationId":"getAggregatedNpsStatistics","tags":["Popup statistic"],"summary":"Get aggregated NPS statistics","description":"Returns the NPS score and the number of promoters, neutrals and critics","parameters":[{"$ref":"#\/components\/parameters\/PopupId"},{"$ref":"#\/components\/parameters\/Start"},{"$ref":"#\/components\/parameters\/End"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/AggregatedNpsStatistic"}}}}}},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/tariff\/limits":{"get":{"operationId":"getTariffLimits","tags":["Tariff"],"summary":"Get tariff plan limits","description":"Returns information about the tariff plan of the account and its limits","responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/TariffLimits"}}}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"}}}},"\/subscribers\/get\/{subscriberId}":{"get":{"operationId":"getSubscriber","tags":["Subscribers"],"summary":"Get a subscriber","description":"Returns detailed information about the subscriber","parameters":[{"name":"subscriberId","in":"path","required":true,"description":"Subscriber ID","schema":{"type":"integer"},"example":1024}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/Subscriber"}}}}}},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/AccessDenied"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/subscribers\/by-popup\/{popupId}":{"get":{"operationId":"listSubscribersByPopup","tags":["Subscribers"],"summary":"Get subscribers by pop-up","description":"Returns a list of subscribers collected by the pop-up","parameters":[{"$ref":"#\/components\/parameters\/PopupId"},{"$ref":"#\/components\/parameters\/First"},{"$ref":"#\/components\/parameters\/Offset"}],"responses":{"200":{"$ref":"#\/components\/responses\/SubscriberList"},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/AccessDenied"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}},"\/subscribers\/by-project\/{projectId}":{"get":{"operationId":"listSubscribersByProject","tags":["Subscribers"],"summary":"Get subscribers by project","description":"Returns a list of subscribers collected by all pop-ups of the project","parameters":[{"$ref":"#\/components\/parameters\/ProjectId"},{"$ref":"#\/components\/parameters\/First"},{"$ref":"#\/components\/parameters\/Offset"}],"responses":{"200":{"$ref":"#\/components\/responses\/SubscriberList"},"400":{"$ref":"#\/components\/responses\/ValidationError"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/AccessDenied"},"404":{"$ref":"#\/components\/responses\/NotFound"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"Authorization"},"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https:\/\/api.sendpulse.com\/oauth\/access_token","scopes":{}}}}},"parameters":{"ProjectId":{"name":"projectId","in":"path","required":true,"description":"Project ID","schema":{"type":"string","format":"uuid"},"example":"7803a6ea-4b32-44d7-a245-5cda4e4f2031"},"PopupId":{"name":"popupId","in":"path","required":true,"description":"Pop-up ID. It can be obtained using the \"Get a list of pop-ups by project ID\" method or in the pop-up builder address bar in your account.","schema":{"type":"string","format":"uuid"},"example":"af1b0e2a-bff9-4d09-a7d9-99d61d2b43b5"},"First":{"name":"first","in":"query","required":false,"description":"Maximum number of records to return","schema":{"type":"integer","default":100},"example":10},"Offset":{"name":"offset","in":"query","required":false,"description":"Number of records to skip","schema":{"type":"integer","default":0},"example":0},"Start":{"name":"start","in":"query","required":false,"description":"Start of the period, Unix timestamp","schema":{"type":"integer"},"example":1691366400},"End":{"name":"end","in":"query","required":false,"description":"End of the period, Unix timestamp. Defaults to the current time.","schema":{"type":"integer"},"example":1691971200}},"responses":{"PopupList":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Popup"}},"pageInfo":{"$ref":"#\/components\/schemas\/PageInfo"}}}}}},"SubscriberList":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"result":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Subscriber"}},"pageInfo":{"$ref":"#\/components\/schemas\/PageInfo"}}}}}},"ValidationError":{"description":"Validation error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationErrorResponse"}}}},"Unauthorized":{"description":"Unauthorized","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"result":false,"errors":["Unauthorized user"]}}}},"AccessDenied":{"description":"Access denied","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"result":false,"errors":["Access denied"]}}}},"NotFound":{"description":"Resource not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ErrorResponse"},"example":{"result":false,"errors":["Route not found"]}}}}},"schemas":{"SuccessResponse":{"title":"Success response","type":"object","properties":{"result":{"type":"boolean","examples":[true]}}},"ErrorResponse":{"title":"Error response","type":"object","properties":{"result":{"type":"boolean","examples":[false]},"errors":{"type":"array","description":"List of error messages","items":{"type":"string"},"examples":[["Unauthorized user"]]}}},"ValidationErrorResponse":{"title":"Validation error response","type":"object","properties":{"result":{"type":"boolean","examples":[false]},"errors":{"type":"object","description":"Map of validation errors: the key is the invalid field, the value is the error message","additionalProperties":{"type":"string"},"examples":[{"name.length.max":"Too long, max length - {{255}}","url":"Invalid URL 'bad_url'"}]}}},"PageInfo":{"title":"Page info","type":"object","properties":{"total":{"type":"integer","description":"Total number of records","examples":[25]},"offset":{"type":"integer","description":"Number of skipped records","examples":[0]},"first":{"type":"integer","description":"Maximum number of returned records","examples":[10]},"arguments":{"type":"object","additionalProperties":true,"description":"Additional pagination arguments. Currently always empty and serialized as an empty array `[]`.","examples":[[]]}}},"CreateProjectRequest":{"title":"Create project request","type":"object","required":["name","url"],"properties":{"name":{"type":"string","maxLength":255,"description":"Project name","examples":["My website"]},"url":{"type":"string","format":"uri","description":"Project website URL","examples":["https:\/\/example.com"]}}},"SetPopupStateRequest":{"title":"Set pop-up state request","type":"object","required":["is_enabled"],"properties":{"is_enabled":{"type":"boolean","description":"Pop-up state: pass `true` to enable the pop-up and `false` to disable it","examples":[true]}}},"Project":{"title":"Project","type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Project ID","examples":["7803a6ea-4b32-44d7-a245-5cda4e4f2031"]},"name":{"type":"string","description":"Project name","examples":["My website"]},"urls":{"type":"array","description":"Project website URLs","items":{"type":"string","format":"uri"},"examples":[["https:\/\/example.com"]]},"domains":{"type":"array","description":"Project website domains","items":{"type":"string","format":"hostname"},"examples":[["example.com"]]},"integrationCode":{"type":"string","description":"Code that installs the project on your website","examples":["<script src=\"\/\/web.webformscr.com\/apps\/fc3\/build\/loader.js\" async sp-form-id=\"...\"><\/script>"]},"updatedAt":{"$ref":"#\/components\/schemas\/DateTime"},"createdAt":{"$ref":"#\/components\/schemas\/DateTime"}}},"DateTime":{"type":"string","description":"Date and time in the `YYYY-MM-DD hh:mm:ss` format","examples":["2023-08-07 20:14:15"]},"Popup":{"title":"Pop-up","type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Pop-up ID","examples":["af1b0e2a-bff9-4d09-a7d9-99d61d2b43b5"]},"widgetId":{"type":"string","format":"uuid","description":"Project ID","examples":["7803a6ea-4b32-44d7-a245-5cda4e4f2031"]},"isEnabled":{"type":"boolean","description":"Whether the pop-up is shown on the website","examples":[true]},"type":{"type":"integer","enum":[1,2,3,4,5,6,7,8],"description":"Pop-up type:\n * `2` - modal window;\n * `3` - overlay;\n * `4` - floating;\n * `5` - cookie request;\n * `6` - horizontal;\n * `7` - video;\n * `8` - launcher.\n","examples":[2]},"style":{"type":"integer","enum":[1,2,3],"description":"Pop-up style:\n * `1` - white;\n * `2` - dark;\n * `3` - colored.\n","examples":[1]},"position":{"type":"integer","enum":[1,2,3,4,5,6,7,8,9,10,11],"description":"Pop-up position:\n * `1` - bottom-left;\n * `2` - bottom-right;\n * `3` - automatic;\n * `4` - bottom;\n * `5` - bottom-center;\n * `6` - left;\n * `7` - right;\n * `8` - center;\n * `9` - top-left;\n * `10` - top-right;\n * `11` - top-center.\n","examples":[8]},"text":{"type":["string","null"],"description":"Text message","examples":["Subscribe to our newsletter"]},"name":{"type":"string","description":"Pop-up name","examples":["Newsletter pop-up"]},"color":{"type":["string","null"],"description":"Button style color","examples":["#008FED"]},"image":{"$ref":"#\/components\/schemas\/PopupImage"},"video":{"$ref":"#\/components\/schemas\/PopupVideo"},"conditions":{"type":"array","description":"Display conditions of the pop-up","items":{"$ref":"#\/components\/schemas\/PopupCondition"}},"containsNPS":{"type":"boolean","description":"Whether the pop-up contains an NPS button","examples":[false]},"abtest":{"$ref":"#\/components\/schemas\/AbTest"},"preview":{"type":["string","null"],"description":"Preview image URL","examples":["https:\/\/files.sendpulse.com\/preview\/af1b0e2a.png"]},"matched":{"type":"string","description":"Logical operator that combines the display conditions","examples":["all"]},"parent":{"$ref":"#\/components\/schemas\/PopupReference"},"target":{"$ref":"#\/components\/schemas\/PopupReference"},"statistic":{"$ref":"#\/components\/schemas\/PopupStatistic"},"updatedAt":{"$ref":"#\/components\/schemas\/DateTime"},"createdAt":{"$ref":"#\/components\/schemas\/DateTime"}}},"PopupImage":{"title":"Pop-up image","type":"object","description":"Pop-up image. If the pop-up has no image, an empty array `[]` is returned.","properties":{"url":{"type":"string","format":"uri","description":"URL of the image uploaded to the SendPulse file manager","examples":["https:\/\/files.sendpulse.com\/image.png"]},"position":{"type":"integer","enum":[1,2,3,4],"description":"Image position:\n * `1` - left;\n * `2` - right;\n * `3` - top;\n * `4` - background.\n","examples":[1]}}},"PopupVideo":{"title":"Pop-up video","type":"object","description":"Pop-up video. If the pop-up has no video, an empty array `[]` is returned.","properties":{"url":{"type":"string","format":"uri","description":"URL of the video uploaded to the SendPulse file manager","examples":["https:\/\/files.sendpulse.com\/video.mp4"]},"format":{"type":"integer","enum":[1,2],"description":"Video format:\n * `1` - vertical;\n * `2` - horizontal.\n","examples":[2]},"playbackType":{"type":"integer","enum":[1,2],"description":"Video playback type:\n * `1` - automatic;\n * `2` - on click.\n","examples":[1]}}},"PopupCondition":{"title":"Pop-up display condition","type":"object","properties":{"name":{"type":"string","description":"Display condition name","examples":["timeOnPage"]},"type":{"type":"string","description":"Condition type","examples":["show"]},"groups":{"type":"array","description":"Condition rules","items":{"$ref":"#\/components\/schemas\/PopupConditionGroup"}}}},"PopupConditionGroup":{"title":"Pop-up display condition rule","type":"object","properties":{"operation":{"type":["string","null"],"description":"Comparison operation","examples":["more"]},"value":{"type":["string","null"],"description":"Value to compare with","examples":["10"]},"variableName":{"type":["string","null"],"description":"Name of the user variable used in the rule","examples":["city"]},"unit":{"type":["string","null"],"description":"Unit of the value","examples":["sec"]}}},"PopupReference":{"title":"Pop-up reference","type":"object","description":"Linked pop-up. Both fields are `null` if there is no linked pop-up.","properties":{"id":{"type":["string","null"],"format":"uuid","description":"Pop-up ID","examples":["af1b0e2a-bff9-4d09-a7d9-99d61d2b43b5"]},"name":{"type":["string","null"],"description":"Pop-up name","examples":["Newsletter pop-up"]}}},"AbTest":{"title":"A\/B test","type":"object","description":"A\/B test of the pop-up. If the pop-up has no A\/B test, an empty array `[]` is returned.","properties":{"status":{"type":"integer","enum":[0,1],"description":"A\/B test status:\n * `0` - finished;\n * `1` - active.\n","examples":[1]},"finishInitiator":{"type":["integer","null"],"enum":[1,2,null],"description":"A\/B test finish initiator:\n * `1` - manual (by user);\n * `2` - auto (finish condition reached).\n","examples":[2]},"winnerSign":{"type":"integer","description":"Sign of the winner variant","examples":[0]},"finishConditions":{"type":"array","description":"A\/B test finish conditions","items":{"$ref":"#\/components\/schemas\/AbTestFinishCondition"}},"winner":{"type":["string","null"],"description":"Winner variant ID. Empty if the test is not finished yet.","examples":["af1b0e2a-bff9-4d09-a7d9-99d61d2b43b5"]},"separatedConditions":{"type":"boolean","description":"`true` if the variants use different display conditions","examples":[false]},"statistic":{"$ref":"#\/components\/schemas\/AbTestStatistic"},"participants":{"type":"object","description":"A\/B test variants","properties":{"A":{"$ref":"#\/components\/schemas\/AbTestParticipant"},"B":{"$ref":"#\/components\/schemas\/AbTestParticipant"}}},"createdAt":{"$ref":"#\/components\/schemas\/DateTime"}}},"AbTestFinishCondition":{"title":"A\/B test finish condition","type":"object","properties":{"trigger":{"type":"integer","enum":[1,2,3],"description":"Finish trigger:\n * `1` - by date (timestamp in `value`);\n * `2` - by views;\n * `3` - by subscriptions.\n","examples":[2]},"value":{"type":"integer","description":"Threshold value for the trigger","examples":[1000]}}},"AbTestStatistic":{"title":"A\/B test statistic","type":"object","properties":{"peopleReached":{"type":"integer","description":"Number of views","examples":[1500]},"subscriptions":{"type":"integer","description":"Number of subscriptions","examples":[120]}}},"AbTestParticipant":{"title":"A\/B test variant","type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Pop-up ID of the variant","examples":["af1b0e2a-bff9-4d09-a7d9-99d61d2b43b5"]},"preview":{"type":["string","null"],"description":"Preview image URL","examples":["https:\/\/files.sendpulse.com\/preview\/af1b0e2a.png"]},"statistic":{"$ref":"#\/components\/schemas\/AbTestStatistic"},"conditions":{"type":"array","description":"Display conditions of the variant","items":{"$ref":"#\/components\/schemas\/PopupCondition"}}}},"PopupStatistic":{"title":"Pop-up statistic","type":"object","properties":{"peopleReached":{"type":"integer","description":"Number of times the pop-up was viewed","examples":[1500]},"engagements":{"type":"integer","description":"Number of visitors who interacted with the pop-up: expanded it, read its message, clicked its button or followed the link","examples":[300]},"subscriptions":{"type":"integer","description":"Number of email addresses or phone numbers entered in the \"Email Address Request\" or \"Phone Number Request\" form","examples":[120]},"formEngagements":{"type":"integer","description":"Number of leads who submitted the form","examples":[90]},"wereClosed":{"type":"integer","description":"Number of visitors who closed the pop-up (clicked the \"cross\" icon)","examples":[400]}}},"ProjectStatistic":{"title":"Project statistic","type":"object","properties":{"peopleReached":{"type":"integer","description":"Number of times pop-ups of the project were viewed","examples":[1500]},"engagements":{"type":"integer","description":"Number of visitors who interacted with pop-ups: expanded them, read their messages, clicked their buttons or followed the links","examples":[300]},"subscriptions":{"type":"integer","description":"Number of email addresses or phone numbers entered in the \"Email Address Request\" or \"Phone Number Request\" form","examples":[120]},"formEngagements":{"type":"integer","description":"Number of leads who submitted forms","examples":[90]},"wereClosed":{"type":"integer","description":"Number of visitors who closed pop-ups (clicked the \"cross\" icon)","examples":[400]},"widget":{"type":"integer","description":"Number of visitors who used widget buttons","examples":[50]}}},"NpsStatistic":{"title":"NPS variant statistic","type":"object","properties":{"button":{"$ref":"#\/components\/schemas\/NpsButton"},"date":{"type":"string","format":"date","description":"Day of the votes","examples":["2023-08-07"]},"option":{"type":"string","description":"Variant value","examples":["10"]},"total":{"type":"integer","description":"Number of votes for the variant","examples":[42]}}},"NpsButton":{"title":"NPS button","type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Button ID","examples":["1c2d3e4f-5a6b-7c8d-9e0f-1a2b3c4d5e6f"]},"caption":{"type":"string","description":"Button caption","examples":["How likely are you to recommend us?"]},"contactVariableName":{"type":["string","null"],"description":"Name of the CRM contact variable","examples":["nps_score"]},"variants":{"type":"array","description":"NPS variants","items":{"$ref":"#\/components\/schemas\/NpsVariant"}},"variantsCount":{"type":"integer","description":"Number of variants","examples":[11]},"displayType":{"type":["integer","null"],"description":"Display type of the NPS variants","examples":[1]}}},"NpsVariant":{"title":"NPS variant","type":"object","properties":{"title":{"type":"string","description":"Variant display name","examples":["10"]},"option":{"type":"string","description":"Variant value","examples":["10"]}}},"AggregatedNpsStatistic":{"title":"Aggregated NPS statistic","type":"object","properties":{"average":{"type":"integer","description":"NPS score","examples":[45]},"total":{"type":"integer","description":"Total number of votes","examples":[200]},"promoter":{"type":"integer","description":"Number of promoters","examples":[120]},"neutral":{"type":"integer","description":"Number of neutrals","examples":[50]},"critic":{"type":"integer","description":"Number of critics","examples":[30]},"promoterPercent":{"type":"integer","description":"Percentage of promoters","examples":[60]},"neutralPercent":{"type":"integer","description":"Percentage of neutrals","examples":[25]},"criticPercent":{"type":"integer","description":"Percentage of critics","examples":[15]}}},"DisplayCondition":{"title":"Display condition","type":"object","properties":{"groupId":{"type":["integer","null"],"enum":[1,2,3,4,5,6,7,null],"description":"Behavior group:\n * `1` - frequency;\n * `2` - time;\n * `3` - user behavior;\n * `4` - clicks;\n * `5` - pages and URLs;\n * `6` - UTM parameters;\n * `7` - visitor data.\n","examples":[2]},"dataType":{"type":"string","description":"Data type of the condition value","examples":["int"]},"name":{"type":"string","description":"Condition name","examples":["timeOnPage"]},"uniq":{"type":"boolean","description":"Whether the condition can be added to a pop-up only once","examples":[true]}}},"TariffLimits":{"title":"Tariff limits","type":"object","properties":{"userPlan":{"$ref":"#\/components\/schemas\/UserPlan"},"options":{"$ref":"#\/components\/schemas\/TariffOptions"}}},"UserPlan":{"title":"Tariff plan","type":"object","properties":{"planId":{"type":"integer","description":"Tariff plan ID","examples":[3]},"expiredAt":{"type":["string","null"],"description":"Expiration date of the tariff plan","examples":["2023-09-07 20:14:15"]},"daysAmount":{"type":"integer","description":"Tariff plan length in days","examples":[30]},"currentDaysAmount":{"type":"integer","description":"Number of days already used","examples":[12]},"daysLeft":{"type":"integer","description":"Number of days left","examples":[18]},"nextLimitsDrop":{"type":["string","null"],"description":"Date when the monthly limits are reset","examples":["2023-09-01 00:00:00"]}}},"TariffOptions":{"title":"Tariff options","type":"object","description":"Tariff limits available in the public API. Options that are not part of the tariff plan are omitted; if none are available, an empty array `[]` is returned.","properties":{"views":{"$ref":"#\/components\/schemas\/TariffAmountOption"},"nps":{"$ref":"#\/components\/schemas\/TariffBooleanOption"}}},"TariffAmountOption":{"title":"Tariff amount option","type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the option is available","examples":[true]},"amount":{"type":"integer","description":"Total available amount","examples":[10000]},"amountLeft":{"type":"integer","description":"Remaining amount","examples":[8500]},"currentAmount":{"type":"integer","description":"Used amount","examples":[1500]}}},"TariffBooleanOption":{"title":"Tariff boolean option","type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the option is available","examples":[true]}}},"Subscriber":{"title":"Subscriber","type":"object","properties":{"id":{"type":"integer","description":"Subscriber ID","examples":[1024]},"clientId":{"type":["string","null"],"description":"ID generated in the visitor browser","examples":["c2f1a3b4-5d6e-7f80-91a2-b3c4d5e6f708"]},"name":{"type":"string","description":"Subscriber name","examples":["John Doe"]},"avatar":{"type":["string","null"],"description":"Avatar URL","examples":["https:\/\/files.sendpulse.com\/avatar.png"]},"projectId":{"type":["string","null"],"format":"uuid","description":"Project ID","examples":["7803a6ea-4b32-44d7-a245-5cda4e4f2031"]},"popupId":{"type":["string","null"],"format":"uuid","description":"Pop-up ID","examples":["af1b0e2a-bff9-4d09-a7d9-99d61d2b43b5"]},"gender":{"type":"integer","enum":[0,1,2],"description":"Gender:\n * `0` - unknown;\n * `1` - male;\n * `2` - female.\n","examples":[0]},"email":{"type":["string","null"],"format":"email","description":"Email address","examples":["john@example.com"]},"city":{"type":["string","null"],"description":"City","examples":["Kyiv"]},"phone":{"type":["string","null"],"description":"Phone number","examples":["+380501234567"]},"location":{"$ref":"#\/components\/schemas\/SubscriberLocation"},"variables":{"type":"array","description":"Variables collected from the subscriber","items":{"$ref":"#\/components\/schemas\/SubscriberVariable"}},"lastSession":{"$ref":"#\/components\/schemas\/SubscriberSession"},"popup":{"$ref":"#\/components\/schemas\/SubscriberPopup"},"nps":{"type":"array","description":"NPS votes of the subscriber","items":{"$ref":"#\/components\/schemas\/SubscriberNps"}},"createdAt":{"$ref":"#\/components\/schemas\/DateTime"},"updatedAt":{"$ref":"#\/components\/schemas\/DateTime"}}},"SubscriberLocation":{"title":"Subscriber location","type":"object","description":"Location detected by IP address. If it is unknown, an empty array `[]` is returned.","properties":{"organization":{"type":["string","null"],"examples":["Kyivstar"]},"region":{"type":["string","null"],"examples":["Kyiv City"]},"asn":{"type":["string","null"],"examples":["AS15895"]},"ip":{"type":["string","null"],"examples":["93.184.216.34"]},"timezone":{"type":["string","null"],"examples":["Europe\/Kyiv"]},"longitude":{"type":["string","null"],"examples":["30.5234"]},"latitude":{"type":["string","null"],"examples":["50.4501"]},"postalCode":{"type":["string","null"],"examples":["01001"]},"city":{"type":["string","null"],"examples":["Kyiv"]},"continentCode":{"type":["string","null"],"examples":["EU"]},"country":{"type":["string","null"],"examples":["Ukraine"]},"regionCode":{"type":["string","null"],"examples":["30"]},"countryCode":{"type":["string","null"],"examples":["UA"]},"googleMapsUrl":{"type":["string","null"],"examples":["https:\/\/www.google.com\/maps?q=50.4501,30.5234"]}}},"SubscriberVariable":{"title":"Subscriber variable","type":"object","properties":{"name":{"type":"string","description":"Variable name","examples":["company"]},"type":{"type":"string","description":"Variable type","examples":["string"]},"value":{"type":"string","description":"Variable value","examples":["SendPulse"]}}},"SubscriberSession":{"title":"Subscriber session","type":"object","description":"Last session of the subscriber. If there is no session, an empty array `[]` is returned.","properties":{"userAgent":{"type":"string","examples":["Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7)"]},"type":{"type":["string","null"],"examples":["direct"]},"content":{"type":["string","null"],"description":"UTM content","examples":["banner"]},"term":{"type":["string","null"],"description":"UTM term","examples":["popup"]},"source":{"type":["string","null"],"description":"UTM source","examples":["google"]},"referrer":{"type":["string","null"],"examples":["https:\/\/google.com"]},"client":{"type":"object","additionalProperties":true,"description":"Client (browser and device) data. If it is unknown, an empty array `[]` is returned.","examples":[{"browser":"Chrome"}]},"isActive":{"type":"boolean","examples":[false]},"utmMedium":{"type":["string","null"],"description":"UTM medium","examples":["cpc"]},"createdAt":{"$ref":"#\/components\/schemas\/DateTime"},"updatedAt":{"$ref":"#\/components\/schemas\/DateTime"},"expiredOn":{"$ref":"#\/components\/schemas\/DateTime"}}},"SubscriberPopup":{"title":"Subscriber pop-up","type":"object","description":"Pop-up that collected the subscriber. If the pop-up is not loaded or deleted, an empty array `[]` is returned.","properties":{"id":{"type":"string","format":"uuid","description":"Pop-up ID","examples":["af1b0e2a-bff9-4d09-a7d9-99d61d2b43b5"]},"name":{"type":"string","description":"Pop-up name","examples":["Newsletter pop-up"]}}},"SubscriberNps":{"title":"Subscriber NPS vote","type":"object","properties":{"popupActionButtonId":{"type":"string","format":"uuid","description":"NPS button ID","examples":["1c2d3e4f-5a6b-7c8d-9e0f-1a2b3c4d5e6f"]},"value":{"type":"string","description":"Selected value","examples":["9"]},"comment":{"type":"string","description":"Comment of the subscriber","examples":["Great service"]},"label":{"type":"string","description":"Label of the selected variant","examples":["9"]}}}}}}