{"openapi":"3.0.0","info":{"title":"Bridge service API","description":"Using the API for Bridge 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":"0.0.1"},"servers":[{"url":"https:\/\/api.sendpulse.com\/bridge","description":""}],"tags":[{"name":"account","description":""},{"name":"bots","description":""},{"name":"contacts","description":"(subscribers)"},{"name":"attachments","description":"api.tags.attachments.description"}],"paths":{"\/account":{"get":{"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","security":[{"Authorization by API key":[]}],"tags":["account"],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"$ref":"#\/components\/schemas\/Account"}},"type":"object"}}}}}}},"\/bots":{"get":{"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","security":[{"Authorization by API key":[]}],"tags":["bots"],"parameters":[{"in":"query","name":"size","description":"The limit of pagination items that will be returned","schema":{"type":"integer"}},{"in":"query","name":"skip","description":"The offset of pagination items, indicating where the current batch starts","schema":{"type":"integer"}}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Bot"}}},"type":"object"}}}}}}},"\/bots\/openedChatsCount":{"get":{"summary":"Get opened chats count","description":"Returns the number of contacts with opened chats for the authenticated user","security":[{"Authorization by API key":[]}],"tags":["bots"],"responses":{"200":{"description":"Opened chats count","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"properties":{"count":{"type":"integer"}},"type":"object"}},"type":"object"}}}}}}},"\/bots\/create":{"post":{"summary":"Create the bot","description":"","security":[{"Authorization by API key":[]}],"tags":["bots"],"requestBody":{"description":"","required":true,"content":{"application\/json":{"schema":{"properties":{"internal_id":{"type":"string","description":"Internal ID of the bot"},"name":{"type":"string","description":"Bot name"},"service":{"type":"integer","description":"Service ID"},"avatar":{"type":"string","description":"Avatar URL"}},"required":["internal_id","name","service"]},"examples":{"Example":{"value":{"internal_id":"380939876543","name":"My Personal TG bot","service":1001,"avatar":"https:\/\/example.com\/image.png"}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Bot"}}}}}}},"\/bots\/create-test":{"post":{"summary":"Create test bot","description":"","security":[{"Authorization by API key":[]}],"tags":["bots"],"requestBody":{"description":"","required":true,"content":{"application\/json":{"schema":{"properties":{"internal_id":{"type":"string","description":"Internal ID of the bot"},"name":{"type":"string","description":"Bot name"},"api_url":{"type":"string","description":"Base URL of the API"},"avatar":{"type":"string","description":"Avatar URL"}},"required":["internal_id","name","api_url"]},"examples":{"Example":{"value":{"internal_id":"380939876543","name":"My Personal TG bot","api_url":"https:\/\/example.com\/","avatar":"https:\/\/example.com\/image.png"}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Bot"}}}}}}},"\/bots\/update-test":{"put":{"summary":"Update test bot","description":"","security":[{"Authorization by API key":[]}],"tags":["bots"],"requestBody":{"description":"","required":true,"content":{"application\/json":{"schema":{"properties":{"bot_id":{"type":"string","description":"Internal ID of the bot"},"internal_id":{"type":"string","description":"Internal ID of the bot"},"name":{"type":"string","description":"Bot name"},"api_url":{"type":"string","description":"Base URL of the API"},"avatar":{"type":"string","description":"Avatar URL"}},"required":["bot_id","internal_id","name","api_url"]},"examples":{"Example":{"value":{"bot_id":"66b0a840d4d9d1155e433221","internal_id":"380939876543","name":"My Personal TG bot","api_url":"https:\/\/example.com\/","avatar":"https:\/\/example.com\/image.png"}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Bot"}}}}}}},"\/contacts":{"get":{"summary":"Get a list of contacts","description":"Returns lists of contacts with information about each","security":[{"Authorization by API key":[]}],"tags":["contacts"],"parameters":[{"in":"query","name":"bot_id","description":"api.paths.common.parameters.bot_id","schema":{"type":"string"},"required":true},{"in":"query","name":"size","description":"The limit of pagination items that will be returned","schema":{"type":"integer"}},{"in":"query","name":"skip","description":"The offset of pagination items, indicating where the current batch starts","schema":{"type":"integer"}}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Bot"}}},"type":"object"}}}}}}},"\/contacts\/get":{"get":{"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","security":[{"Authorization by API key":[]}],"tags":["contacts"],"parameters":[{"in":"query","name":"id","required":true,"schema":{"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."}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#\/components\/schemas\/Contact"}}}}}}}}},"\/contacts\/send":{"post":{"summary":"Send a message to a contact","description":"Sends a text message, image, or a file to a contact with the specified contact ID.  To view an example of the request body, select a message type from the drop-down list","security":[{"Authorization by API key":[]}],"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."},"message":{"type":"object","description":"Message to send, specifying the type and content of the message"}},"required":["contact_id","message"]},"examples":{"Send a text message":{"value":{"contact_id":"66b0a840d4d9d1155e433221","message":{"type":"text","text":{"text":"Hello World!"}}}},"Send a text message with buttons":{"value":{"contact_id":"66b0a840d4d9d1155e433221","message":{"type":"text","text":{"text":"Hello World!","buttons":[[{"text":"Example url button","type":"web_url","url":"https:\/\/example.com\/"}],[{"text":"Example postback button","type":"postback","to_chain_id":"5decdd1780c52b05583c7ca5"}]]}}}},"Send a message with an image":{"value":{"contact_id":"66b0a840d4d9d1155e433221","message":{"type":"image","image":{"file":{"path":"https:\/\/example.com\/image.png"},"caption":"Hello World!"}}}},"Send a message with an image with buttons":{"value":{"contact_id":"66b0a840d4d9d1155e433221","message":{"type":"image","image":{"file":{"path":"https:\/\/example.com\/image.png"},"caption":"Hello World!","buttons":[[{"text":"Example url button","type":"web_url","url":"https:\/\/example.com\/"}],[{"text":"Example postback button","type":"postback","to_chain_id":"5decdd1780c52b05583c7ca5"}]]}}}},"Send a message with a file":{"value":{"contact_id":"66b0a840d4d9d1155e433221","message":{"type":"document","document":{"file":{"path":"https:\/\/example.com\/file.pdf"},"caption":"Hello World!","buttons":[[{"text":"Example url button","type":"web_url","url":"https:\/\/example.com\/"}],[{"text":"Example postback button","type":"postback","to_chain_id":"5decdd1780c52b05583c7ca5"}]]}}}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Message"}}}}}}},"\/contacts\/send-by-phone":{"post":{"summary":"Send a message to a contact by phone number","description":"Sends a text message, image, or a file to a contact with the specified contact phone number.  To view an example of the request body, select a message type from the drop-down list","security":[{"Authorization by API key":[]}],"tags":["contacts"],"requestBody":{"description":"","required":true,"content":{"application\/json":{"schema":{"properties":{"bot_id":{"type":"string","description":"Internal ID of the bot"},"phone":{"type":"string","description":"bg::api.paths.messages.send.parameters.phone"},"message":{"type":"object","description":"Message to send, specifying the type and content of the message"}},"required":["phone","message"]},"examples":{"Send a text message":{"value":{"bot_id":"67939d81b1920d2640050cc4","phone":"380939876543","message":{"type":"text","text":{"text":"Hello World!"}}}},"Send a text message with buttons":{"value":{"bot_id":"67939d81b1920d2640050cc4","phone":"380939876543","message":{"type":"text","text":{"text":"Hello World!","buttons":[[{"text":"Example url button","type":"web_url","url":"https:\/\/example.com\/"}],[{"text":"Example postback button","type":"postback","to_chain_id":"5decdd1780c52b05583c7ca5"}]]}}}},"Send a message with an image":{"value":{"bot_id":"67939d81b1920d2640050cc4","phone":"380939876543","message":{"type":"image","image":{"file":{"path":"https:\/\/example.com\/image.png"},"caption":"Hello World!"}}}},"Send a message with an image with buttons":{"value":{"bot_id":"67939d81b1920d2640050cc4","phone":"380939876543","message":{"type":"image","image":{"file":{"path":"https:\/\/example.com\/image.png"},"caption":"Hello World!","buttons":[[{"text":"Example url button","type":"web_url","url":"https:\/\/example.com\/"}],[{"text":"Example postback button","type":"postback","to_chain_id":"5decdd1780c52b05583c7ca5"}]]}}}},"Send a message with a file":{"value":{"bot_id":"67939d81b1920d2640050cc4","phone":"380939876543","message":{"type":"document","document":{"file":{"path":"https:\/\/example.com\/file.pdf"},"caption":"Hello World!","buttons":[[{"text":"Example url button","type":"web_url","url":"https:\/\/example.com\/"}],[{"text":"Example postback button","type":"postback","to_chain_id":"5decdd1780c52b05583c7ca5"}]]}}}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Message"}}}}}}},"\/contacts\/send-by-username":{"post":{"summary":"Send a message to a contact by username","description":"Sends a text message, image, or a file to a contact with the specified contact username.  To view an example of the request body, select a message type from the drop-down list","security":[{"Authorization by API key":[]}],"tags":["contacts"],"requestBody":{"description":"","required":true,"content":{"application\/json":{"schema":{"properties":{"bot_id":{"type":"string","description":"Internal ID of the bot"},"username":{"type":"string","description":"bg::api.paths.messages.send.parameters.username"},"message":{"type":"object","description":"Message to send, specifying the type and content of the message"}},"required":["phone","message"]},"examples":{"Send a text message":{"value":{"bot_id":"67939d81b1920d2640050cc4","username":"johndoe","message":{"type":"text","text":{"text":"Hello World!"}}}},"Send a text message with buttons":{"value":{"bot_id":"67939d81b1920d2640050cc4","username":"johndoe","message":{"type":"text","text":{"text":"Hello World!","buttons":[[{"text":"Example url button","type":"web_url","url":"https:\/\/example.com\/"}],[{"text":"Example postback button","type":"postback","to_chain_id":"5decdd1780c52b05583c7ca5"}]]}}}},"Send a message with an image":{"value":{"bot_id":"67939d81b1920d2640050cc4","username":"johndoe","message":{"type":"image","image":{"file":{"path":"https:\/\/example.com\/image.png"},"caption":"Hello World!"}}}},"Send a message with an image with buttons":{"value":{"bot_id":"67939d81b1920d2640050cc4","username":"johndoe","message":{"type":"image","image":{"file":{"path":"https:\/\/example.com\/image.png"},"caption":"Hello World!","buttons":[[{"text":"Example url button","type":"web_url","url":"https:\/\/example.com\/"}],[{"text":"Example postback button","type":"postback","to_chain_id":"5decdd1780c52b05583c7ca5"}]]}}}},"Send a message with a file":{"value":{"bot_id":"67939d81b1920d2640050cc4","username":"johndoe","message":{"type":"document","document":{"file":{"path":"https:\/\/example.com\/file.pdf"},"caption":"Hello World!","buttons":[[{"text":"Example url button","type":"web_url","url":"https:\/\/example.com\/"}],[{"text":"Example postback button","type":"postback","to_chain_id":"5decdd1780c52b05583c7ca5"}]]}}}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Message"}}}}}}},"\/contacts\/mark-read":{"put":{"summary":"Mark messages as read","description":"Mark all of the contact's messages as read (set unread count to 0)","security":[{"Authorization by API key":[]}],"tags":["contacts"],"parameters":[{"in":"query","name":"contact_id","schema":{"type":"string"},"description":"Contact ID. Used to set its unread message count to 0."}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"count":{"type":"integer","description":"Contact messages count marked as read"}},"type":"object"}}}}}}},"\/contacts\/openChat":{"post":{"summary":"Open chat for a contact","description":"Increase the chat priority by marking it as open","security":[{"Authorization by API key":[]}],"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."}},"required":["contact_id"]}}}},"responses":{"200":{"description":"Chat opened successfully","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/closeChat":{"post":{"summary":"Close chat for a contact","description":"Close the chat and lower the priority.","security":[{"Authorization by API key":[]}],"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."}},"required":["contact_id"]}}}},"responses":{"200":{"description":"Chat closed successfully","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/disable":{"post":{"summary":"Disable contact","description":"Disables a contact in your audience list. Campaigns and autoflows will not be sent to this contact","security":[{"Authorization by API key":[]}],"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."}},"required":["contact_id"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/enable":{"post":{"summary":"Enable contact","description":"Enables a contact in the audience list, and the contact starts receiving campaigns and autoflows","security":[{"Authorization by API key":[]}],"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."}},"required":["contact_id"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/delete":{"post":{"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.","security":[{"Authorization by API key":[]}],"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."}},"required":["contact_id"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/setVariable":{"post":{"summary":"Assign a variable to contact","description":"Adds or updates the value of a variable for the selected contact.","security":[{"Authorization by API key":[]}],"tags":["contacts"],"requestBody":{"description":"Choose one of the available request bodies","required":true,"content":{"application\/json":{"schema":{"type":"object","required":["contact_id","variables"],"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."},"variables":{"type":"array","description":"api.paths.contacts.setVariable.parameters.variables","items":{"oneOf":[{"type":"object","required":["variable_name","variable_value"],"properties":{"variable_name":{"type":"string","description":"Name of the variable"},"variable_value":{"description":"The value that is set for the variable","anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},{"type":"object","required":["variable_id","variable_value"],"properties":{"variable_id":{"type":"string","description":"The ID of the created variable can be obtained via other methods"},"variable_value":{"description":"The value that is set for the variable","anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}]}}}},"examples":{"Set by variable name":{"value":{"contact_id":"string","variables":[{"variable_name":"string","variable_value":"string"},{"variable_name":"string","variable_value":"string"}]}},"Set by variable ID":{"value":{"contact_id":"string","variables":[{"variable_id":"string","variable_value":"string"},{"variable_id":"string","variable_value":"string"}]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/deleteVariable":{"post":{"summary":"Delete a variable from the selected contact","description":"Delete the value of a variable for the selected contact.","security":[{"Authorization by API key":[]}],"tags":["contacts"],"requestBody":{"description":"Choose one of the available request bodies","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."},"variable_id":{"type":"string","description":"The ID of the created variable can be obtained via other methods"},"variable_name":{"type":"string","description":"Name of the variable"}},"required":{"0":"contact_id","oneOf":["variable_id","variable_name"]}},"examples":{"Delete by variable ID":{"value":{"contact_id":"string","variable_id":"string"}},"Delete by variable name":{"value":{"contact_id":"string","variable_name":"string"}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/setTag":{"post":{"summary":"Assign a tag to contact","description":"Assigns tags to the selected contact","security":[{"Authorization by API key":[]}],"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."},"tags":{"type":"array","description":"List of tags to assign to the contact","items":{"type":"string"}}},"required":["contact_id","tags"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/deleteTag":{"post":{"summary":"Remove a tag from a contact","description":"Removes the tag for the selected contact.","security":[{"Authorization by API key":[]}],"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."},"tag":{"type":"string","description":"Tag you want to remove"}},"required":["contact_id","tag"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/getPauseAutomation":{"get":{"summary":"Get remaining time for automation pause","description":"Returns the time remaining until autoflows resume for this contact","security":[{"Authorization by API key":[]}],"tags":["contacts"],"parameters":[{"in":"query","name":"contact_id","required":true,"schema":{"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."}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/setPauseAutomation":{"post":{"summary":"Pause autoflows for a contact","description":"Pauses autoflows for the specified contact","security":[{"Authorization by API key":[]}],"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."},"minutes":{"type":"integer","example":60,"description":"Minutes"}},"required":["contact_id","minutes"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/deletePauseAutomation":{"post":{"summary":"Resume autoflows for a contact","description":"Resumes autoflows for the specified contact","security":[{"Authorization by API key":[]}],"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."}},"required":["contact_id"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/contacts\/notes":{"get":{"summary":"Get a list of contact's operator notes","description":"Returns a list of existing operator notes by contact","security":[{"Authorization by API key":[]}],"tags":["contacts"],"parameters":[{"in":"query","name":"bot_id","required":true,"schema":{"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."},{"in":"query","name":"contact_id","required":true,"schema":{"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."}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Message"}}},"type":"object"}}}}}},"\/contacts\/createNote":{"post":{"summary":"Send an operator note","description":"Sends an operator note about a contact","security":[{"Authorization by API key":[]}],"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."},"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."},"text":{"type":"string","description":"Text of note"}},"required":["contact_id","bot_id","text"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Message"}}}}}}},"\/contacts\/updateNote":{"post":{"summary":"Update operator note","description":"Updates an existing operator note about a contact","security":[{"Authorization by API key":[]}],"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."},"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."},"text":{"type":"string","description":"Text of note"},"note_id":{"type":"string","description":"Note ID."}},"required":["contact_id","bot_id","text","note_id"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Message"}}}}}}},"\/contacts\/deleteNote":{"post":{"summary":"Delete operator note","description":"Deletes an existing operator note about a contact","security":[{"Authorization by API key":[]}],"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."},"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."},"note_id":{"type":"string","description":"Note ID."}},"required":["contact_id","bot_id","note_id"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Message"}}}}}}},"\/contacts\/operators\/assign":{"post":{"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.","security":[{"Authorization by API key":[]}],"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."},"operator_id":{"type":"integer","description":"The ID of the operator to assign"}},"required":["contact_id","operator_id"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"boolean","nullable":true}}}}}}}}},"\/contacts\/operators\/unAssign":{"post":{"summary":"Unassign responsible operators for the chat.","description":"Removes any assigned operator for the chat.","security":[{"Authorization by API key":[]}],"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."}},"required":["contact_id"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"boolean"}}}}}}}}},"\/flows":{"get":{"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","security":[{"Authorization by API key":[]}],"tags":["flows"],"parameters":[{"in":"query","name":"bot_id","required":true,"schema":{"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."},{"in":"query","name":"size","description":"The limit of pagination items that will be returned","schema":{"type":"integer"}},{"in":"query","name":"skip","description":"The offset of pagination items, indicating where the current batch starts","schema":{"type":"integer"}}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"$ref":"#\/components\/schemas\/Flow"}},"type":"object"}}}}}}},"\/flows\/run":{"post":{"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 chain, where variables will be inserted in the \"Message\" element as a JSON path, for example {{$['tracking_number']}}.","security":[{"Authorization by API key":[]}],"tags":["flows"],"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."},"flow_id":{"type":"string","description":"Flow ID to be launched. Can be obtained with the method of obtaining the list of flows"},"external_data":{"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']}}.","example":{"tracking_number":"1234-0987-5678-9012"}}},"required":["contact_id","flow_id"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/flows\/runByTrigger":{"post":{"summary":"Run a flow by trigger keywords","description":"Launches a flow with the trigger keyword for the selected contact","security":[{"Authorization by API key":[]}],"tags":["flows"],"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."},"trigger_keyword":{"type":"string","description":"Keyword (command) that launches the flow"},"external_data":{"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']}}.","example":{"tracking_number":"1234-0987-5678-9012"}}},"required":["contact_id","trigger_keyword"]}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SuccessResponse"}}}}}}},"\/triggers":{"get":{"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","security":[{"Authorization by API key":[]}],"tags":["triggers"],"parameters":[{"in":"query","name":"bot_id","required":true,"schema":{"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."},{"in":"query","name":"size","description":"The limit of pagination items that will be returned","schema":{"type":"integer"}},{"in":"query","name":"skip","description":"The offset of pagination items, indicating where the current batch starts","schema":{"type":"integer"}}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"$ref":"#\/components\/schemas\/Trigger"}},"type":"object"}}}}}}},"\/variables":{"get":{"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","security":[{"Authorization by API key":[]}],"tags":["variables"],"parameters":[{"in":"query","name":"bot_id","required":true,"schema":{"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."},{"in":"query","name":"size","description":"The limit of pagination items that will be returned","schema":{"type":"integer"}},{"in":"query","name":"skip","description":"The offset of pagination items, indicating where the current batch starts","schema":{"type":"integer"}}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"$ref":"#\/components\/schemas\/Variable"}},"type":"object"}}}}}}},"\/chats":{"get":{"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","security":[{"Authorization by API key":[]}],"tags":["chats"],"parameters":[{"in":"query","name":"bot_id","required":true,"schema":{"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."},{"in":"query","name":"size","schema":{"type":"integer"}},{"in":"query","name":"skip","schema":{"type":"integer"}}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"$ref":"#\/components\/schemas\/Chat"}},"type":"object"}}}}}}},"\/chats\/messages":{"get":{"summary":"Get a list of messages","description":"Returns a list of all messages in correspondence with the specified subscriber","security":[{"Authorization by API key":[]}],"tags":["chats"],"parameters":[{"in":"query","name":"contact_id","required":true,"schema":{"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."},{"in":"query","name":"size","description":"The limit of pagination items that will be returned","schema":{"type":"integer"}},{"in":"query","name":"skip","description":"The offset of pagination items, indicating where the current batch starts","schema":{"type":"integer"}},{"in":"query","name":"search_after","description":"The ID of the element after which elements will be returned","schema":{"type":"string"}},{"in":"query","name":"order","description":"Sort order ASC or DESC","schema":{"type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Message"}}},"type":"object"}}}}}}},"\/campaigns\/recipients":{"get":{"summary":"Get campaign recipients","description":"Get a list of campaign recipients with delivery statistics","security":[{"Authorization by API key":[]}],"tags":["campaigns"],"parameters":[{"in":"query","name":"id","required":true,"schema":{"type":"string"},"description":"Campaign ID"},{"in":"query","name":"order","description":"Sort order ASC or DESC","schema":{"type":"string","enum":["asc","desc"]}},{"in":"query","name":"search_after","description":"The ID of the element after which elements will be returned","schema":{"type":"string"}},{"in":"query","name":"size","description":"The limit of pagination items that will be returned","schema":{"type":"integer"}},{"in":"query","name":"skip","description":"The offset of pagination items, indicating where the current batch starts","schema":{"type":"integer"}}],"responses":{"200":{"description":"Campaign recipients list","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"list":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"contact":{"type":"object"},"campaign_id":{"type":"string"},"sent":{"type":"boolean"},"activity":{"type":"boolean"},"clicked":{"type":"boolean"},"delivered":{"type":"boolean"},"opened":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"clicks":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}},"partial_rejected":{"type":"boolean"},"rejected":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}},"sort":{"type":"object"},"total":{"type":"integer"},"size":{"type":"integer"},"search_after":{"type":"array","items":{"type":"string"}}}}},"type":"object"}}}}}}},"\/campaigns\/report":{"get":{"summary":"Get campaign report","description":"Get campaign data with sending statistics","security":[{"Authorization by API key":[]}],"tags":["campaigns"],"parameters":[{"in":"query","name":"id","required":true,"schema":{"type":"string"},"description":"Campaign ID"}],"responses":{"200":{"description":"Campaign report","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"id":{"type":"string"},"bot_id":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"},"send_at":{"type":"string"},"stats":{"type":"object","properties":{"messages":{"type":"object","properties":{"all":{"type":"integer"},"sent":{"type":"integer"},"rejected":{"type":"integer"},"delivered":{"type":"integer"},"opened":{"type":"integer"},"redirected":{"type":"integer"}}},"recipients":{"type":"object","properties":{"all":{"type":"integer"},"sent":{"type":"integer"},"rejected":{"type":"integer"},"partial_rejected":{"type":"integer"},"delivered":{"type":"integer"},"opened":{"type":"integer"},"redirected":{"type":"integer"},"activity":{"type":"integer"}}},"buttons":{"type":"array","items":{"type":"object"}}}},"messages":{"type":"array","items":{"type":"object"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}},"type":"object"}}}}}}},"\/campaigns\/send":{"post":{"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","security":[{"Authorization by API key":[]}],"tags":["campaigns"],"requestBody":{"description":"","required":true,"content":{"application\/json":{"schema":{"properties":{"title":{"type":"string","description":"Campaign title"},"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."},"send_at":{"type":"string","description":"Specify the date and time 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"},"messages":{"type":"array","description":"Message to send, specifying the type and content of the campaign","items":{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"Campaign type, can have the values \"text,\" \"image,\" or \"document\"","example":"text"},"filter":{"type":"object","description":"Filter for campaign sending","properties":{"type":{"type":"string","description":"Filter type (and\/or)"},"expressions":{"type":"array","description":"Filter expressions","items":{"type":"object","properties":{"type":{"type":"string","description":"Expression type (and\/or)"},"expressions":{"type":"array","description":"List of expressions","items":{"type":"object","properties":{"operator":{"type":"string","description":"Filter operator (e.g., eq, like, gt, lt, etc.)"},"field":{"type":"string","description":"Field to filter by (e.g., tags)"},"value":{"type":"string","description":"Value to filter by"}}}}}}}}},"message":{"type":"object","description":"","properties":{"text":{"type":"string","description":""}}}}}}},"required":["title","bot_id","messages"]},"examples":{"Send a message with an image":{"value":{"title":"string","bot_id":"string","send_at":"Y-m-d H:i","filter":{"type":"and","expressions":[{"type":"and","expressions":[{"operator":"eq","field":"tags","value":"SOME_TAG_HERE"}]}]},"messages":[{"type":"image","image":{"file":{"path":"https:\/\/www.cdn.com\/photo.png"}}}]}},"Send a text message":{"value":{"title":"string","bot_id":"string","send_at":"Y-m-d H:i","messages":[{"type":"text","text":{"text":"Example text"}}]}},"Send a message with a file":{"value":{"title":"string","bot_id":"string","send_at":"Y-m-d H:i","messages":[{"type":"document","document":{"file":{"path":"https:\/\/www.cdn.com\/document.zip"}}}]}},"Send a message with audio":{"value":{"title":"string","bot_id":"string","send_at":"Y-m-d H:i","messages":[{"type":"audio","audio":{"file":{"path":"https:\/\/www.cdn.com\/audio.mp3"}}}]}},"Send a message with a video":{"value":{"title":"string","bot_id":"string","send_at":"Y-m-d H:i","messages":[{"type":"video","video":{"file":{"path":"https:\/\/www.cdn.com\/video.mp4"}}}]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"$ref":"#\/components\/schemas\/Campaign"}},"type":"object"}}}}}}},"\/tags":{"get":{"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","security":[{"Authorization by API key":[]}],"tags":["tags"],"parameters":[{"in":"query","name":"bot_id","required":true,"schema":{"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."},{"in":"query","name":"size","description":"The limit of pagination items that will be returned","schema":{"type":"integer"}},{"in":"query","name":"skip","description":"The offset of pagination items, indicating where the current batch starts","schema":{"type":"integer"}}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Tag"}}},"type":"object"}}}}}}},"\/attachments\/image":{"post":{"summary":"Upload image attachment","description":"Upload an image file (jpg, jpeg, png, gif). Max size: 2MB.","security":[{"Authorization by API key":[]}],"tags":["attachments"],"requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","required":["attachment"],"properties":{"bot_id":{"type":"string","description":"Bot identifier (ObjectId)"},"attachment":{"type":"string","format":"binary","description":"Image file"},"context":{"type":"string","description":"Upload context"}}}}}},"responses":{"201":{"description":"Image uploaded successfully","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"url":{"type":"string"},"type":{"type":"string"}}}}}}}},"400":{"description":"Validation error (invalid file type or size)"},"401":{"description":"Unauthorized"}}}},"\/attachments\/video":{"post":{"summary":"Upload video attachment","description":"Upload a video file (mp4, avi, mov). Max size: 50MB.","security":[{"Authorization by API key":[]}],"tags":["attachments"],"requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","required":["attachment"],"properties":{"bot_id":{"type":"string","description":"Bot identifier (ObjectId)"},"attachment":{"type":"string","format":"binary","description":"Video file"},"context":{"type":"string","description":"Upload context"}}}}}},"responses":{"201":{"description":"Video uploaded successfully","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"url":{"type":"string"},"type":{"type":"string"}}}}}}}},"400":{"description":"Validation error (invalid file type or size)"},"401":{"description":"Unauthorized"}}}},"\/attachments\/audio":{"post":{"summary":"Upload audio attachment","description":"Upload an audio file (mp3, ogg, wav, m4a). Max size: 20MB.","security":[{"Authorization by API key":[]}],"tags":["attachments"],"requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","required":["attachment"],"properties":{"bot_id":{"type":"string","description":"Bot identifier (ObjectId)"},"attachment":{"type":"string","format":"binary","description":"Audio file"},"context":{"type":"string","description":"Upload context"}}}}}},"responses":{"201":{"description":"Audio uploaded successfully","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"url":{"type":"string"},"type":{"type":"string"}}}}}}}},"400":{"description":"Validation error (invalid file type or size)"},"401":{"description":"Unauthorized"}}}},"\/attachments\/document":{"post":{"summary":"Upload document attachment","description":"Upload a document file (pdf, doc, docx, xls, xlsx, txt, zip). Max size: 20MB.","security":[{"Authorization by API key":[]}],"tags":["attachments"],"requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","required":["attachment"],"properties":{"bot_id":{"type":"string","description":"Bot identifier (ObjectId)"},"attachment":{"type":"string","format":"binary","description":"Document file"},"context":{"type":"string","description":"Upload context"}}}}}},"responses":{"201":{"description":"Document uploaded successfully","content":{"application\/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"url":{"type":"string"},"type":{"type":"string"}}}}}}}},"400":{"description":"Validation error (invalid file type or size)"},"401":{"description":"Unauthorized"}}}}},"components":{"securitySchemes":{"Authorization by API key":{"type":"http","scheme":"bearer","description":"Paste your API key in the format sp_apikey_*** from the https:\/\/login.sendpulse.com\/settings\/api section"}},"schemas":{"SuccessResponse":{"properties":{"success":{"type":"boolean"},"data":{"anyOf":[{"type":"array","items":{"type":"object"}},{"type":"object"},{"type":"boolean"},{"type":"string"},{"type":"integer"}]}},"type":"object"},"Account":{"properties":{"tariff":{"type":"object","description":"`-1` - unlimited","properties":{"code":{"type":"string"},"max_bots":{"type":"integer"},"max_contacts":{"type":"integer","example":-1},"max_messages":{"type":"integer"},"max_tags":{"type":"integer"},"max_variables":{"type":"integer"},"branding":{"type":"boolean"},"is_exceeded":{"type":"boolean"},"is_expired":{"type":"boolean"},"expired_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"}}},"statistics":{"type":"object","description":"","properties":{"messages":{"type":"integer"},"bots":{"type":"integer"},"contacts":{"type":"integer"},"variables":{"type":"integer"}}}}},"Bot":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"api_url":{"type":"string","description":"bg::api.components.schemas.Bot.api_url"},"token":{"type":"string","description":"bg::api.components.schemas.Bot.token"},"internal_id":{"type":"string","description":"bg::api.components.schemas.Bot.internal_id"},"avatar":{"type":"string","nullable":true,"example":null},"variables":{"type":"array","items":{"type":"object"}},"settings":{"type":"object","properties":{"service_links":{"type":"boolean"},"open_chat_notification":{"type":"boolean"},"disable_trigger_hints":{"type":"boolean"},"standard_text_settings":{"type":"object"}}},"inbox":{"type":"object","properties":{"total":{"type":"integer"},"unread":{"type":"integer"}}},"status":{"type":"integer","enum":[3,4],"description":"\n                    * `3` - active\n\n                    * `4` - inactive\n\n                "},"service":{"type":"integer","description":"bg::api.components.schemas.Bot.service"},"created_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"}}},"Contact":{"properties":{"id":{"type":"string"},"bot_id":{"type":"string"},"status":{"type":"integer","enum":[1,2,3,4],"description":"\n                    * `1` - active\n\n                    * `2` - unsubscribed\n\n                    * `3` - disabled\n\n                    * `4` - blocked by user\n\n                "},"channel_data":{"type":"object","properties":{"id":{"type":"integer"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"phone":{"type":"ineger","nullable":true},"email":{"type":"string","nullable":true},"picture":{"type":"string","nullable":true}}},"tags":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"variables":{"type":"object","description":"variable_name: variable_value"},"is_chat_opened":{"type":"boolean"},"last_activity_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"},"automation_paused_until":{"type":"string","nullable":true,"example":"2020-12-12T00:00:00+03:00"},"created_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"}}},"Message":{"properties":{"id":{"type":"string"},"contact_id":{"type":"string"},"bot_id":{"type":"string"},"campaign":{"type":"object","nullable":true,"example":null},"chain":{"type":"object","nullable":true,"example":null},"reject_reason":{"type":"string","nullable":true,"example":null},"data":{"type":"object","description":"Message data object","example":{"type":"type","text":"hello","subscriber_id":"d86e2ca7-0000-0000-1111-1f1f32d0f0b1"}},"direction":{"type":"integer","enum":{"IN":1,"OUT":2},"description":"\n                    * `1` - in\n\n                    * `2` - out\n\n                "},"status":{"type":"integer","enum":[1],"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                "},"type":{"type":"string","enum":["text","image","document"],"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                "},"created_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"}}},"Variable":{"properties":{"id":{"type":"string"},"bot_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"integer","enum":[1,2],"description":"\n                    * `1` - contact variable\n\n                    * `2` - bot variable\n\n                "},"value_type":{"type":"integer","example":1,"enum":[1,2,3,4,5,6,7],"description":"\n                this type of variable can have the following values:\n\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                "},"status":{"type":"integer","enum":[1,2],"description":"\n                    * `1` - active\n\n                    * `2` - trashed\n\n                "},"created_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"}}},"Flow":{"properties":{"id":{"type":"string"},"bot_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"integer","enum":[1,2],"description":"\n                    * `1` - active\n\n                    * `2` - inactive\n\n                "},"triggers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"integer","enum":[1,2,3,4,5],"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                "}}}},"created_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"}}},"Trigger":{"properties":{"id":{"type":"string"},"bot_id":{"type":"string"},"flow_id":{"type":"string","nullable":true},"name":{"type":"string"},"type":{"type":"integer","enum":[1,2,3,4,5],"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                "},"status":{"type":"integer","enum":[1,2],"description":"\n                    * `1` - active\n\n                    * `2` - inactive\n\n                "},"keywords":{"type":"array","items":{"type":"string"}},"execution":{"type":"object","properties":{"interval":{"type":"integer"},"units":{"type":"integer","enum":[1,2,3],"description":"\n                        * `1` - minutes\n\n                        * `2` - hours\n\n                        * `3` - days\n\n                    "}}},"created_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"}}},"Campaign":{"properties":{"id":{"type":"string"},"bot_id":{"type":"string"},"title":{"type":"string"},"send_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"},"messages":{"type":"array","items":{"type":"object"}},"created_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"}}},"Chat":{"properties":{"contact":{"$ref":"#\/components\/schemas\/Contact"},"inbox_last_message":{"$ref":"#\/components\/schemas\/Message"},"inbox_unread":{"type":"integer"}}},"Tag":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"contact_count":{"type":"integer"},"created_at":{"type":"string","example":"2020-12-12T00:00:00+03:00"}}}}},"security":[{"Authorization by API key":[]}]}