{"openapi":"3.1.2","info":{"title":"Chatbots service API","description":"Using the API for Chatbots, you can integrate your system with SendPulse\u2019s chatbots service and get detailed information about your account, bots, dialogs.\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\/chatbots","description":"SendPulse production API server"}],"security":[{"apiKey":[]}],"tags":[{"name":"dialogs","description":"Dialogs with contacts from all channels of the account"},{"name":"account","description":"Account pricing plan and usage statistics"},{"name":"bots","description":"Bots connected in all channels of the account"},{"name":"operators","description":"Account operators and their statistics"},{"name":"operator-groups","description":"Operator groups and their members"},{"name":"dialog-labels","description":"Create and manage dialog labels to organize your conversations"}],"paths":{"\/dialogs":{"get":{"operationId":"getDialogs","summary":"Get dialogs list info","description":"Returns information about your dialogs from all channels","tags":["dialogs"],"parameters":[{"$ref":"#\/components\/parameters\/size"},{"$ref":"#\/components\/parameters\/skip"},{"in":"query","name":"search_after","required":false,"description":"The ID of the last_inbox_message element after which elements will be returned","schema":{"type":"string","minLength":1,"maxLength":32},"example":"60c9d4b8e0f3b2a1c4d5e6f9"},{"$ref":"#\/components\/parameters\/order"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DialogPageResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}},"post":{"operationId":"filterDialogs","summary":"Search dialogs with filter","description":"Returns dialogs filtered by specified criteria. Supports filtering by label_ids and other fields.","tags":["dialogs"],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","properties":{"filter":{"$ref":"#\/components\/schemas\/DialogFilter"}}},"examples":{"filter_by_labels":{"summary":"Filter dialogs by label IDs","value":{"filter":{"type":"and","expressions":[{"type":"and","expressions":[{"operator":"in","field":"label_ids","value":["60c9d4b8e0f3b2a1c4d5e6f1","60c9d4b8e0f3b2a1c4d5e6f2"]}]}]}}}}}}},"responses":{"200":{"description":"Dialogs found successfully","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DialogPageResponse"}}}},"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"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}}},"\/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":[],"responses":{"200":{"description":"Bots of all channels of the account. Bots of channels whose service did not respond are omitted. Note: Bridge bots are currently returned as one nested array element instead of separate items","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BotListResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"$ref":"#\/components\/responses\/UnprocessableEntity"}}}},"\/operators":{"get":{"operationId":"getOperators","summary":"Get a list of operators","description":"Returns the list of operators available on the account (the account owner and all active related operators) with information about each: user ID, username, email, avatar, and online status","tags":["operators"],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorListResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}}},"\/operators\/{operator}\/statistics\/current":{"post":{"operationId":"getOperatorCurrentStatistics","summary":"Get current statistics for an operator","description":"Returns the current statistics for a specified operator, including active dialogs, unanswered dialogs, and assigned dialogs counts","tags":["operators"],"parameters":[{"in":"path","name":"operator","required":true,"description":"The operator user ID","schema":{"type":"integer"},"example":1234567}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["bot_ids"],"properties":{"bot_ids":{"type":"array","minItems":1,"maxItems":1000,"uniqueItems":true,"description":"Required array of unique bot IDs, up to 1000 elements. Each bot ID must be a valid ObjectId (24 hex characters) or UUID, depending on the channel. Passed in request body to support large lists","items":{"type":"string","description":"Bot ID in ObjectId (24 hex chars) or UUID format depending on channel"},"examples":[["60c9d4b8e0f3b2a1c4d5e6f0","a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"]]}}}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorCurrentStatisticsResponse"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Returned when the operator with the given ID doesn't exist or is not an operator of your account","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Request body missing, bot_ids absent, empty, exceeds 1000 elements, contains duplicates, or contains invalid bot ID (not ObjectId or UUID)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/operators\/{operator}\/statistics\/period":{"get":{"operationId":"getOperatorPeriodStatistics","summary":"Get period statistics for an operator","description":"Returns statistics for a specified operator within the given date range (defaulting to last 7 days if not specified), including dialogs opened\/closed, average response time, and online duration. Both from and to are inclusive; dates must be in Y-m-d format and not in the future","tags":["operators"],"parameters":[{"in":"path","name":"operator","required":true,"description":"The operator user ID","schema":{"type":"integer"},"example":1234567},{"in":"query","name":"from","required":false,"description":"Start date, Y-m-d, not in the future. Optional, but must be passed together with to","schema":{"type":"string","format":"date"},"example":"2026-10-01"},{"in":"query","name":"to","required":false,"description":"End date, Y-m-d, not in the future, must be >= from. Optional, but must be passed with from. When both are omitted, the last 7 days including today are used. Range must not exceed 90 days","schema":{"type":"string","format":"date"},"example":"2026-10-07"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorPeriodStatisticsResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Returned when the operator with the given ID doesn't exist or is not an operator of your account","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Returned when invalid: bad date, only one of from\/to given, or range over 90 days","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/operator-groups":{"get":{"operationId":"getOperatorGroups","summary":"Get a list of operator groups","description":"Returns the list of operator groups created on the account with information about each: group ID, name, and the account owner's user ID","tags":["operator-groups"],"responses":{"200":{"description":"Page of operator groups","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorGroupPageResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}},"post":{"operationId":"createOperatorGroup","summary":"Create an operator group","description":"Creates a new operator group with the given name","tags":["operator-groups"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorGroupInput"}}}},"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorGroupResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"description":"Returned when the request is invalid, e.g. the name is missing, exceeds 255 characters, or an operator group with this name already exists","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/operator-groups\/{operator_group}":{"put":{"operationId":"updateOperatorGroup","summary":"Update an operator group","description":"Updates the name of the selected operator group","tags":["operator-groups"],"parameters":[{"in":"path","name":"operator_group","required":true,"description":"The operator group ID","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f3"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorGroupInput"}}}},"responses":{"200":{"description":"Whether the operator group was updated","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Returned when the operator group with the given ID doesn't exist","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Returned when the request is invalid, e.g. the name is missing, exceeds 255 characters, or an operator group with this name already exists","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"delete":{"operationId":"deleteOperatorGroup","summary":"Delete an operator group","description":"Deletes the selected operator group along with all its members","tags":["operator-groups"],"parameters":[{"in":"path","name":"operator_group","required":true,"description":"The operator group ID","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f3"}],"responses":{"200":{"description":"Whether the operator group was deleted","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Returned when the operator group with the given ID doesn't exist","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/operator-groups\/{operator_group}\/members":{"get":{"operationId":"getOperatorGroupMembers","summary":"Get a list of operator group members","description":"Returns the list of members of the selected operator group with information about each: member ID, operator ID, auto distribution settings, and operator profile data","tags":["operator-groups"],"parameters":[{"in":"path","name":"operator_group","required":true,"description":"The operator group ID","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f3"}],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/OperatorGroupMemberListResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Returned when the operator group with the given ID doesn't exist","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}},"post":{"operationId":"addOperatorGroupMembers","summary":"Add members to an operator group","description":"Adds the selected operators to the operator group. Operators already in the group are skipped","tags":["operator-groups"],"parameters":[{"in":"path","name":"operator_group","required":true,"description":"The operator group ID","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f3"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["operator_ids"],"properties":{"operator_ids":{"type":"array","minItems":1,"uniqueItems":true,"description":"IDs of the operators to add to the group","items":{"type":"integer"},"examples":[[1234567,7654321]]}}}}}},"responses":{"200":{"description":"Whether at least one member was added","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Returned when the operator group with the given ID doesn't exist","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Returned when the request is invalid, e.g. operator_ids is empty or contains an operator ID that doesn't exist on the account","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/operator-groups\/{operator_group}\/members\/{operator_group_member}":{"delete":{"operationId":"deleteOperatorGroupMember","summary":"Remove a member from an operator group","description":"Removes the selected member from the operator group","tags":["operator-groups"],"parameters":[{"in":"path","name":"operator_group","required":true,"description":"The operator group ID","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f3"},{"in":"path","name":"operator_group_member","required":true,"description":"The operator group member ID","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f4"}],"responses":{"200":{"description":"Whether the member was removed","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Returned when the operator group or the member doesn't exist, or the member doesn't belong to the specified operator group","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/dialog-labels":{"get":{"operationId":"getDialogLabels","summary":"Get all dialog labels for account","description":"Returns the list of all dialog labels created on the account","tags":["dialog-labels"],"responses":{"200":{"description":"Operation successful","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DialogLabelListResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"}}},"post":{"operationId":"createDialogLabel","summary":"Create a dialog label","description":"Creates a new dialog label with emoji and name","tags":["dialog-labels"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DialogLabelInput"}}}},"responses":{"200":{"description":"Label created successfully","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DialogLabelResponse"}}}},"400":{"description":"Label limit reached (maximum 16 labels per account)","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"description":"Validation failed, e.g., missing required fields or invalid emoji","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/dialog-labels\/assign":{"post":{"operationId":"assignDialogLabels","summary":"Assign labels to dialog","description":"Replace the set of labels assigned to a dialog. An empty array removes all labels.","tags":["dialog-labels"],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["dialog_id","label_ids"],"properties":{"dialog_id":{"type":"string","description":"The dialog ID","examples":["60c9d4b8e0f3b2a1c4d5e6f5"]},"label_ids":{"type":"array","maxItems":16,"uniqueItems":true,"description":"Array of label IDs to assign to the dialog","items":{"type":"string"},"examples":[["60c9d4b8e0f3b2a1c4d5e6f1","60c9d4b8e0f3b2a1c4d5e6f2"]]}}}}}},"responses":{"200":{"description":"Whether the labels of the dialog were updated","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"422":{"description":"Validation failed: invalid or unknown dialog ID, invalid label IDs or label does not exist","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}}},"\/dialog-labels\/{dialog_label}":{"put":{"operationId":"updateDialogLabel","summary":"Update a dialog label","description":"Updates emoji and name of an existing dialog label","tags":["dialog-labels"],"parameters":[{"in":"path","name":"dialog_label","required":true,"description":"The dialog label ID","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f1"}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DialogLabelInput"}}}},"responses":{"200":{"description":"Label updated successfully","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/DialogLabelResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Label not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Validation failed, e.g., invalid emoji or name","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/ValidationError"}}}}}},"delete":{"operationId":"deleteDialogLabel","summary":"Delete a dialog label","description":"Deletes a label. The label is also removed from all dialogs where it was assigned.","tags":["dialog-labels"],"parameters":[{"in":"path","name":"dialog_label","required":true,"description":"The dialog label ID","schema":{"type":"string"},"example":"60c9d4b8e0f3b2a1c4d5e6f1"}],"responses":{"200":{"description":"Whether the label was deleted","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/BooleanResponse"}}}},"400":{"$ref":"#\/components\/responses\/BadRequest"},"401":{"$ref":"#\/components\/responses\/Unauthorized"},"403":{"$ref":"#\/components\/responses\/Forbidden"},"404":{"description":"Label not found","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}}},"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},"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, for example the dialog label limit is reached, 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"}}}},"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 or the user has no permission for the action","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 group 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":[{"name":["The name field is required."]}]},"PageSort":{"type":"object","description":"Sort order by field. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":{"type":"string","enum":["asc","desc"]},"examples":[{"last_inbox_message.id":"desc"}]},"BooleanResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"boolean","examples":[true]}}},"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"}}}},"DialogPageResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/DialogPage"}}},"OperatorListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Operator"}}}},"OperatorCurrentStatisticsResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/OperatorCurrentStatistics"}}},"OperatorPeriodStatisticsResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/OperatorPeriodStatistics"}}},"OperatorGroupPageResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/OperatorGroupPage"}}},"OperatorGroupResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/OperatorGroup"}}},"OperatorGroupMemberListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/OperatorGroupMember"}}}},"DialogLabelListResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/DialogLabelList"}}},"DialogLabelResponse":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","examples":[true]},"data":{"$ref":"#\/components\/schemas\/DialogLabel"}}},"Account":{"type":"object","properties":{"tariff":{"$ref":"#\/components\/schemas\/AccountTariff"},"statistics":{"$ref":"#\/components\/schemas\/AccountStatistics"},"services":{"type":"array","description":"Channels used on the account: `1` - Messenger, `3` - Telegram, `4` - WhatsApp, `5` - Instagram, `6` - Viber, `7` - Live chat, `8` - TikTok, `1000` and above - Bridge channels","items":{"type":"integer"},"examples":[[1,3,5]]}}},"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","description":"Account usage statistics","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","description":"Bot as returned by the `GET \/bots` method of its channel API. Only the common fields are listed; other fields depend on the channel. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":true,"properties":{"id":{"type":"string","description":"Bot ID; ObjectId or UUID depending on the channel","examples":["60c9d4b8e0f3b2a1c4d5e6f0"]},"channel":{"type":"string","description":"Channel of the bot","examples":["TELEGRAM"]},"channel_data":{"type":"object","description":"Channel-specific bot data. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":true,"examples":[{"id":7000000001,"name":"Shop bot","username":"shop_bot"}]},"inbox":{"type":"object","description":"Number of received and unread messages","properties":{"total":{"type":"integer","examples":[42]},"unread":{"type":"integer","examples":[3]}}},"settings":{"type":"object","description":"Channel-specific bot settings. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":true,"examples":[{"timezone":"Europe\/Kyiv"}]},"statistics":{"type":"object","description":"Channel-specific bot statistics. When empty, it is returned as an empty array `[]` instead of an object `{}`","additionalProperties":true,"examples":[{"contacts":350}]},"status":{"type":"integer","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                ","enum":[1,2,3,5,4,8,10,11,12],"examples":[3]},"created_at":{"type":"string","format":"date-time","description":"Bot creation date","examples":["2020-12-12T00:00:00+03:00"]}}},"DialogFilter":{"type":"object","description":"Filter object with expressions","properties":{"type":{"type":"string","description":"Filter type (and\/or)","enum":["and","or"],"examples":["and"]},"expressions":{"type":"array","description":"Array of filter expressions","items":{"$ref":"#\/components\/schemas\/DialogFilterGroup"}}}},"DialogFilterGroup":{"type":"object","properties":{"type":{"type":"string","description":"Expression type (and\/or)","enum":["and","or"],"examples":["and"]},"expressions":{"type":"array","description":"Array of conditions","items":{"$ref":"#\/components\/schemas\/DialogFilterCondition"}}}},"DialogFilterCondition":{"type":"object","properties":{"operator":{"type":"string","description":"Condition operator: \"in\" for array values, \"eq\" for single value","examples":["in"]},"field":{"type":"string","description":"Field name to filter by (e.g., label_ids)","examples":["label_ids"]},"value":{"type":"array","description":"Filter value. Can be string for \"eq\" operator or array of strings for \"in\" operator","items":{"type":"string"},"examples":[["60c9d4b8e0f3b2a1c4d5e6f1"]]}}},"DialogPage":{"type":"object","description":"Page of items. Contains `skip`, `page` and `last_page` when `skip` is used, otherwise `search_after`","properties":{"list":{"type":"array","items":{"$ref":"#\/components\/schemas\/Dialog"}},"sort":{"$ref":"#\/components\/schemas\/PageSort"},"total":{"type":"integer","description":"Total number of items","examples":[125]},"size":{"type":"integer","description":"Page size","examples":[20]},"skip":{"type":"integer","description":"Number of skipped items","examples":[20]},"page":{"type":"integer","description":"Current page number","examples":[2]},"last_page":{"type":"integer","description":"Last page number","examples":[7]},"search_after":{"type":"array","description":"Sort values of the last item on the page; pass the first one as `search_after` to get the next page","items":{"type":["string","null"]},"examples":[["60c9d4b8e0f3b2a1c4d5e6f9"]]}}},"Dialog":{"type":"object","description":"Dialog with a contact","required":["user_id","bot_id","contact","operator","is_chat_opened","created_at","updated_at"],"properties":{"_id":{"type":"string","description":"Dialog ID","examples":["60c9d4b8e0f3b2a1c4d5e6f5"]},"user_id":{"type":"integer","description":"Account owner user ID","examples":[1234567]},"bot_id":{"type":"string","description":"Bot ID; ObjectId or UUID depending on the channel","examples":["60c9d4b8e0f3b2a1c4d5e6f0"]},"contact":{"$ref":"#\/components\/schemas\/DialogContact"},"operator":{"$ref":"#\/components\/schemas\/DialogOperator"},"operator_group":{"$ref":"#\/components\/schemas\/DialogOperatorGroup"},"last_inbox_message":{"type":["object","null"],"description":"Last incoming message","properties":{"id":{"type":["string","null"],"description":"Message ID","examples":["60c9d4b8e0f3b2a1c4d5e6f9"]},"text":{"type":["string","null"],"description":"Message text","examples":["Hello!"]},"date":{"type":"string","format":"date-time","description":"Message date","examples":["2020-12-12T00:00:00+03:00"]}}},"last_outbox_message":{"type":["object","null"],"description":"Last outgoing message","properties":{"text":{"type":["string","null"],"description":"Message text","examples":["How can I help you?"]},"date":{"type":"string","format":"date-time","description":"Message date","examples":["2020-12-12T00:00:00+03:00"]}}},"service":{"type":"integer","description":"Channel code: `1` - Messenger, `3` - Telegram, `4` - WhatsApp, `5` - Instagram, `6` - Viber, `7` - Live chat, `8` - TikTok, `1000` and above - Bridge channels","examples":[3]},"inbox_unread_count":{"type":"integer","description":"Number of unread incoming messages","examples":[2]},"is_chat_opened":{"type":"boolean","description":"Whether the chat is open","examples":[true]},"is_trashed":{"type":"boolean","description":"Whether the dialog is deleted; always `false` in the list","examples":[false]},"label_ids":{"type":"array","description":"IDs of labels assigned to the dialog","items":{"type":"string"},"examples":[["60c9d4b8e0f3b2a1c4d5e6f1"]]},"created_at":{"type":"string","format":"date-time","description":"Dialog creation date","examples":["2020-12-12T00:00:00+03:00"]},"updated_at":{"type":["string","null"],"format":"date-time","description":"Dialog update date","examples":["2020-12-12T00:00:00+03:00"]}}},"DialogContact":{"type":"object","description":"Contact of the dialog","required":["id","full_name","profile_pic"],"properties":{"id":{"type":"string","description":"Contact ID","examples":["60c9d4b8e0f3b2a1c4d5e6f7"]},"full_name":{"type":"string","description":"Contact full name","examples":["John Doe"]},"profile_pic":{"type":["string","null"],"description":"Contact profile picture URL","examples":["https:\/\/www.cdn.com\/contact.png"]},"tg_business_connection":{"type":["object","null"],"description":"Telegram Business connection the dialog goes through (Telegram only)","properties":{"id":{"type":["string","null"],"examples":["60c9d4b8e0f3b2a1c4d5e6fa"]},"username":{"type":["string","null"],"examples":["john_shop"]},"first_name":{"type":["string","null"],"examples":["John"]},"last_name":{"type":["string","null"],"examples":["Doe"]}}}}},"DialogOperator":{"type":["object","null"],"description":"Operator assigned to the dialog","properties":{"user_id":{"type":"integer","description":"The operator user ID","examples":[1234567]},"username":{"type":"string","description":"The operator full name","examples":["Jane Smith"]},"avatar":{"type":["string","null"],"description":"The operator avatar URL","examples":["https:\/\/login.sendpulse.com\/files\/avatar.png"]},"email":{"type":"string","description":"The operator email","examples":["jane@example.com"]},"created_at":{"type":"string","format":"date-time","examples":["2020-12-12T00:00:00+03:00"]}}},"DialogOperatorGroup":{"type":["object","null"],"description":"Operator group assigned to the dialog","properties":{"id":{"type":"string","description":"The operator group ID","examples":["60c9d4b8e0f3b2a1c4d5e6f3"]},"name":{"type":"string","description":"The operator group name","examples":["Support"]}}},"Operator":{"type":"object","properties":{"parent_id":{"type":["integer","null"],"description":"Account owner user ID; `null` for the account owner","examples":[1234567]},"user_id":{"type":"integer","description":"The operator user ID","examples":[7654321]},"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:\/\/login.sendpulse.com\/files\/avatar.png"]},"online":{"type":["boolean","null"],"description":"Whether the operator currently has an active websocket session","examples":[true]},"status":{"type":["string","null"],"description":"Operator status; not filled by this method","enum":["active_online","active_offline","offline","absent",null],"examples":[null]}}},"OperatorCurrentStatistics":{"type":"object","properties":{"operator_id":{"type":"integer","description":"The operator ID","examples":[7654321]},"active_dialogs":{"type":"integer","description":"Number of currently active dialogs for this operator","examples":[5]},"unanswered_dialogs":{"type":"integer","description":"Number of currently unanswered dialogs for this operator","examples":[2]},"assigned_dialogs_closed":{"type":"integer","description":"Number of closed dialogs that were assigned to this operator","examples":[40]},"assigned_dialogs_total":{"type":"integer","description":"Total number of dialogs assigned to this operator, excluding trashed ones","examples":[45]}}},"OperatorPeriodStatistics":{"type":"object","properties":{"operator_id":{"type":"integer","description":"The operator ID","examples":[7654321]},"from":{"type":"string","format":"date","description":"Start date of the statistics period (Y-m-d format, UTC midnight)","examples":["2026-10-01"]},"to":{"type":"string","format":"date","description":"End date of the statistics period (Y-m-d format, UTC midnight); both from and to are included","examples":["2026-10-07"]},"opened_dialogs":{"type":"integer","description":"Number of dialogs opened during the specified period","examples":[30]},"opened_events":{"type":"integer","description":"Dialog open events count; may exceed opened_dialogs (dialogs can open multiple times)","examples":[34]},"assigned_events":{"type":"integer","description":"Dialog assignment events count","examples":[28]},"closed_dialogs":{"type":"integer","description":"Number of dialogs closed during the specified period","examples":[25]},"closed_events":{"type":"integer","description":"Dialog close events count; may exceed closed_dialogs (dialogs can close multiple times)","examples":[27]},"average_response_time_sec":{"type":"number","description":"Average response time in seconds (float) during the specified period","examples":[95.5]},"duration_online_sec":{"type":"integer","description":"Total time online in seconds (integer) during the specified period","examples":[28800]}}},"OperatorGroupInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":255,"description":"Operator group name; must be unique within the account","examples":["Support"]}}},"OperatorGroupPage":{"type":"object","description":"Page of items. Contains `skip`, `page` and `last_page` when `skip` is used, otherwise `search_after`","properties":{"list":{"type":"array","items":{"$ref":"#\/components\/schemas\/OperatorGroup"}},"sort":{"$ref":"#\/components\/schemas\/PageSort"},"total":{"type":"integer","description":"Total number of items","examples":[3]},"size":{"type":"integer","description":"Page size","examples":[20]},"skip":{"type":"integer","description":"Number of skipped items","examples":[0]},"page":{"type":"integer","description":"Current page number","examples":[1]},"last_page":{"type":"integer","description":"Last page number","examples":[1]},"search_after":{"type":"array","description":"Sort values of the last item on the page; pass the first one as `search_after` to get the next page","items":{"type":["string","null"]},"examples":[[]]}}},"OperatorGroup":{"type":"object","properties":{"_id":{"type":"string","description":"The operator group ID","examples":["60c9d4b8e0f3b2a1c4d5e6f3"]},"name":{"type":"string","description":"The operator group name","examples":["Support"]},"user_id":{"type":"integer","description":"The account owner's user ID","examples":[1234567]},"created_at":{"type":"string","format":"date-time","description":"Operator group creation date","examples":["2020-12-12T00:00:00+03:00"]},"updated_at":{"type":["string","null"],"format":"date-time","description":"Operator group update date","examples":["2020-12-12T00:00:00+03:00"]}}},"OperatorGroupMember":{"type":"object","properties":{"member_id":{"type":"string","description":"The operator group member ID","examples":["60c9d4b8e0f3b2a1c4d5e6f4"]},"operator_id":{"type":"integer","description":"The operator ID","examples":[7654321]},"auto_distribution_enabled":{"type":"boolean","description":"Whether auto distribution is enabled for the operator","examples":[true]},"auto_distribution_limit":{"type":["integer","null"],"description":"The auto distribution limit for the operator","examples":[10]},"username":{"type":["string","null"],"description":"The operator full name","examples":["Jane Smith"]},"email":{"type":["string","null"],"description":"The operator email","examples":["jane@example.com"]},"avatar":{"type":["string","null"],"description":"The operator avatar URL","examples":["https:\/\/login.sendpulse.com\/files\/avatar.png"]}}},"DialogLabelInput":{"type":"object","required":["emoji","name"],"properties":{"emoji":{"type":"string","description":"A single emoji character","examples":["\ud83d\udd25"]},"name":{"type":"string","minLength":1,"maxLength":24,"description":"Label name","examples":["Hot lead"]}}},"DialogLabelList":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#\/components\/schemas\/DialogLabel"}}}},"DialogLabel":{"type":"object","properties":{"id":{"type":"string","description":"The dialog label ID","examples":["60c9d4b8e0f3b2a1c4d5e6f1"]},"emoji":{"type":"string","description":"The emoji representing the label","examples":["\ud83d\udd25"]},"name":{"type":"string","description":"The label name","examples":["Hot lead"]}}}}}}