{"openapi":"3.1.2","info":{"title":"Facebook Messenger service API","description":"Using the API for Facebook Messenger chatbots, you can integrate your system with SendPulse\u2019s chatbots service and get detailed information about your account, bots, subscribers, variables, flows, and chats. You can also create campaigns, launch flows, assign and remove variables and tags.\n\n\nOn the right, there is a button for authorizing requests made on this page. Click \u201cAuthorize,\u201d then insert the ID and Secret from your account.\n\n\nTo perform a request directly from the page, click the \"Try it out\" button within each method block. Then fill in input fields if any (for URL parameters, the description is right below the URL request; for body parameters, the description is under the \u201cScheme\u201d button to the right of the example), and click \u201cRun.\u201d You'll find the server response and description of received parameters below.\n        ","version":"1.0.0"},"servers":[{"url":"https:\/\/api.sendpulse.com\/messenger","description":"SendPulse production API server"}],"security":[{"apiKey":[]}],"tags":[{"name":"account","description":"Account information: pricing plan limits and usage statistics"},{"name":"bots","description":"Connected Facebook Messenger bots (pages) and their statistics"},{"name":"contacts","description":"Bot contacts (subscribers): search contacts, send messages, manage tags, variables, notes, operators, and chat state"},{"name":"variables","description":"Bot variables"},{"name":"flows","description":"Bot flows and running them for a contact"},{"name":"triggers","description":"Triggers (keywords and events) that start flows"},{"name":"chats","description":"Chats with contacts and their message history"},{"name":"campaigns","description":"Campaigns (broadcasts) sent to bot contacts"},{"name":"tags","description":"Contact tags of a bot"},{"name":"templates","description":"Messenger utility message templates of a bot"}],"paths":{"\/contacts\/get":{"get":{"operationId":"getContact","summary":"Get contact info via a contact ID","description":"Returns information on the selected contact: bot and contact ID, information from messenger, list of tags and variables, activity data and date added","tags":["contacts"],"parameters":[{"in":"query","name":"id","required":true,"description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ContactResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/getByTag":{"get":{"operationId":"getContactsByTag","summary":"Get a list of contacts by tag","description":"Returns a list of contacts by tag for the specified bot","tags":["contacts"],"parameters":[{"in":"query","name":"tag","required":true,"description":"Created contact\u2019s tag to search by","schema":{"type":"string","minLength":1,"maxLength":32},"example":"vip"},{"in":"query","name":"bot_id","required":true,"description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ContactPageResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/getByVariable":{"get":{"operationId":"getContactsByVariable","summary":"Get contacts by variable","description":"Returns contacts by variable identifier or variable name for the specified bot","tags":["contacts"],"parameters":[{"in":"query","name":"variable_id","required":false,"description":"Contact\u2019s variable ID to search by; required parameter if you do not pass variable_name and bot_id.","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f7"},{"in":"query","name":"variable_name","required":false,"description":"Contact\u2019s variable name to search by; required parameter and passed with the bot_id parameter, if you do not pass variable_id.","schema":{"type":"string","minLength":1,"maxLength":255},"example":"city"},{"in":"query","name":"bot_id","required":false,"description":"Bot ID; required parameter and passed with the variable_name parameter, if you do not pass variable_id. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},{"in":"query","name":"variable_value","required":true,"description":"Contact's variable value","schema":{"type":"string"},"example":"Kyiv"},{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ContactPageResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/sendText":{"post":{"operationId":"sendTextMessage","summary":"Sends a text message to the specified contact","description":"Sends a text message to the specified contact.","tags":["contacts"],"requestBody":{"description":"","required":true,"content":{"application\/json":{"schema":{"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"message_type":{"type":"string","enum":["MESSAGE_TAG","RESPONSE"],"description":"Messaging type: `RESPONSE` - a reply within the 24-hour window, `MESSAGE_TAG` - a message outside the window sent with `message_tag`","examples":["RESPONSE"]},"message_tag":{"type":"string","enum":["HUMAN_AGENT"],"description":"Message tag. Campaigns accept `TEST`, `PROMOTIONAL`, `HUMAN_AGENT`, `CUSTOMER_FEEDBACK`; `sendText` accepts `HUMAN_AGENT`, `CUSTOMER_FEEDBACK`, `CONFIRMED_EVENT_UPDATE`, `POST_PURCHASE_UPDATE`, `ACCOUNT_UPDATE`","examples":["HUMAN_AGENT"]},"text":{"type":"string","description":"Message text to send. May include emoji.","examples":["Hello!"]},"reply_to":{"type":"object","description":"Reply to a specific message","properties":{"message_id":{"type":"string","description":"Facebook message ID to reply to (starts with \"m_\" or \"mid.\")","examples":["m_BRYnOElaa3yNnq_A0eLzBBUmN0hZanuMna6_0OHyAxQlNkdYaXqLnK2-z-DxAhMkNUZXaHmKm6y9zt_wARIjNA"]}},"required":["message_id"]}},"required":["contact_id","message_type","text"]}}}},"responses":{"200":{"description":"The sent message. If Messenger rejects the message, the endpoint responds with the HTTP status returned by Facebook, `data: false`, and the reason in `message`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MessageResponse"}}}},"400":{"$ref":"#\/components\/responses\/MeSendFailed"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/send":{"post":{"operationId":"sendMessage","summary":"Send a message to a contact","description":"Sends a text message, image, or a file to the contact with the specified contact ID.  To view an example of the request body, select a message type from the drop-down list","tags":["contacts"],"requestBody":{"description":"","required":true,"content":{"application\/json":{"schema":{"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"message":{"properties":{"type":{"type":"string","enum":["RESPONSE","UPDATE","MESSAGE_TAG"],"description":"Messaging type: `RESPONSE` - a reply within the 24-hour window, `UPDATE` - a proactive message within the window, `MESSAGE_TAG` - a message outside the window sent with `tag`","examples":["RESPONSE"]},"tag":{"type":"string","enum":["HUMAN_AGENT"],"description":"Message tag for `MESSAGE_TAG` messages; only `HUMAN_AGENT` is supported","examples":["HUMAN_AGENT"]},"content_type":{"type":"string","enum":["message","media_img","media_file","template"],"description":"Type of data sent","examples":["message"]},"text":{"type":"string","description":"The parameter is required if the `content_type` parameter is equal to `message`","examples":["Hello world!"]},"img":{"type":"string","description":"The parameter is required if the `content_type` parameter is equal to `media_img`","examples":["https:\/\/www.spcdn.org\/images\/promo-logo\/correct\/sendpulse-logo-13.png"]},"file":{"type":"string","description":"The parameter is required if the `content_type` parameter is equal to `media_file`","examples":["https:\/\/www.spcdn.org\/images\/promo-logo\/correct\/sendpulse-logo-13.png"]},"reply_to":{"type":"object","description":"Reply to a specific message","properties":{"message_id":{"type":"string","description":"Facebook message ID to reply to (starts with \"m_\" or \"mid.\")","examples":["m_BRYnOElaa3yNnq_A0eLzBBUmN0hZanuMna6_0OHyAxQlNkdYaXqLnK2-z-DxAhMkNUZXaHmKm6y9zt_wARIjNA"]}},"required":["message_id"]},"data":{"type":"object","description":"The parameter is required if the `content_type` parameter is equal to `template`","properties":{"attachment":{"$ref":"#\/components\/schemas\/MeMessageAttachment"}}}},"type":"object","required":["type","content_type"]}},"required":["contact_id","message"]},"examples":{"Send a text message":{"value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","message":{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"message","text":"Hello world!"}}},"Send a text message with reply_to":{"value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","message":{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"message","text":"Hello world!","reply_to":{"message_id":"m_BRYnOElaa3yNnq_A0eLzBBUmN0hZanuMna6_0OHyAxQlNkdYaXqLnK2-z-DxAhMkNUZXaHmKm6y9zt_wARIjNA"}}}},"Send a message with a file":{"value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","message":{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"media_file","file":"https:\/\/www.spcdn.org\/images\/promo-logo\/correct\/sendpulse-logo-13.png"}}},"Send a message with an image":{"value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","message":{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"media_img","img":"https:\/\/www.spcdn.org\/images\/promo-logo\/correct\/sendpulse-logo-13.png"}}},"Send a message with a carousel":{"value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","message":{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"template","data":{"attachment":{"type":"template","payload":{"template_type":"generic","elements":[{"title":"Example title","subtitle":"Example subtitle","image_url":"https:\/\/example.com\/image.png","buttons":[{"type":"web_url","title":"Example button","url":"https:\/\/example.com\/"}]}]}}}}}},"Send a message with url button":{"value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","message":{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"template","data":{"attachment":{"type":"template","payload":{"template_type":"generic","elements":[{"title":"Example title","buttons":[{"type":"web_url","title":"Example button","url":"https:\/\/example.com\/"}]}]}}}}}},"Send a message with payload button":{"value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","message":{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"template","data":{"attachment":{"type":"template","payload":{"template_type":"generic","elements":[{"title":"Example title","buttons":[{"type":"postback","title":"Example button","data":{"chain":"3c9e1d2f-4b5a-4c6d-8e7f-9a0b1c2d3e4f"}}]}]}}}}}}}}}},"responses":{"200":{"description":"The sent message. If Messenger rejects the message, the endpoint responds with the HTTP status returned by Facebook, `data: false`, and the reason in `message`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MessageResponse"}}}},"400":{"$ref":"#\/components\/responses\/MeSendFailed"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/sendTyping":{"post":{"operationId":"sendTyping","summary":"Show the typing indicator","description":"Shows the typing indicator to the contact","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","format":"uuid","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]}}}}}},"responses":{"200":{"description":"`data` is `true`; `message` is \"Typing indicator on successfully.\"","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/react":{"post":{"operationId":"reactToMessage","summary":"React to a message","description":"Sets or removes a reaction on a contact's message. To remove a previously set reaction, pass `\"reaction\": null` or omit the `reaction` field.","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","message_id"],"properties":{"contact_id":{"type":"string","format":"uuid","description":"The ID of the contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"message_id":{"type":"string","format":"uuid","description":"ID of the message to react to (the `id` field of a message returned by the API)","examples":["9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b"]},"reaction":{"type":["object","null"],"description":"Object with reaction details. Pass `null` or omit it to remove a previously set reaction.","required":["emoji"],"properties":{"emoji":{"type":"string","enum":["\ud83d\ude0a","\ud83d\ude20","\ud83d\ude22","\ud83d\ude2e","\u2764\ufe0f","\ud83d\udc4d","\ud83d\udc4e","\ud83d\ude06"],"description":"The emoji to react with","examples":["\ud83d\udc4d"]}}}}},"example":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","message_id":"9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b","reaction":{"emoji":"\ud83d\udc4d"}}}}},"responses":{"200":{"description":"`data` is `true` when the reaction was set or removed","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"description":"Facebook rejected the request; `error_code` is the Facebook API error code","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/setVariable":{"post":{"operationId":"setContactVariable","summary":"Assign a variable to contact","description":"Adds or updates the value of a variable for the selected contact.","tags":["contacts"],"requestBody":{"description":"Choose one of the available request bodies","required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"variables":{"type":"array","description":"List of variables to set; use instead of the single `variable_id`\/`variable_name` and `variable_value` fields","items":{"$ref":"#\/components\/schemas\/ContactVariableInput"}}}},"examples":{"by_var_name":{"summary":"Set by variable name","value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","variables":[{"variable_name":"city","variable_value":"Kyiv"},{"variable_name":"age","variable_value":30}]}},"by_var_id":{"summary":"Set by variable ID","value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","variables":[{"variable_id":"60c9d4b8e0f3b2a1c4d5e6fa","variable_value":"Kyiv"}]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/deleteVariable":{"post":{"operationId":"deleteContactVariable","summary":"Delete a variable from the selected contact","description":"Delete the value of a variable for the selected contact.","tags":["contacts"],"requestBody":{"description":"Choose one of the available request bodies","required":true,"content":{"application\/json":{"schema":{"type":"object","description":"Pass exactly one of `variable_ids` or `variable_names`","required":["contact_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"variable_ids":{"type":"array","maxItems":100,"description":"Variable IDs to delete","items":{"type":"string"},"examples":[["60c9d4b8e0f3b2a1c4d5e6fa","60c9d4b8e0f3b2a1c4d5e6fb"]]},"variable_names":{"type":"array","maxItems":100,"description":"Variable names to delete","items":{"type":"string","maxLength":255},"examples":[["city","age"]]}}},"examples":{"by_var_id":{"summary":"Delete by variable ID","value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","variable_ids":["60c9d4b8e0f3b2a1c4d5e6fa","60c9d4b8e0f3b2a1c4d5e6fb"]}},"by_var_name":{"summary":"Delete by variable name","value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","variable_names":["city","age"]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/setTag":{"post":{"operationId":"setContactTags","summary":"Assign a tag to contact","description":"Assigns tags to the selected contact","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","tags"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"tags":{"type":"array","minItems":1,"maxItems":100,"description":"List of tags to assign to the contact","items":{"type":"string","minLength":1,"maxLength":32},"examples":[["vip","newsletter"]]}}}}}},"responses":{"200":{"description":"`data` is the number of tags newly added to the contact","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/IntegerResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/deleteTag":{"post":{"operationId":"deleteContactTag","summary":"Remove a tag from a contact","description":"Removes the tag for the selected contact.","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","tag"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"tag":{"type":"string","minLength":1,"maxLength":32,"description":"Tag you want to remove","examples":["vip"]}}}}}},"responses":{"200":{"description":"`data` is the number of tags removed from the contact (`0` or `1`)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/IntegerResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/disable":{"post":{"operationId":"disableContact","summary":"Disable contact","description":"Disables a contact in your audience list. Campaigns and autoflows will not be sent to this contact","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/enable":{"post":{"operationId":"enableContact","summary":"Enable contact","description":"Enables a contact in the audience list, and the contact starts receiving campaigns and autoflows","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/delete":{"post":{"operationId":"deleteContact","summary":"Delete contact","description":"Removes a contact from the audience and subscribers list. The contact can be added back only by subscribing to the bot.","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/getPauseAutomation":{"get":{"operationId":"getContactPauseAutomation","summary":"Get remaining time for automation pause","description":"Returns the time remaining until autoflows resume for this contact","tags":["contacts"],"parameters":[{"in":"query","name":"contact_id","required":true,"description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"}],"responses":{"200":{"description":"`data` is the date and time until which automation is paused, or `null` when it is not paused","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/NullableDateTimeResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/setPauseAutomation":{"post":{"operationId":"setContactPauseAutomation","summary":"Pause autoflows for a contact","description":"Pauses autoflows for the specified contact","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"minutes":{"type":"integer","minimum":1,"maximum":120,"description":"Minutes","examples":[60]}}}}}},"responses":{"200":{"description":"`data` is the date and time until which automation is paused","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DateTimeResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/deletePauseAutomation":{"post":{"operationId":"deleteContactPauseAutomation","summary":"Resume autoflows for a contact","description":"Resumes autoflows for the specified contact","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/notes":{"get":{"operationId":"getContactNotes","summary":"Get a list of contact's operator notes","description":"Returns a list of existing operator notes by contact","tags":["contacts"],"parameters":[{"in":"query","name":"bot_id","required":true,"description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},{"in":"query","name":"contact_id","required":true,"description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"}],"responses":{"200":{"description":"Operator notes of the contact, newest first (up to 500)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorNoteListResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/createNote":{"post":{"operationId":"createContactNote","summary":"Send an operator note","description":"Sends an operator note about a contact","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","bot_id","text"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"bot_id":{"type":"string","description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"text":{"type":"string","minLength":1,"maxLength":2000,"description":"Text of note","examples":["Customer asked to call back tomorrow"]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorNoteResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/updateNote":{"post":{"operationId":"updateContactNote","summary":"Update operator note","description":"Updates an existing operator note about a contact","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","bot_id","text","note_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"bot_id":{"type":"string","description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"text":{"type":"string","minLength":1,"maxLength":2000,"description":"Text of note","examples":["Customer asked to call back on Monday"]},"note_id":{"type":"string","description":"Note ID.","examples":["60c9d4b8e0f3b2a1c4d5e6fc"]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorNoteResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/deleteNote":{"post":{"operationId":"deleteContactNote","summary":"Delete operator note","description":"Deletes an existing operator note about a contact","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","bot_id","note_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"bot_id":{"type":"string","description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"note_id":{"type":"string","description":"Note ID.","examples":["60c9d4b8e0f3b2a1c4d5e6fc"]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorNoteResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/operators\/assign":{"post":{"operationId":"assignContactOperator","summary":"Assign a responsible operator to the chat.","description":"Sets the specified operator as responsible for the chat. You can find the operator's ID in the https:\/\/login.sendpulse.com\/settings\/#users section.","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","operator_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"operator_id":{"type":"integer","minimum":1,"description":"The ID of the operator to assign","examples":[1234567]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/operators\/unAssign":{"post":{"operationId":"unassignContactOperator","summary":"Unassign responsible operators for the chat.","description":"Removes any assigned operator for the chat.","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/operators\/assignGroup":{"post":{"operationId":"assignContactOperatorGroup","summary":"Assign an operator group to the chat.","description":"Assigns the specified operator group as responsible for the chat. The system will automatically distribute the chat to an available operator within the group.","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","group_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"group_id":{"type":"string","description":"The ID of the operator group to assign.","examples":["60c9d4b8e0f3b2a1c4d5e6fd"]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/openChat":{"post":{"operationId":"openContactChat","summary":"Open chat for a contact","description":"Increase the chat priority by marking it as open","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]}}}}}},"responses":{"200":{"description":"Chat opened successfully","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/closeChat":{"post":{"operationId":"closeContactChat","summary":"Close chat for a contact","description":"Close the chat and lower the priority.","tags":["contacts"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]}}}}}},"responses":{"200":{"description":"Chat closed successfully","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/mark-read":{"put":{"operationId":"markContactMessagesRead","summary":"Mark messages as read","description":"Mark all of the contact's messages as read (set unread count to 0)","tags":["contacts"],"parameters":[{"in":"query","name":"contact_id","required":true,"description":"Contact ID. Used to set its unread message count to 0.","schema":{"type":"string"},"example":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MessageCountResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/contacts\/mark-unread":{"put":{"operationId":"markContactMessagesUnread","summary":"Mark a chat with the contact as unread","description":"Marks the last message of a specific contact as unread.","tags":["contacts"],"parameters":[{"in":"query","name":"contact_id","required":true,"description":"The ID of the contact whose last message will be marked as unread.","schema":{"type":"string"},"example":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"}],"responses":{"200":{"description":"The number of messages successfully marked as unread.","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MessageCountResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/flows":{"get":{"operationId":"getFlows","summary":"Get a list of flows","description":"Returns a list of created flows for the selected bot and information for each: flow id, bot id, status, name, id and name of the trigger that launches it, and creation date","tags":["flows"],"parameters":[{"in":"query","name":"bot_id","required":true,"description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/FlowListResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/flows\/run":{"post":{"operationId":"runFlow","summary":"Run a flow by its ID","description":"Launches the selected flow for the selected contact. Additional data can be passed to the \"external_data\" field and used once in the selected flow, where variables will be inserted in the \"Message\" element as a JSON path, for example {{$['tracking_number']}}.","tags":["flows"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","flow_id"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"flow_id":{"type":"string","description":"Flow ID to be launched. Can be obtained with the method of obtaining the list of flows","examples":["3c9e1d2f-4b5a-4c6d-8e7f-9a0b1c2d3e4f"]},"external_data":{"$ref":"#\/components\/schemas\/ExternalData"},"start_block_id":{"type":["string","null"],"format":"uuid","description":"Block ID to start the flow from. If not specified, the flow starts from the first block.","examples":["3f2504e0-4f89-11d3-9a0c-0305e82c3301"]}}},"examples":{"run_flow":{"summary":"Run a flow","value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","flow_id":"3c9e1d2f-4b5a-4c6d-8e7f-9a0b1c2d3e4f","external_data":{"tracking_number":"1234-0987-5678-9012"}}},"run_flow_from_block":{"summary":"Start a flow from the specified flow element","value":{"contact_id":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c","flow_id":"3c9e1d2f-4b5a-4c6d-8e7f-9a0b1c2d3e4f","external_data":{"tracking_number":"1234-0987-5678-9012"},"start_block_id":"3f2504e0-4f89-11d3-9a0c-0305e82c3301"}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/flows\/runByTrigger":{"post":{"operationId":"runFlowByTrigger","summary":"Run a flow by trigger keywords","description":"Launches a flow with the trigger keyword for the selected contact","tags":["flows"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","trigger_keyword"],"properties":{"contact_id":{"type":"string","description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"trigger_keyword":{"type":"string","minLength":1,"maxLength":128,"description":"Keyword (command) that launches the flow","examples":["start"]},"external_data":{"$ref":"#\/components\/schemas\/ExternalData"}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/triggers":{"get":{"operationId":"getTriggers","summary":"Get a list of triggers","description":"Returns the list of created triggers for the selected bot with information about each of them: trigger ID, bot id, id of the flow that starts on it, name, type, set launch time and creation date","tags":["triggers"],"parameters":[{"in":"query","name":"bot_id","required":true,"description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TriggerListResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/bots":{"get":{"operationId":"getBots","summary":"Get a list of connected bots","description":"Returns lists of bots with information about each: bot ID, channel information, number of received and unread messages, bot status, and creation date","tags":["bots"],"parameters":[{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BotListResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/bots\/statistics":{"get":{"operationId":"getBotStatistics","summary":"Get general statistics info by bot","description":"Returns general statistics info by bot","tags":["bots"],"parameters":[{"in":"query","name":"bot_id","required":true,"description":"The bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BotStatisticsResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/chats":{"get":{"operationId":"getChats","summary":"Get a list of chats","description":"Returns a list of chats with subscribers with information about the contact and the last message received from the contact","tags":["chats"],"parameters":[{"in":"query","name":"bot_id","required":false,"description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ChatPageResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/chats\/messages":{"get":{"operationId":"getChatMessages","summary":"Get a list of messages","description":"Returns a list of all messages in correspondence with the specified subscriber","tags":["chats"],"parameters":[{"in":"query","name":"contact_id","required":true,"description":"Contact ID. Can be obtained with a contact search by tag or variable. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"},{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"},{"$ref":"#\/components\/parameters\/order"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/MessagePageResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/variables":{"get":{"operationId":"getVariables","summary":"Get a list of variables","description":"Returns a list of variables for the selected bot with information about each: variable ID, bot ID, name, affiliation, type, status, and creation date","tags":["variables"],"parameters":[{"in":"query","name":"bot_id","required":true,"description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/VariableListResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/campaigns\/recipients":{"get":{"operationId":"getCampaignRecipients","summary":"Get campaign recipients","description":"Get a list of campaign recipients with delivery statistics","tags":["campaigns"],"parameters":[{"in":"query","name":"id","required":true,"description":"Campaign ID","schema":{"type":"string"},"example":"7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a"},{"$ref":"#\/components\/parameters\/order"},{"$ref":"#\/components\/parameters\/search_after"},{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"}],"responses":{"200":{"description":"Campaign recipients list","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CampaignRecipientsResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/campaigns\/report":{"get":{"operationId":"getCampaignReport","summary":"Get campaign report","description":"Get campaign data with sending statistics","tags":["campaigns"],"parameters":[{"in":"query","name":"id","required":true,"description":"Campaign ID","schema":{"type":"string"},"example":"7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a"}],"responses":{"200":{"description":"Campaign report","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CampaignReportResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/campaigns\/send":{"post":{"operationId":"sendCampaign","summary":"Send campaign","description":"Sends a campaign to all of a bot's subscribers. You can send a campaign with text, an image, or a file. To view an example of the request body, select a message type from the drop-down list","tags":["campaigns"],"requestBody":{"description":"","required":true,"content":{"application\/json":{"schema":{"properties":{"title":{"type":"string","description":"Campaign title","examples":["Black Friday sale"]},"bot_id":{"type":"string","description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"message_tag":{"type":"string","enum":["HUMAN_AGENT"],"description":"Message tag. Campaigns accept `TEST`, `PROMOTIONAL`, `HUMAN_AGENT`, `CUSTOMER_FEEDBACK`; `sendText` accepts `HUMAN_AGENT`, `CUSTOMER_FEEDBACK`, `CONFIRMED_EVENT_UPDATE`, `POST_PURCHASE_UPDATE`, `ACCOUNT_UPDATE`","examples":["HUMAN_AGENT"]},"message_notification_type":{"$ref":"#\/components\/schemas\/MeMessageNotificationType"},"send_at":{"type":"string","description":"Specify the date and time in your account timezone (or GMT\/UTC+0 if no timezone is set in the account) in the format Y-m-d H:i if you need to schedule the campaign, if you do not specify this parameter, the campaign will be sent immediately","examples":["2030-12-12 10:00"]},"filter":{"$ref":"#\/components\/schemas\/CampaignFilter"},"messages":{"$ref":"#\/components\/schemas\/MeCampaignMessages"}},"required":["title","bot_id","messages"]},"examples":{"Send a text message":{"value":{"title":"Black Friday","bot_id":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","message_tag":"HUMAN_AGENT","message_notification_type":"REGULAR","send_at":"Y-m-d H:i","messages":[{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"message","data":{"text":"Hello world!"}}]}},"Send a message with an image":{"value":{"title":"Black Friday","bot_id":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","message_tag":"HUMAN_AGENT","message_notification_type":"REGULAR","send_at":"Y-m-d H:i","messages":[{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"media_img","data":{"attachment":{"type":"template","payload":{"template_type":"generic","elements":[{"title":"Example title","subtitle":"Example subtitle","image_url":"https:\/\/www.spcdn.org\/images\/promo-logo\/correct\/sendpulse-logo-13.png"}]}}}}]}},"Send a message with a carousel":{"value":{"title":"Black Friday","bot_id":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","message_tag":"HUMAN_AGENT","message_notification_type":"REGULAR","send_at":"Y-m-d H:i","messages":[{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"template","data":{"attachment":{"type":"template","payload":{"template_type":"generic","elements":[{"title":"Example title","subtitle":"Example subtitle","image_url":"https:\/\/example.com\/image.png","buttons":[{"type":"web_url","title":"Example button","url":"https:\/\/example.com\/"}]}]}}}}]}},"Send a message with a filter":{"value":{"title":"Campaign with filter","bot_id":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","message_tag":"HUMAN_AGENT","message_notification_type":"REGULAR","send_at":"Y-m-d H:i","messages":[{"type":"RESPONSE","tag":"HUMAN_AGENT","content_type":"message","data":{"text":"Hello world!"}}],"filter":{"type":"and","expressions":[{"type":"and","expressions":[{"operator":"eq","field":"tags","value":"SOME_TAG_HERE"}]}]}}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CampaignResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/account":{"get":{"operationId":"getAccount","summary":"Get account info","description":"Returns information about your current account pricing plan, the number of messages in your plan, bots, contacts, list of tags, and variables","tags":["account"],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AccountResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"}}}},"\/templates":{"get":{"operationId":"getTemplates","summary":"Get a template list","description":"Returns a list of templates with information about each template","tags":["templates"],"parameters":[{"in":"query","name":"bot_id","example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","required":true,"schema":{"type":"string"},"description":"The bot ID where the templates are located. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact."},{"in":"query","name":"name","example":"order_update","required":false,"schema":{"type":"string","maxLength":512},"description":"Filter templates by name (partial, case-insensitive match)."},{"in":"query","name":"locale","example":"en_US","required":false,"schema":{"type":"string","enum":["af","sq","ar","az","bn","bg","ca","zh_CN","zh_HK","zh_TW","hr","cs","da","nl","en","en_GB","en_US","et","fil","fi","fr","de","el","gu","ha","he","hi","hu","id","ga","it","ja","kn","kk","ko","lo","lv","lt","mk","ms","ml","mr","nb","fa","pl","pt_BR","pt_PT","pa","ro","ru","sr","sk","sl","es","es_AR","es_ES","es_MX","sw","sv","ta","te","th","tr","uk","ur","uz","vi","zu"],"examples":["en"]},"description":"Filter templates by language code (locale)."},{"in":"query","name":"status","example":"APPROVED","required":false,"schema":{"type":"string","enum":["APPROVED","IN_APPEAL","PENDING","REJECTED","PENDING_DELETION","DELETED","DISABLED","PAUSED","LIMIT_EXCEEDED","ARCHIVED"],"examples":["APPROVED"]},"description":"Filter templates by their status."}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TemplateListResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}},"post":{"operationId":"createTemplate","summary":"Create a template","description":"Creates a new message template for the specified bot and submits it for approval.","tags":["templates"],"requestBody":{"description":"","required":true,"content":{"application\/json":{"schema":{"properties":{"bot_id":{"type":"string","description":"The bot ID for which the template is created.","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"category":{"type":"string","enum":["UTILITY"],"default":"UTILITY","description":"The template category.","examples":["UTILITY"]},"name":{"type":"string","description":"The template name.","examples":["order_update"]},"language":{"type":"string","description":"The template language code.","examples":["en"]},"components":{"type":"array","description":"The template components (header, body, footer, buttons).","items":{"type":"object","additionalProperties":true}}},"required":["bot_id","name","language","components"]},"example":{"bot_id":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","category":"UTILITY","name":"order_update","language":"en","components":[{"type":"BODY","text":"Your order {{1}} has been confirmed. Delivery date: {{2}}.","example":{"body_text":[["ORD-12345","April 25, 2026"]]}}]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TemplateResponse"}}}},"400":{"$ref":"#\/components\/responses\/MeSendFailed"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/templates\/{id}":{"delete":{"operationId":"deleteTemplate","summary":"Delete a template","description":"Deletes the message template with the specified ID.","tags":["templates"],"parameters":[{"in":"path","name":"id","required":true,"description":"Template ID (the `id` field of a template returned by the API)","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f5"},{"in":"query","name":"bot_id","required":true,"description":"The bot ID where the templates are located. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string","format":"uuid"},"example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"}],"responses":{"200":{"description":"`data` is `true` when the template was deleted","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/MeSendFailed"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"$ref":"#\/components\/responses\/NotFound"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/tags":{"get":{"operationId":"getTags","summary":"Get a list of tags","description":"Returns the list of created tags for the selected bot with information about each of them: tag ID, name, contact_count and creation date","tags":["tags"],"parameters":[{"in":"query","name":"bot_id","required":true,"description":"Bot ID. Can be obtained with a method of getting a list of bots. You can also find it in your account in the address bar of a chat window with the desired contact.","schema":{"type":"string"},"example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/TagListResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key in the format `sp_apikey_***` from https:\/\/login.sendpulse.com\/settings\/api; enter the key only, it is sent as `Authorization: Bearer sp_apikey_***`"}},"parameters":{"size":{"in":"query","name":"size","required":false,"description":"The limit of pagination items that will be returned","schema":{"type":"integer","minimum":1,"maximum":1000},"example":20},"skip":{"in":"query","name":"skip","required":false,"description":"The offset of pagination items, indicating where the current batch starts","schema":{"type":"integer","minimum":0},"example":0},"search_after":{"in":"query","name":"search_after","required":false,"description":"The ID of the element after which elements will be returned","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f9"},"order":{"in":"query","name":"order","required":false,"description":"Sort order ASC or DESC","schema":{"type":"string","enum":["asc","desc"]},"example":"desc"}},"responses":{"BadRequest":{"description":"Request rejected: the bot or contact does not exist or is inactive, the request body is not valid JSON, or the action is not available on the current pricing plan (`error_code` `3004` - pricing plan inactive, `3005` - available only on a paid plan)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"MeSendFailed":{"description":"Facebook rejected the request; `message` contains the reason. Note: such responses contain `success: true` and `data: false`","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"Unauthorized":{"description":"The access token or API key is missing, invalid, or expired","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"Forbidden":{"description":"Access denied: the token is not valid for this resource, the user has no permission for the action, or the pricing plan limit is exceeded (`error_code` `3002`)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"NotFound":{"description":"The requested resource (for example, the operator or operator group) was not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"UnprocessableEntity":{"description":"Request validation failed; `errors` maps every invalid field to its error messages","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}},"schemas":{"Error":{"type":"object","description":"Error response","properties":{"success":{"type":"boolean","examples":[false]},"data":{"type":["object","null"],"description":"Additional error data; usually `null`. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":true,"examples":[null]},"message":{"type":"string","examples":["Operator not found."]},"errors":{"$ref":"#\/components\/schemas\/FieldErrors"},"error_code":{"type":"integer","description":"Application error code; usually equals the HTTP status, see the response description for other values","examples":[400]}}},"ValidationError":{"type":"object","description":"Validation error response","required":["message","errors"],"properties":{"message":{"type":"string","examples":["The given data was invalid."]},"errors":{"$ref":"#\/components\/schemas\/FieldErrors"},"success":{"type":"boolean","examples":[false]},"data":{"type":"null","examples":[null]},"error_code":{"type":"integer","description":"Application error code; usually equals the HTTP status, see the response description for other values","examples":[400]}}},"FieldErrors":{"type":"object","description":"Error messages grouped by field; the `*` key holds errors that are not bound to a field. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":{"type":"array","items":{"type":"string"}},"examples":[{"contact_id":["Contact does not exist."]}]},"PaginationLinks":{"type":"object","properties":{"next":{"type":"string","format":"uri","description":"URL of the next page","examples":["https:\/\/api.sendpulse.com\/telegram\/chats?page=2"]}}},"PaginationMeta":{"type":"object","required":["total","limit"],"properties":{"total":{"type":"integer","description":"Total number of items","examples":[125]},"limit":{"type":"integer","description":"Page size","examples":[20]}}},"BooleanResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"boolean","examples":[true]}}},"IntegerResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"integer","examples":[1]}}},"DateTimeResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"NullableDateTimeResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":["string","null"],"format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"AccountResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/Account"}}},"BotListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Bot"}}}},"BotStatisticsResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/BotStatistics"}}},"CampaignRecipientsResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/CampaignRecipientsPage"}}},"CampaignReportResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/CampaignReport"}}},"CampaignResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/Campaign"}}},"ChatPageResponse":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Chat"}},"links":{"$ref":"#\/components\/schemas\/PaginationLinks"},"meta":{"$ref":"#\/components\/schemas\/PaginationMeta"}}},"ContactPageResponse":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Contact"}},"links":{"$ref":"#\/components\/schemas\/PaginationLinks"},"meta":{"$ref":"#\/components\/schemas\/PaginationMeta"}}},"ContactResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/Contact"}}},"FlowListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Flow"}}}},"MessageCountResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/MessageCount"}}},"MessagePageResponse":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Message"}},"links":{"$ref":"#\/components\/schemas\/PaginationLinks"},"meta":{"$ref":"#\/components\/schemas\/PaginationMeta"}}},"OperatorNoteListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/OperatorNoteList"}}},"OperatorNoteResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/OperatorNote"}}},"TagListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Tag"}}}},"TriggerListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Trigger"}}}},"VariableListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Variable"}}}},"Template":{"type":"object","properties":{"id":{"type":"string","examples":["60c9d4b8e0f3b2a1c4d5e6f5"]},"name":{"type":"string","examples":["order_update"]},"language":{"type":"string","examples":["en_US"]},"category":{"type":"string","enum":["UTILITY"],"examples":["UTILITY"]},"status":{"type":"string","enum":["APPROVED","IN_APPEAL","PENDING","REJECTED","PENDING_DELETION","DELETED","DISABLED","PAUSED","LIMIT_EXCEEDED","ARCHIVED"],"examples":["APPROVED"]},"components":{"type":"array","description":"Template components (header, body, footer, buttons)","items":{"description":"Arbitrary key-value data. When empty, it is returned as an empty array `[]` instead of an object `{}`","type":"object","additionalProperties":true}},"rejected_reason":{"type":["string","null"],"examples":[null]},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"TemplateResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/Template"}}},"TemplateListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Template"}}}},"MessageResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/Message"}}},"VariableValue":{"description":"The value that is set for the variable","type":["string","number","boolean"],"examples":["Kyiv"]},"ContactVariableInput":{"type":"object","description":"Variable to set: pass either `variable_id` or `variable_name`","required":["variable_value"],"properties":{"variable_id":{"type":"string","description":"The ID of the created variable can be obtained via other methods","examples":["60c9d4b8e0f3b2a1c4d5e6f7"]},"variable_name":{"type":"string","minLength":1,"maxLength":255,"description":"Name of the variable","examples":["city"]},"variable_value":{"$ref":"#\/components\/schemas\/VariableValue"}}},"ExternalData":{"type":"object","description":"Custom variables. You can pass variable values in the request and use them once in the flow you selected. To add variables to the flow, in the Message element, insert the variable names as a JSON path expression {{$['somekey']['nestedkey']}}.","additionalProperties":true,"maxProperties":100,"examples":[{"tracking_number":"1234-0987-5678-9012"}]},"Account":{"type":"object","properties":{"tariff":{"$ref":"#\/components\/schemas\/AccountTariff"},"statistics":{"$ref":"#\/components\/schemas\/AccountStatistics"}}},"AccountTariff":{"type":"object","description":"Pricing plan options; `-1` means unlimited","properties":{"code":{"type":"string","examples":["chatbots_pro"]},"branding":{"type":"boolean","examples":[false]},"max_bots":{"type":"integer","examples":[10]},"max_contacts":{"type":"integer","examples":[-1]},"max_messages":{"type":"integer","examples":[-1]},"max_tags":{"type":"integer","examples":[100]},"max_variables":{"type":"integer","examples":[100]},"max_rss":{"type":"integer","examples":[10]},"max_ai_tokens":{"type":"integer","examples":[-1]},"max_crm_operators":{"type":"integer","examples":[-1]},"max_ai_agents":{"type":"integer","examples":[-1]},"max_storage_size":{"type":"integer","examples":[-1]},"is_exceeded":{"type":"boolean","examples":[false]},"is_expired":{"type":"boolean","examples":[false]},"expired_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"AccountStatistics":{"type":"object","properties":{"messages":{"type":"integer","examples":[1500]},"bots":{"type":"integer","examples":[2]},"contacts":{"type":"integer","examples":[350]},"variables":{"type":"integer","examples":[12]},"active_count_by_last_month":{"type":"integer","examples":[120]},"active_count_by_current_tariff_period":{"type":"integer","examples":[80]}}},"Bot":{"type":"object","properties":{"id":{"type":"string","format":"uuid","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"_id":{"type":"string","examples":["60c9d4b8e0f3b2a1c4d5e6f0"]},"channel":{"type":"string","examples":["MESSENGER"]},"status":{"type":"integer","enum":[1,2,3,5,4,8,10,11,12],"description":"\n                    * `1` - new\n\n                    * `2` - reconnect required\n\n                    * `3` - active\n\n                    * `4` - deleted\n\n                    * `5` - inactive\n\n                    * `8` - ready to be deleted\n\n                    * `10` - activation in progress\n\n                    * `11` - action required\n\n                    * `12` - deactivated\n\n                ","examples":[3]},"is_thread_owner":{"type":"boolean","examples":[true]},"avatar":{"type":"object","properties":{"path":{"type":["string","null"],"examples":[null]}}},"channel_data":{"type":"object","description":"Connected Facebook page","properties":{"id":{"type":"string","examples":["104123456789012"]},"name":{"type":["string","null"],"examples":["Shop page"]},"photo":{"type":["string","null"],"examples":["https:\/\/www.cdn.com\/page.png"]}}},"inbox":{"type":"object","properties":{"total":{"type":"integer","examples":[42]},"unread":{"type":"integer","examples":[3]}}},"variables":{"type":"array","description":"Bot variables with their values","items":{"type":"object","properties":{"id":{"type":"string","examples":["60c9d4b8e0f3b2a1c4d5e6fa"]},"name":{"type":"string","examples":["discount"]},"value_type":{"type":"integer","examples":[2]},"value":{"type":["string","number","boolean"],"examples":[10]},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"updated_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}}},"webhooks":{"type":["object","null"],"description":"Webhook settings of the bot","properties":{"status":{"type":"integer","examples":[1]},"events":{"type":"array","items":{"type":"string"},"examples":[["incoming_message"]]}}},"settings":{"type":"object","description":"Bot settings. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":true,"properties":{"service_links":{"type":"boolean","examples":[true]},"open_chat_notification":{"type":"boolean","examples":[true]},"disable_trigger_hints":{"type":"boolean","examples":[false]},"create_contacts_in_crm":{"type":"boolean","examples":[false]},"pause_automation_minutes":{"type":"integer","examples":[60]},"save_incoming_attachments_to_storage":{"type":"boolean","examples":[false]}}},"delete_at":{"type":["string","null"],"format":"date-time","description":"Date and time when the bot is scheduled for deletion","examples":[null]},"statistics":{"type":"object","description":"Returned only when `with_stats` is set","properties":{"subscribed":{"type":"integer","examples":[350]},"messages_incoming":{"type":"integer","examples":[1200]},"messages_outgoing":{"type":"integer","examples":[3400]}}},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"BotStatistics":{"type":"object","properties":{"subscribed_total_count":{"type":"integer","examples":[350]},"subscribed_active_count":{"type":"integer","examples":[300]},"outgoing_messages_total_count":{"type":"integer","examples":[3400]}}},"ContactOperator":{"type":["object","null"],"properties":{"user_id":{"type":"integer","description":"The operator user ID","examples":[1234567]},"username":{"type":"string","description":"The operator full name","examples":["Jane Smith"]},"email":{"type":"string","description":"The operator email","examples":["jane@example.com"]},"avatar":{"type":["string","null"],"description":"The operator avatar URL","examples":["https:\/\/www.cdn.com\/avatar.png"]},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"bot_id":{"type":"string","format":"uuid","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"status":{"type":"integer","enum":[0,1,2,3,4,5,6,7,8,9],"description":"\n                    * `0` - new\n\n                    * `1` - active\n\n                    * `2` - unsubscribed\n\n                    * `3` - disabled\n\n                    * `4` - blocked by user\n\n                    * `5` - reference\n\n                    * `6` - deleted\n\n                    * `7` - invalid\n\n                    * `8` - referral\n\n                    * `9` - duplicate\n\n                ","examples":[1]},"type":{"type":"integer","enum":[1,2],"description":"\n                    * `1` - subscriber\n\n                    * `2` - bot owner\n\n                ","examples":[1]},"avatar":{"type":"object","properties":{"path":{"type":["string","null"],"examples":[null]}}},"channel_data":{"type":"object","description":"Facebook profile of the contact","properties":{"id":{"type":"string","examples":["5512345678901234"]},"name":{"type":["string","null"],"examples":["John Doe"]},"first_name":{"type":["string","null"],"examples":["John"]},"middle_name":{"type":["string","null"],"examples":[null]},"last_name":{"type":["string","null"],"examples":["Doe"]},"email":{"type":["string","null"],"examples":["john@example.com"]},"phone":{"type":["string","null"],"examples":["+380501234567"]},"primary_phone":{"type":["string","null"],"examples":[null]},"gender":{"type":["string","null"],"examples":["male"]},"locale":{"type":["string","null"],"examples":["uk_UA"]},"link":{"type":["string","null"],"examples":[null]},"profile_pic":{"type":["string","null"],"examples":["https:\/\/www.cdn.com\/contact.png"]},"location":{"description":"Arbitrary key-value data. When empty, it is returned as an empty array `[]` instead of an object `{}`","type":["object","null"],"additionalProperties":true},"hometown":{"description":"Arbitrary key-value data. When empty, it is returned as an empty array `[]` instead of an object `{}`","type":["object","null"],"additionalProperties":true},"significant_other":{"description":"Arbitrary key-value data. When empty, it is returned as an empty array `[]` instead of an object `{}`","type":["object","null"],"additionalProperties":true}}},"tags":{"type":"array","uniqueItems":true,"items":{"type":"string"},"examples":[["vip","newsletter"]]},"variables":{"type":"object","description":"Contact variables as `variable_name: variable_value` pairs; the set of keys depends on the bot variables. Date values are formatted as `d.m.Y`, datetime values as `d.m.Y H:i` in the account time zone. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":{"type":["string","number","boolean"]},"examples":[{"city":"Kyiv","age":30}]},"is_chat_opened":{"type":"boolean","examples":[true]},"is_banned":{"type":"boolean","examples":[false]},"is_trashed":{"type":"boolean","examples":[false]},"last_activity_at":{"type":["string","null"],"format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"unsubscribed_at":{"type":["string","null"],"format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"automation_paused_until":{"type":["string","null"],"format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"ai_agent_disclosure_sent_at":{"type":["string","null"],"format":"date-time","examples":[null]},"operator":{"$ref":"#\/components\/schemas\/ContactOperator"},"operator_group":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The operator group ID","examples":["60c9d4b8e0f3b2a1c4d5e6fd"]},"name":{"type":"string","description":"The operator group name","examples":["Support"]}}},"referral_source":{"type":["string","null"],"enum":["AD","POST","SERVICE_SHORTLINK","MESSENGER_CUSTOMER_CHAT_PLUGIN","SUBSCRIPTION_WIDGET","SUBSCRIPTION_EDU","SUBSCRIPTION_CUSTOM_PAYLOAD","AD_TIKTOK",null],"description":"Source the contact came from","examples":["AD"]},"referral_data":{"type":["object","null"],"description":"Details of the ad the contact came from. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":true},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"Variable":{"type":"object","properties":{"id":{"type":"string","examples":["60c9d4b8e0f3b2a1c4d5e6fa"]},"bot_id":{"type":"string","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"name":{"type":"string","examples":["city"]},"description":{"type":["string","null"],"examples":["Contact city"]},"type":{"type":"integer","enum":[1],"description":"\n                    * `1` - contact variable\n\n                ","examples":[1]},"value_type":{"type":"integer","enum":[1,2,3,4,5,6,7,8,9,10],"description":"\n                    * `1` - string\n\n                    * `2` - number\n\n                    * `3` - date\n\n                    * `4` - boolean\n\n                    * `5` - phone\n\n                    * `6` - email\n\n                    * `7` - url\n\n                    * `8` - location\n\n                    * `9` - datetime\n\n                    * `10` - time\n\n                ","examples":[1]},"status":{"type":"integer","enum":[1,2],"description":"\n                    * `1` - active\n\n                    * `2` - trashed\n\n                ","examples":[1]},"mapping":{"type":["object","null"],"description":"Mapping of the variable to a CRM contact attribute","properties":{"crm":{"type":["object","null"],"properties":{"attribute_id":{"type":"integer","examples":[101]},"is_attribute_required":{"type":"boolean","examples":[false]}}}}},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"Flow":{"type":"object","properties":{"id":{"type":"string","examples":["3c9e1d2f-4b5a-4c6d-8e7f-9a0b1c2d3e4f"]},"bot_id":{"type":"string","format":"uuid","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"name":{"type":["string","null"],"examples":["Welcome flow"]},"status":{"type":"integer","enum":[1,2,4],"description":"\n                    * `1` - active\n\n                    * `2` - inactive\n\n                    * `4` - draft\n\n                ","examples":[1]},"triggers":{"type":"array","items":{"description":"Arbitrary key-value data. When empty, it is returned as an empty array `[]` instead of an object `{}`","type":"object","additionalProperties":true,"properties":{"id":{"type":"string","examples":["60c9d4b8e0f3b2a1c4d5e6f2"]},"name":{"type":"string","examples":["start"]}}}},"draft":{"type":["object","null"],"description":"Unpublished draft of the flow. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":true},"errors":{"type":["array","null"],"description":"Flow validation errors; `null` when the flow has no errors","items":{"description":"Arbitrary key-value data. When empty, it is returned as an empty array `[]` instead of an object `{}`","type":"object","additionalProperties":true}},"start_chains":{"type":["array","null"],"description":"IDs of flows started after this flow","items":{"type":"string"},"examples":[["3c9e1d2f-4b5a-4c6d-8e7f-9a0b1c2d3e40"]]},"start_repeat_chains":{"type":["array","null"],"description":"IDs of flows started after this flow is run again","items":{"type":"string"},"examples":[["3c9e1d2f-4b5a-4c6d-8e7f-9a0b1c2d3e40"]]},"facebook_flow_id":{"type":["string","null"],"description":"ID of the flow in Facebook","examples":[null]},"is_public":{"type":"boolean","examples":[false]},"is_public_can_copy":{"type":"boolean","examples":[false]},"folder_id":{"type":["string","null"],"examples":["60c9d4b8e0f3b2a1c4d5e6f3"]},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"Trigger":{"type":"object","properties":{"id":{"type":"string","examples":["60c9d4b8e0f3b2a1c4d5e6f2"]},"bot_id":{"type":"string","format":"uuid","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"flow_id":{"type":["string","null"],"examples":["3c9e1d2f-4b5a-4c6d-8e7f-9a0b1c2d3e4f"]},"name":{"type":"string","examples":["start"]},"type":{"type":"integer","description":"\n                    * `1` - starts immediately upon subscription\n\n                    * `2` - starts when unsubscribed\n\n                    * `3` - default reply\n\n                    * `4` - starts when the specified keyword is entered\n\n                    * `5` - starts at the specified time when subscribing\n\n                ","examples":[4]},"status":{"type":"integer","enum":[1,2],"description":"\n                    * `1` - active\n\n                    * `2` - inactive\n\n                ","examples":[1]},"keywords":{"type":"array","items":{"type":"string"},"examples":[["start","hello"]]},"keywords_search_type":{"type":["integer","null"],"description":"\n                    * `1` - STRICT_MATCH\n\n                    * `2` - CONTAINS\n\n                ","examples":[1]},"post_ids":{"type":"array","description":"IDs of Facebook posts the trigger reacts to","items":{"type":"string"},"examples":[["104123456789012_987654321"]]},"is_public_reply":{"type":"boolean","description":"Whether the bot also replies publicly to the comment","examples":[false]},"replies":{"type":"array","description":"Public reply texts","items":{"type":"string"},"examples":[["Thanks! Check your inbox"]]},"execution":{"type":["object","null"],"description":"Delay before the flow starts: integer `value` in units of `type`; `null` when no delay is set","properties":{"type":{"type":"string","enum":["seconds","minutes","hours","days","days_time","date","time","days_of_week","$variable"],"examples":["minutes"]},"value":{"type":"integer","examples":[10]}}},"a360_event":{"type":["object","null"],"description":"Event that starts the flow (for A360 triggers)","properties":{"uuid":{"type":"string","examples":["3f2504e0-4f89-11d3-9a0c-0305e82c3301"]},"name":{"type":"string","examples":["Order paid"]}}},"pixel":{"type":["object","null"],"description":"Pixel event that starts the flow","properties":{"project_id":{"type":"string","examples":["3f2504e0-4f89-11d3-9a0c-0305e82c3301"]},"event_id":{"type":"string","examples":["3f2504e0-4f89-11d3-9a0c-0305e82c3302"]}}},"crm_subscription":{"type":["object","null"],"description":"CRM subscription event that starts the flow","properties":{"crm_plan_id":{"type":"integer","examples":[15]},"event_type":{"type":"integer","enum":[1,2,3],"description":"\n                    * `1` - payment succeeded\n\n                    * `2` - payment failed\n\n                    * `3` - subscription canceled\n\n                ","examples":[1]}}},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"CampaignFilter":{"type":"object","description":"Filter that selects campaign recipients","properties":{"type":{"type":"string","description":"Filter type (and\/or)","examples":["and"]},"expressions":{"type":"array","description":"Filter expressions","items":{"type":"object","properties":{"type":{"type":"string","description":"Expression type (and\/or)","examples":["and"]},"expressions":{"type":"array","description":"List of expressions","items":{"type":"object","properties":{"operator":{"type":"string","description":"Filter operator (e.g., eq, like, gt, lt, etc.)","examples":["eq"]},"field":{"type":"string","description":"Field to filter by (e.g., tags)","examples":["tags"]},"value":{"type":"string","description":"Value to filter by","examples":["vip"]}}}}}}}}},"Campaign":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid","description":"Campaign ID; pass it as `id` to the recipients and report endpoints","examples":["7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a"]},"bot_id":{"type":"string","format":"uuid","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"title":{"type":"string","examples":["Black Friday sale"]},"message_tag":{"$ref":"#\/components\/schemas\/MeMessageTag"},"message_notification_type":{"$ref":"#\/components\/schemas\/MeMessageNotificationType"},"messages":{"$ref":"#\/components\/schemas\/MeCampaignMessages"},"send_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"MeMessageTag":{"type":"string","enum":["TEST","PROMOTIONAL","HUMAN_AGENT","CUSTOMER_FEEDBACK"],"description":"Message tag. Campaigns accept `TEST`, `PROMOTIONAL`, `HUMAN_AGENT`, `CUSTOMER_FEEDBACK`; `sendText` accepts `HUMAN_AGENT`, `CUSTOMER_FEEDBACK`, `CONFIRMED_EVENT_UPDATE`, `POST_PURCHASE_UPDATE`, `ACCOUNT_UPDATE`","examples":["HUMAN_AGENT"]},"MeMessageNotificationType":{"type":"string","enum":["REGULAR","SILENT_PUSH","NO_PUSH"],"description":"Push notification type: `REGULAR` - sound or vibration, `SILENT_PUSH` - on-screen notification only, `NO_PUSH` - no notification","examples":["REGULAR"]},"MeCampaignMessages":{"type":"array","description":"A list of messages to send","items":{"type":"object","properties":{"type":{"type":"string","description":"Message type","examples":["RESPONSE"]},"tag":{"type":"string","description":"Message tag for `MESSAGE_TAG` messages; only `HUMAN_AGENT` is supported","examples":["HUMAN_AGENT"]},"content_type":{"type":"string","description":"Content type of the message","examples":["message"]},"data":{"type":"object","description":"Message content; the set of fields depends on the message type","properties":{"text":{"type":"string","description":"Text of the message","examples":["Hello world!"]},"attachment":{"$ref":"#\/components\/schemas\/MeMessageAttachment"}}}}}},"MeMessageAttachment":{"type":"object","description":"Generic template attachment (card or carousel)","properties":{"type":{"type":"string","enum":["template"],"examples":["template"]},"payload":{"type":"object","properties":{"template_type":{"type":"string","enum":["generic"],"examples":["generic"]},"elements":{"type":"array","items":{"$ref":"#\/components\/schemas\/MeMessageElement"}}}}}},"MeMessageElement":{"type":"object","properties":{"title":{"type":"string","description":"Card title","examples":["Example title"]},"subtitle":{"type":"string","description":"Card subtitle","examples":["Example subtitle"]},"image_url":{"type":"string","description":"Card image URL","examples":["https:\/\/www.spcdn.org\/images\/promo-logo\/correct\/sendpulse-logo-13.png"]},"buttons":{"type":"array","items":{"$ref":"#\/components\/schemas\/MeMessageButton"}},"filename":{"type":"string","description":"File name of the attachment","examples":["file.pdf"]},"is_external_attachment":{"type":"boolean","description":"Whether the file is hosted outside SendPulse","examples":[true]}}},"MeMessageButton":{"type":"object","properties":{"type":{"type":"string","enum":["web_url","postback"],"examples":["postback"]},"title":{"type":"string","description":"Button title","examples":["Example button"]},"url":{"type":"string","description":"URL opened by a `web_url` button","examples":["https:\/\/sendpulse.com"]},"data":{"type":"object","description":"Data of a `postback` button","properties":{"chain":{"type":"string","format":"uuid","description":"ID of the flow started by a `postback` button","examples":["3c9e1d2f-4b5a-4c6d-8e7f-9a0b1c2d3e4f"]}}}}},"CampaignReport":{"type":"object","properties":{"id":{"type":"string","examples":["7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a"]},"bot_id":{"type":"string","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"status":{"type":"integer","enum":[1,2,3,6,7,8,9,10],"description":"\n                    * `1` - new\n\n                    * `2` - sending\n\n                    * `3` - sent\n\n                    * `6` - canceled\n\n                    * `7` - failed\n\n                    * `8` - deleted\n\n                    * `9` - partially deleted\n\n                    * `10` - deleting\n\n                ","examples":[3]},"title":{"type":"string","examples":["Black Friday sale"]},"send_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"stats":{"type":"object","properties":{"messages":{"type":"object","properties":{"all":{"type":"integer","examples":[100]},"sent":{"type":"integer","examples":[98]},"rejected":{"type":"integer","examples":[2]},"delivered":{"type":"integer","examples":[95]},"opened":{"type":"integer","examples":[60]},"redirected":{"type":"integer","examples":[12]}}},"recipients":{"type":"object","properties":{"all":{"type":"integer","examples":[100]},"sent":{"type":"integer","examples":[98]},"rejected":{"type":"integer","examples":[2]},"partial_rejected":{"type":"integer","examples":[0]},"delivered":{"type":"integer","examples":[95]},"opened":{"type":"integer","examples":[60]},"redirected":{"type":"integer","examples":[12]},"activity":{"type":"integer","examples":[20]}}},"buttons":{"type":"array","items":{"$ref":"#\/components\/schemas\/CampaignButtonStats"}}}},"messages":{"$ref":"#\/components\/schemas\/MeCampaignMessages"},"links":{"type":"object","description":"Statistics of the links in the campaign. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":true},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"updated_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"CampaignButtonStats":{"type":"object","properties":{"id":{"type":"string","examples":["60c9d4b8e0f3b2a1c4d5e6f4"]},"title":{"type":"string","examples":["Buy now"]},"clicks":{"type":"integer","examples":[12]},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"updated_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"CampaignRecipient":{"type":"object","properties":{"_id":{"type":"string","examples":["60c9d4b8e0f3b2a1c4d5e6f5"]},"contact":{"type":"object","properties":{"id":{"type":"string","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"fb_id":{"type":"string","examples":["5512345678901234"]},"name":{"type":["string","null"],"examples":["John Doe"]},"photo":{"type":["string","null"],"examples":["https:\/\/www.cdn.com\/contact.png"]},"email":{"type":["string","null"],"examples":["john@example.com"]},"phone":{"type":["string","null"],"examples":["+380501234567"]}}},"campaign_id":{"type":"string","examples":["7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a"]},"sent":{"type":"boolean","examples":[true]},"activity":{"type":"boolean","examples":[false]},"clicked":{"type":"boolean","examples":[false]},"delivered":{"type":"boolean","examples":[true]},"opened":{"type":"boolean","examples":[true]},"buttons":{"type":"array","items":{"$ref":"#\/components\/schemas\/CampaignButtonStats"}},"partial_rejected":{"type":"boolean","examples":[false]},"rejected":{"type":"boolean","examples":[false]},"errors":{"type":"array","items":{"description":"Arbitrary key-value data. When empty, it is returned as an empty array `[]` instead of an object `{}`","type":"object","additionalProperties":true}},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"updated_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"CampaignRecipientsPage":{"type":"object","description":"Page of campaign recipients. Contains `skip`, `page` and `last_page` when `skip` is used, otherwise `search_after`","properties":{"list":{"type":"array","items":{"$ref":"#\/components\/schemas\/CampaignRecipient"}},"sort":{"description":"Arbitrary key-value data. When empty, it is returned as an empty array `[]` instead of an object `{}`","type":"object","additionalProperties":{"type":"string","enum":["asc","desc"]},"examples":[{"_id":"desc"}]},"total":{"type":"integer","examples":[100]},"size":{"type":"integer","examples":[20]},"skip":{"type":"integer","examples":[20]},"page":{"type":"integer","examples":[2]},"last_page":{"type":"integer","examples":[5]},"search_after":{"type":"array","items":{"type":"string"},"examples":[["60c9d4b8e0f3b2a1c4d5e6f5"]]}}},"Chat":{"type":"object","properties":{"contact":{"$ref":"#\/components\/schemas\/Contact"},"inbox_last_message":{"oneOf":[{"$ref":"#\/components\/schemas\/Message"},{"type":"null"}]},"inbox_unread":{"type":"integer","examples":[2]}}},"MessageSender":{"type":["object","null"],"description":"User who sent or edited the message","properties":{"id":{"type":"integer","examples":[1234567]},"email":{"type":"string","examples":["jane@example.com"]},"firstname":{"type":["string","null"],"examples":["Jane"]},"lastname":{"type":["string","null"],"examples":["Smith"]},"avatar":{"type":["string","null"],"examples":["https:\/\/www.cdn.com\/avatar.png"]}}},"Message":{"type":"object","properties":{"id":{"type":"string","format":"uuid","examples":["9e8d7c6b-5a4f-4e3d-8c2b-1a0f9e8d7c6b"]},"bot_id":{"type":"string","format":"uuid","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"contact_id":{"type":"string","format":"uuid","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"campaign_id":{"type":["string","null"],"examples":[null]},"data":{"type":"object","description":"Messenger message payload. Its fields depend on the message type; `message_id` is the Facebook message ID. For payment messages the object contains payment details. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":true,"properties":{"message_id":{"type":["string","null"],"examples":["m_AbCdEfGhIjKlMnOp"]}}},"direction":{"type":"integer","enum":[1,2],"description":"\n                    * `1` - in\n\n                    * `2` - out\n\n                ","examples":[2]},"status":{"type":"integer","enum":[1,2,3,4,5,6,7,8,9],"description":"\n                    * `1` - new\n\n                    * `2` - sent\n\n                    * `3` - delivered\n\n                    * `4` - opened\n\n                    * `5` - redirected\n\n                    * `6` - rejected\n\n                    * `7` - delete failed\n\n                    * `8` - deleted\n\n                    * `9` - played\n\n                ","examples":[2]},"type":{"type":"integer","description":"Internal type of the message; returned for payment, operator and note messages","examples":[6]},"sent_by":{"$ref":"#\/components\/schemas\/MessageSender"},"delivered_at":{"type":["string","null"],"format":"date-time","description":"Date and time when the message was delivered","examples":[null]},"opened_at":{"type":["string","null"],"format":"date-time","examples":[null]},"redirected_at":{"type":["string","null"],"format":"date-time","examples":[null]},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"MessageCount":{"type":"object","properties":{"count":{"type":"integer","description":"Number of messages whose read state was changed","examples":[3]}}},"OperatorNote":{"type":"object","description":"Operator note left in the contact chat","properties":{"id":{"type":"string","format":"uuid","examples":["2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e"]},"_id":{"type":"string","examples":["60c9d4b8e0f3b2a1c4d5e6fc"]},"user_id":{"type":"integer","examples":[1234567]},"bot_id":{"type":"string","format":"uuid","examples":["a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]},"contact_id":{"type":"string","format":"uuid","examples":["6f4b2c1e-8a3d-4f5e-9b7c-1d2e3f4a5b6c"]},"campaign_id":{"type":"null","examples":[null]},"messenger":{"type":"object","properties":{"sender_id":{"type":"string","examples":["104123456789012"]},"recipient_id":{"type":"string","examples":["5512345678901234"]},"message":{"description":"Arbitrary key-value data. When empty, it is returned as an empty array `[]` instead of an object `{}`","type":"object","additionalProperties":true,"properties":{"text":{"type":"string","description":"Note text","examples":["Customer asked to call back tomorrow"]}}}}},"sent_by":{"$ref":"#\/components\/schemas\/MessageSender"},"edited_by":{"$ref":"#\/components\/schemas\/MessageSender"},"direction":{"type":"integer","examples":[2]},"type":{"type":"integer","description":"Internal type of the message; returned for payment, operator and note messages","examples":[6]},"channel":{"type":["string","null"],"examples":["ma_chat"]},"is_bot":{"type":"boolean","examples":[false]},"sent_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"delivered_at":{"type":["string","null"],"format":"date-time","examples":["2020-12-12T00:00:00+03:00"]},"updated_at":{"type":["string","null"],"format":"date-time","examples":[null]}}},"OperatorNoteList":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#\/components\/schemas\/OperatorNote"}}}},"Tag":{"type":"object","properties":{"id":{"type":"string","examples":["60c9d4b8e0f3b2a1c4d5e6f6"]},"name":{"type":"string","examples":["vip"]},"count":{"type":"integer","description":"Number of contacts with the tag","examples":[42]},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}}}}}