openapi: 3.0.3 info: title: MG Node Transport API version: 1.0.0 description: MG Node Transport API servers: - url: https://mg.rcrm-tech.ru/api/transport/v1 tags: - name: Channel - name: File - name: Template - name: Message paths: /channels: get: summary: List of channels description: Returns a list of channels security: - transport_token: [] tags: - Channel operationId: ListChannels parameters: - $ref: '#/components/parameters/IDQuery' - $ref: '#/components/parameters/ChannelActiveQuery' - $ref: '#/components/parameters/ChannelTypeQuery' - $ref: '#/components/parameters/SinceQuery' - $ref: '#/components/parameters/UntilQuery' - $ref: '#/components/parameters/LimitQuery' responses: '200': $ref: '#/components/responses/ChannelsListResponse' default: $ref: '#/components/responses/ErrorResponse' post: summary: Channel activation description: Activates a new channel with set parameters operationId: ActivateChannel security: - transport_token: [] tags: - Channel requestBody: $ref: '#/components/requestBodies/ActivateChannelRequest' responses: '200': $ref: '#/components/responses/ActivateChannelResponse' '201': $ref: '#/components/responses/ActivateChannelResponse' default: $ref: '#/components/responses/ErrorResponse' /channels/{channel_id}: delete: summary: Channel deactivation description: Deactivates an existing channel operationId: DeactivateChannel tags: - Channel security: - transport_token: [] parameters: - $ref: '#/components/parameters/ChannelIdPath' responses: '200': $ref: '#/components/responses/DeactivateChannelResponse' default: $ref: '#/components/responses/ErrorResponse' put: summary: Channel update description: Updating parameters of an existing channel operationId: UpdateChannel tags: - Channel security: - transport_token: [] parameters: - $ref: '#/components/parameters/ChannelIdPath' requestBody: $ref: '#/components/requestBodies/UpdateChannelRequest' responses: '200': $ref: '#/components/responses/UpdateChannelResponse' default: $ref: '#/components/responses/ErrorResponse' /files/upload: post: summary: File upload description: Uploads a file to the repository and returns information about it operationId: UploadFile tags: - File security: - transport_token: [] requestBody: content: multipart/form-data: schema: type: string format: binary responses: '200': $ref: '#/components/responses/FileResponse' default: $ref: '#/components/responses/ErrorResponse' /files/upload_by_url: post: summary: File upload by URL description: Uploads a file from external sources by URL operationId: UploadFileByUrl tags: - File security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/UploadFileByUrlRequest' responses: '200': $ref: '#/components/responses/FileResponse' default: $ref: '#/components/responses/ErrorResponse' /files/{id}: get: summary: File information description: Returns information about the file by its UUID operationId: GetFileUrl security: - transport_token: [] tags: - File parameters: - $ref: '#/components/parameters/FileUUIDPath' responses: '200': $ref: '#/components/responses/FileResponse' default: $ref: '#/components/responses/ErrorResponse' /channels/{channel_id}/templates: post: summary: Template activation description: Activates a new message template for the channel operationId: ActivateTemplate tags: - Template security: - transport_token: [] parameters: - $ref: '#/components/parameters/ChannelIdPath' requestBody: $ref: '#/components/requestBodies/ActivateTemplateRequest' responses: '200': $ref: '#/components/responses/EmptyResponse' default: $ref: '#/components/responses/ErrorResponse' /channels/{channel_id}/templates/{template_code}: delete: summary: Template deactivation description: Deactivates an existing message template for the channel operationId: DeactivateTemplate tags: - Template security: - transport_token: [] parameters: - $ref: '#/components/parameters/ChannelIdPath' - $ref: '#/components/parameters/TemplateCodePath' responses: '200': $ref: '#/components/responses/EmptyResponse' default: $ref: '#/components/responses/ErrorResponse' put: summary: Template update description: Updates an existing message template for the channel operationId: UpdateTemplate tags: - Template security: - transport_token: [] parameters: - $ref: '#/components/parameters/ChannelIdPath' - $ref: '#/components/parameters/TemplateCodePath' requestBody: $ref: '#/components/requestBodies/UpdateTemplateRequest' responses: '200': $ref: '#/components/responses/EmptyResponse' default: $ref: '#/components/responses/ErrorResponse' /templates: get: summary: List of templates description: Returns a list of available message templates for this transport operationId: GetTemplates tags: - Template security: - transport_token: [] responses: '200': $ref: '#/components/responses/TemplateListResponse' default: $ref: '#/components/responses/ErrorResponse' /messages: delete: summary: Deleting a message description: Deletes the created message if the channel supports such an operation operationId: DeleteMessage tags: - Message security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/DeleteMessageRequest' responses: '200': $ref: '#/components/responses/MessageResponse' default: $ref: '#/components/responses/ErrorResponse' post: summary: Sending a message description: Sends a message operationId: SendMessage tags: - Message security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/SendMessageRequest' responses: '200': $ref: '#/components/responses/SendMessageResponse' default: $ref: '#/components/responses/ErrorResponse' put: summary: Editing a message description: Modifies the created message if the channel supports such an operation operationId: EditMessage tags: - Message security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/EditMessageRequest' responses: '200': $ref: '#/components/responses/EmptyResponse' default: $ref: '#/components/responses/ErrorResponse' /messages/history: post: summary: Sending a history message description: Sends a history message operationId: SendHistoryMessage tags: - Message security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/SendHistoryMessageRequest' responses: '200': $ref: '#/components/responses/SendMessageResponse' default: $ref: '#/components/responses/ErrorResponse' /messages/ack: post: summary: Message delivery acknowledgment description: Acknowledges delivery status (success or error) of a message in an external system operationId: AckMessage tags: - Message security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/AckMessageRequest' responses: '200': $ref: '#/components/responses/EmptyResponse' default: $ref: '#/components/responses/ErrorResponse' /messages/read: post: summary: Mark messages as read up to a message description: Marks all messages in the chat as read up to the specified message operationId: MarkMessageRead tags: - Message security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/MarkMessageReadRequest' responses: '200': $ref: '#/components/responses/EmptyResponse' default: $ref: '#/components/responses/ErrorResponse' /messages/read_until: post: summary: Marking messages as read until a timestamp description: Marks all messages in the channel as read until the specified timestamp operationId: MarkMessagesReadUntil tags: - Message security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/MarkMessagesReadUntilRequest' responses: '200': $ref: '#/components/responses/MarkMessagesReadUntilResponse' default: $ref: '#/components/responses/ErrorResponse' /messages/restore: post: summary: Restoring a deleted message description: Restores a previously deleted message and returns it operationId: RestoreMessage tags: - Message security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/RestoreMessageRequest' responses: '200': $ref: '#/components/responses/MessageResponse' default: $ref: '#/components/responses/ErrorResponse' /messages/reaction: delete: summary: Remove a reaction from a message description: Removes a reaction from a message operationId: DeleteMessageReaction tags: - Message security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/DeleteReactionRequest' responses: '200': $ref: '#/components/responses/EmptyResponse' default: $ref: '#/components/responses/ErrorResponse' post: summary: Adding a reaction to a message description: Adds one of the channel's allowed reactions to a message operationId: AddMessageReaction tags: - Message security: - transport_token: [] requestBody: $ref: '#/components/requestBodies/AddReactionRequest' responses: '200': $ref: '#/components/responses/EmptyResponse' default: $ref: '#/components/responses/ErrorResponse' components: securitySchemes: transport_token: description: Token for authorization type: apiKey in: header name: X-Transport-Token parameters: IDQuery: description: Identifier of the requested object in: query name: id schema: format: int minimum: 1 type: integer LimitQuery: description: The number of elements in the response. Default value is 100 in: query name: limit schema: format: int maximum: 1000 minimum: 1 type: integer SinceQuery: description: Lower limit of the date of the last object update in: query name: since schema: format: date-time type: string UntilQuery: description: Upper limit of the date of the last object update in: query name: until schema: format: date-time type: string ChannelActiveQuery: description: Channel activity flag in: query name: active schema: $ref: '#/components/schemas/Boolean' ChannelTypeQuery: description: Channel types in: query name: types schema: items: $ref: '#/components/schemas/ChannelType' type: array ChannelIdPath: description: Channel identifier in: path name: channel_id required: true schema: format: int64 type: integer FileUUIDPath: description: File UUID in: path name: id required: true schema: type: string TemplateCodePath: description: Template code in: path name: template_code required: true schema: type: string schemas: Boolean: description: Boolean type type: string enum: - '1' - '0' - 'true' - 'false' Channel: description: Channel type: object properties: id: type: integer format: int64 example: 1 external_id: type: string example: ch2847 nullable: true name: type: string example: Example Channel nullable: true type: $ref: '#/components/schemas/ChannelType' is_active: type: boolean example: true settings: allOf: - $ref: '#/components/schemas/ChannelSettings' nullable: true created_at: type: string format: date-time example: 2006-01-02T15:04:05.999999Z07:00 updated_at: type: string format: date-time example: 2006-01-02T15:04:05.999999Z07:00 nullable: true activated_at: type: string format: date-time example: 2006-01-02T15:04:05.999999Z07:00 deactivated_at: type: string format: date-time example: 2006-01-02T15:04:05.999999Z07:00 nullable: true required: - id - type - created_at - activated_at - is_active ChannelType: description: Channel types type: string enum: - telegram - tiktok - fbmessenger - viber - whatsapp - skype - vk - instagram - consultant - yandex_chat - odnoklassniki - max - ozon - wildberries - yandex_market - mega_market - avito - drom - youla - custom example: telegram ChannelFeature: description: Support for operation with messages of the given type type: string enum: - none - receive - send - both example: both CustomerExternalId: description: Support for external customer identifiers type: string enum: - any - phone - uid example: phone AudioMessageSetting: description: Audio messages support type: object properties: creating: $ref: '#/components/schemas/ChannelFeature' deleting: $ref: '#/components/schemas/ChannelFeature' quoting: $ref: '#/components/schemas/ChannelFeature' reaction: $ref: '#/components/schemas/ChannelFeature' max_item_size: description: Maximum audio size to send format: int64 type: integer max_items_count: description: Maximum number of audio attachments per message format: int type: integer FileMessageSetting: description: File messages support type: object properties: creating: $ref: '#/components/schemas/ChannelFeature' deleting: $ref: '#/components/schemas/ChannelFeature' editing: $ref: '#/components/schemas/ChannelFeature' quoting: $ref: '#/components/schemas/ChannelFeature' reaction: $ref: '#/components/schemas/ChannelFeature' max_item_size: description: Maximum file size to send format: int64 type: integer max_items_count: description: Maximum number of file attachments per message format: int type: integer note_max_chars_count: description: Maximum number of characters in a file message annotation format: uint16 type: integer ImageMessageSetting: description: Media messages support type: object properties: creating: $ref: '#/components/schemas/ChannelFeature' deleting: $ref: '#/components/schemas/ChannelFeature' editing: $ref: '#/components/schemas/ChannelFeature' quoting: $ref: '#/components/schemas/ChannelFeature' reaction: $ref: '#/components/schemas/ChannelFeature' max_item_size: description: Maximum image size to send format: int64 type: integer max_items_count: description: Maximum number of media attachments per message format: int type: integer note_max_chars_count: description: Maximum number of characters in a media message annotation format: uint16 type: integer TextMessageSetting: description: Text messages support type: object properties: creating: $ref: '#/components/schemas/ChannelFeature' deleting: $ref: '#/components/schemas/ChannelFeature' editing: $ref: '#/components/schemas/ChannelFeature' quoting: $ref: '#/components/schemas/ChannelFeature' reaction: $ref: '#/components/schemas/ChannelFeature' max_chars_count: description: Maximum number of characters in a text message format: uint16 type: integer markup_formats: description: Supported text markup formats. Empty or absent list means markup is not supported. type: array items: $ref: '#/components/schemas/MarkupFormat' MarkupFormat: description: Supported text markup format type: string enum: - bold - italic - underline - strikethrough - inline_monospace - block_monospace - link example: bold OrderMessageSetting: description: Order messages support type: object properties: creating: $ref: '#/components/schemas/ChannelFeature' deleting: $ref: '#/components/schemas/ChannelFeature' editing: $ref: '#/components/schemas/ChannelFeature' reaction: $ref: '#/components/schemas/ChannelFeature' quoting: $ref: '#/components/schemas/ChannelFeature' ProductMessageSetting: description: Product messages support type: object properties: creating: $ref: '#/components/schemas/ChannelFeature' deleting: $ref: '#/components/schemas/ChannelFeature' editing: $ref: '#/components/schemas/ChannelFeature' reaction: $ref: '#/components/schemas/ChannelFeature' quoting: $ref: '#/components/schemas/ChannelFeature' StatusSetting: description: Transmitting message status information type: object properties: delivered: $ref: '#/components/schemas/ChannelFeature' read: $ref: '#/components/schemas/ChannelFeature' SendingPolicyAfterReplyTimeout: description: Types of messages to send after response time expires type: string enum: - 'no' - template example: 'no' SendingPolicyNewCustomer: description: Types of messages to send to a new customer type: string enum: - 'no' - template - text example: 'no' SendingPolicyOutgoing: description: Outgoing message support type: string enum: - allowed - restricted example: allowed SendingPolicy: description: Message sending policy type: object properties: after_reply_timeout: $ref: '#/components/schemas/SendingPolicyAfterReplyTimeout' new_customer: $ref: '#/components/schemas/SendingPolicyNewCustomer' outgoing: $ref: '#/components/schemas/SendingPolicyOutgoing' Suggestions: description: Support for quick response types type: object properties: email: $ref: '#/components/schemas/ChannelFeature' phone: $ref: '#/components/schemas/ChannelFeature' text: $ref: '#/components/schemas/ChannelFeature' url: $ref: '#/components/schemas/ChannelFeature' TemplateSetting: description: Support for message templates type: object properties: creation: description: Support for creating templates in the system example: true type: boolean sending: description: Support for sending templates from the system example: true type: boolean WAChannelQuality: description: WhatsApp channel quality type: string enum: - high - medium - low example: high WAChannelStatus: description: WhatsApp channel status type: string enum: - connected - flagged - offline - pending - restricted example: connected WAChannelProperties: description: WhatsApp channel properties type: object properties: channel_quality: allOf: - $ref: '#/components/schemas/WAChannelQuality' channel_status: allOf: - $ref: '#/components/schemas/WAChannelStatus' tier: format: int type: integer Reactions: description: Support for working with reactions for messages type: object properties: dictionary: description: Dictionary of available reactions type: array items: type: string max_count: description: Maximum number of reactions added from the system format: int64 type: integer ChannelSettings: description: Channel settings type: object properties: text: $ref: '#/components/schemas/TextMessageSetting' audio: $ref: '#/components/schemas/AudioMessageSetting' file: $ref: '#/components/schemas/FileMessageSetting' image: $ref: '#/components/schemas/ImageMessageSetting' order: $ref: '#/components/schemas/OrderMessageSetting' product: $ref: '#/components/schemas/ProductMessageSetting' customer_external_id: $ref: '#/components/schemas/CustomerExternalId' deferred_phone_template_send: description: Send phone template messages through deferred identity resolution type: boolean sending_policy: $ref: '#/components/schemas/SendingPolicy' status: $ref: '#/components/schemas/StatusSetting' suggestions: $ref: '#/components/schemas/Suggestions' template: $ref: '#/components/schemas/TemplateSetting' whatsapp: $ref: '#/components/schemas/WAChannelProperties' reactions: $ref: '#/components/schemas/Reactions' FileType: type: string description: File type enum: - none - image - video - file - audio example: file File: description: Uploaded file information type: object properties: id: description: UUID of the uploaded file example: 123e4567-e89b-12d3-a456-426614174000 format: uuid type: string size: description: File size (in bytes) example: 640 format: int type: integer Url: deprecated: true description: File download URL (legacy, use `url` instead) example: https://test.com/file/1 format: uri type: string url: description: File download URL example: https://test.com/file/1 format: uri type: string mime_type: description: MIME file type example: text/plain type: string type: $ref: '#/components/schemas/FileType' required: - id - type - size TemplateType: description: Template type type: string enum: - text - media example: text TemplateVerificationStatus: description: Template verification status type: string enum: - approved - pending - rejected - paused - disabled example: approved TemplateButtonType: description: Button type type: string enum: - plain - phone - url example: plain TemplateButton: description: Template button type: object properties: label: description: Button name type: string type: $ref: '#/components/schemas/TemplateButtonType' phone: type: string description: Phone number (for button type `phone`) url: type: string format: uri description: URL address (for button type `url`) required: - label - type TemplateButtons: description: List of template buttons type: object properties: items: type: array items: $ref: '#/components/schemas/TemplateButton' example: - label: Click me type: plain - label: Call us type: phone phone: '+1234567890' - label: Visit our website type: url url: https://example.com TemplateHeaderContentType: type: string description: Header section type enum: - text - document - image - video example: text TemplateHeaderContent: description: Template header content type: object properties: type: $ref: '#/components/schemas/TemplateHeaderContentType' body: description: Text content of the header section (for content type `text`) type: string required: - type TemplateHeader: description: Header section of the template type: object properties: content: allOf: - $ref: '#/components/schemas/TemplateHeaderContent' RejectReason: type: string description: Reason for template rejection (for `Rejected` status) enum: - abusive_content - incorrect_category - invalid_format - scam example: invalid_format TemplateBase: description: Template base type: object properties: body: description: Template body type: string example: 'Hello {{1}}! Your order #{{2}} for the amount of ${{3}} has been delivered to the pickup point. Thank you for your order!' nullable: true buttons: $ref: '#/components/schemas/TemplateButtons' category: description: Template category example: MARKETING type: string footer: description: Template footer example: foo bar type: string header: $ref: '#/components/schemas/TemplateHeader' lang: description: Template language type: string example: en name: description: Template name type: string example: test template maxLength: 512 minLength: 1 nullable: true rejection_reason: allOf: - $ref: '#/components/schemas/RejectReason' verification_status: allOf: - $ref: '#/components/schemas/TemplateVerificationStatus' template: type: array items: $ref: '#/components/schemas/TemplateItem' nullable: true quality: allOf: - $ref: '#/components/schemas/TemplateQuality' Template: description: Template type: object required: - id - code - channel_id - name - enabled - type - body - verification_status allOf: - $ref: '#/components/schemas/TemplateBase' - type: object properties: id: description: Template identifier example: 12 format: int64 type: integer nullable: true channel_id: description: Channel identifier example: 34 format: int64 type: integer nullable: true enabled: description: Template activity indicator example: true type: boolean nullable: true example: $ref: '#/components/schemas/TemplateExample' code: description: Template unique code example: DEMO_TEMPLATE maxLength: 512 minLength: 1 type: string nullable: true type: allOf: - $ref: '#/components/schemas/TemplateType' lang: description: Template language example: en type: string category: description: Template category example: MARKETING type: string rejection_reason: allOf: - $ref: '#/components/schemas/RejectReason' footer: description: Template footer example: foo bar type: string verification_status: allOf: - $ref: '#/components/schemas/TemplateVerificationStatus' TemplateItemType: description: Template item type type: integer format: uint8 enum: - 1 - 2 example: 1 TemplateVarType: description: Template variable type type: integer format: uint8 enum: - 0 - 1 - 2 - 3 example: 0 TemplateQuality: description: Template quality type: string enum: - pending - high - medium - low example: pending TemplateItem: description: Template item type: object properties: type: allOf: - $ref: '#/components/schemas/TemplateItemType' text: description: Text of the template item (for type `text`) type: string var: description: Template variable (for type `var`) allOf: - $ref: '#/components/schemas/TemplateVarType' TemplateExample: description: Template example type: object properties: attachments: description: Template attachments items: $ref: '#/components/schemas/TemplateExampleAttachment' maxLength: 1 type: array body: description: Array of example template body values example: - Max - e3459 - '328' items: type: string type: array buttons: description: Array of example template button values items: items: type: string type: array type: array header: description: Array of example values for the header section of the template example: - Alex items: type: string type: array TemplateExampleAttachment: description: Example of a template attachment type: object properties: id: description: UID of the uploaded file format: uuid type: string caption: description: Original file name maxLength: 1024 minLength: 1 type: string required: - id SendingErrorCode: description: Code representing possible sending error codes type: string enum: - general - customer_not_exists - reply_timed_out - spam_suspicion - access_restricted example: customer_not_exists SendingError: description: Details about the error that occurred during the sending process type: object properties: code: allOf: - $ref: '#/components/schemas/SendingErrorCode' external_code: description: External error code maxLength: 100 example: '130472' type: string message: description: Description of the error that occurred while sending example: demo message type: string UserType: type: string description: User type enum: - user - bot - customer - channel example: user UserRef: description: Details about a user type: object properties: id: description: User identifier example: 56 format: int64 type: integer available: description: User status indicator (for user of the user type only) example: false type: boolean avatar: description: User avatar example: https://avatar.demo/demo-avatar format: uri type: string email: description: User email (for customer type user only) example: demo@user.demo format: email type: string external_id: description: External identifier of a user example: eid3459 type: string first_name: description: User name (for customer and user types only) example: John type: string is_blocked: description: User blocking indicator (for customer type user only) example: false type: boolean is_system: description: System user indicator (for bot type user only) example: true type: boolean is_technical_account: description: Technical account indicator (for user of the user type only) example: false type: boolean last_name: description: User last name (for customer and user types only) example: Doe type: string name: description: User nickname example: John D. type: string phone: description: User phone number example: 541-392-2618 type: string type: $ref: '#/components/schemas/UserType' username: description: User name (for customer type user only) example: johndoe. type: string required: - id - external_id - type - name MessageType: description: Message type type: string enum: - text - system - command - order - product - file - image - audio example: text Histogram: type: array description: Sound diagram (for audio type messages only) example: - 1 - 34 - 23 - 4 - 32 - 34 - 23 - 12 - 93 - 4 items: format: int type: integer MessageFile: description: Attached message file type: object properties: id: description: UUID of the attached file example: c425d178-eb6f-11ec-8ea0-0242ac120002 format: uuid type: string caption: description: Text description of the media attachment example: demo caption type: string duration: description: Audio recording duration (for audio type messages only) example: 345 format: int type: integer size: description: Attachment size (in bytes) example: 34534 format: int type: integer height: description: Image height in pixels (for image type messages only) example: 1080 format: int type: integer width: description: Image width in pixels (for image type messages only) example: 1920 format: int type: integer histogram: allOf: - $ref: '#/components/schemas/Histogram' kind: allOf: - $ref: '#/components/schemas/FileType' preview_url: description: URL for previewing or downloading the file example: https://url.demo/demo-url format: uri type: string transcription: type: string description: Transcription of the uploaded file example: Sample transcription type: description: Attachment type example: application/pdf type: string QuoteMessage: description: Quoted message type: object properties: id: description: Identifier of the quoted message example: 45 format: int64 type: integer content: description: Message text example: quote content type: string from: $ref: '#/components/schemas/UserRef' items: description: Media attachments of the quoted message items: $ref: '#/components/schemas/MessageFile' type: array time: description: Message sending time example: '2021-12-29T14:18:41Z' format: date-time type: string type: allOf: - $ref: '#/components/schemas/MessageType' TextMessage: description: Text message type: object properties: content: description: Message text example: hi there type: string quote: $ref: '#/components/schemas/QuoteMessage' MessageScope: description: Message scope type: string enum: - undefined - public - private example: public MessageStatus: type: string description: Message status enum: - undefined - received - sending - sent - failed - seen example: seen MessageDialog: description: Message dialog type: object properties: id: description: Dialog identifier example: 9 format: int64 type: integer required: - id MessageErrorCode: description: Message error code type: string enum: - unknown - network_error - malformed_response - async_send_timeout - general - customer_not_exists - reply_timed_out - spam_suspicion - access_restricted example: malformed_response MessageError: description: Message error details (only for messages with status `failed`) type: object properties: code: allOf: - $ref: '#/components/schemas/MessageErrorCode' message: description: Text description of error example: error malformed response type: string required: - code SuggestionType: type: string description: Quick response type enum: - text - email - phone - url example: phone Suggestion: description: Quick response suggestion type: object properties: payload: description: Quick response payload example: https://demo-payload.demo type: string title: description: Quick response name example: phone number type: string type: allOf: - $ref: '#/components/schemas/SuggestionType' MessageTransportAttachments: description: Transport attachments properties: suggestions: description: Quick responses items: $ref: '#/components/schemas/Suggestion' type: array type: object MessageOrderDelivery: description: Order delivery information type: object properties: address: description: Delivery address example: 2641 Webster St Berkeley, California(CA), 94705 type: string comment: description: Delivery comment example: demo delivery comment type: string name: description: Delivery method name example: dhl type: string price: $ref: '#/components/schemas/Cost' MessageOrderItem: description: Order product type: object properties: external_id: description: External identifier of a product example: 45 format: int64 type: integer img: description: Product image example: https://order-image.demo/demo-order-image format: uri maxLength: 2048 type: string name: description: Product name example: demo order item maxLength: 255 type: string price: $ref: '#/components/schemas/Cost' quantity: allOf: - $ref: '#/components/schemas/Quantity' url: description: Product URL example: https://order-item.demo/demo-order-item format: uri maxLength: 2048 type: string MessageOrderPayment: description: Order payment information type: object properties: amount: $ref: '#/components/schemas/Cost' name: description: Payment name example: paid type: string status: $ref: '#/components/schemas/MessageOrderPaymentStatus' MessageOrderPaymentStatus: description: Order payment status type: object properties: name: description: Payment name example: demo-payment-status type: string payed: description: Payment execution indicator example: true type: boolean MessageOrderStatusCode: description: Status code type: string enum: - new - approval - assembling - delivery - complete - cancel example: approval MessageOrderStatus: description: Order status properties: code: allOf: - $ref: '#/components/schemas/MessageOrderStatusCode' name: description: Status name example: approval maxLength: 255 type: string Quantity: description: Quantity type: object properties: unit: description: Units of measure example: pcs maxLength: 16 type: string value: description: Quantitative value example: 5 format: double minimum: 0 type: number Cost: description: Represents a monetary value with its corresponding currency type: object properties: currency: description: Currency code maxLength: 3 minLength: 3 type: string value: description: Numerical value of the cost example: 256 format: double minimum: 0 type: number required: - currency - value MessageOrder: description: Represents the details of an order within a message type: object properties: external_id: description: External identifier of an order example: 56 format: int64 type: integer cost: $ref: '#/components/schemas/Cost' date: description: Order creation date example: '2021-12-29T14:18:37.051393Z' format: date-time type: string delivery: $ref: '#/components/schemas/MessageOrderDelivery' discount: $ref: '#/components/schemas/Cost' items: description: Array of order items items: $ref: '#/components/schemas/MessageOrderItem' type: array number: description: Order number example: '23546' maxLength: 255 type: string payments: description: Payments array items: $ref: '#/components/schemas/MessageOrderPayment' type: array status: $ref: '#/components/schemas/MessageOrderStatus' url: description: Order URL example: https://url.demo/demo-url format: uri maxLength: 2048 type: string MessageProduct: description: Describes a product mentioned in a message type: object properties: id: description: Product identifier example: 56 format: uint64 type: integer article: description: Product description example: 324-DFT-495 maxLength: 128 type: string cost: $ref: '#/components/schemas/Cost' img: description: Product image URL example: https://image.demo/demo-image format: uri maxLength: 2048 type: string name: type: string description: Product name example: demo product maxLength: 255 minLength: 1 unit: description: Units of measure of the product maxLength: 16 type: string url: description: Product URL example: https://product.demo/demo-product format: uri maxLength: 2048 type: string required: - id - name MessageAction: description: Defines possible actions that can be performed on a message type: string enum: - edit - delete - quote example: edit SystemAction: description: System action of the message (for system type messages only) type: string enum: - dialog_opened - dialog_closed - user_joined - user_left - dialog_assign - customer_blocked - customer_unblocked - dialog_unassign - dialog_tag_added - dialog_tag_removed example: user_joined SystemMessage: description: Represents system-generated events in messaging type: object properties: action: $ref: '#/components/schemas/SystemAction' responsible: $ref: '#/components/schemas/UserRef' user: $ref: '#/components/schemas/UserRef' required: - action Message: description: Contains details of a message allOf: - $ref: '#/components/schemas/TextMessage' - $ref: '#/components/schemas/SystemMessage' - properties: id: description: Message identifier example: 45 format: int64 type: integer actions: description: Actions available for this message items: $ref: '#/components/schemas/MessageAction' type: array chat_id: description: Chat identifier example: 56 format: int64 type: integer dialog: $ref: '#/components/schemas/MessageDialog' error: $ref: '#/components/schemas/MessageError' from: $ref: '#/components/schemas/UserRef' is_edit: description: Message editing indicator example: false type: boolean is_read: description: Message read indicator example: true type: boolean items: items: $ref: '#/components/schemas/MessageFile' type: array note: description: Media data annotation (for media message) example: demo note type: string order: $ref: '#/components/schemas/MessageOrder' product: $ref: '#/components/schemas/MessageProduct' scope: $ref: '#/components/schemas/MessageScope' status: $ref: '#/components/schemas/MessageStatus' time: description: Message creation time example: '2022-05-30T22:28:55Z' format: date-time type: string transport_attachments: $ref: '#/components/schemas/MessageTransportAttachments' type: $ref: '#/components/schemas/MessageType' required: - id - time - type - scope - chat_id - is_read - is_edit - status type: object Originator: type: string description: Message sender type enum: - customer - channel - user example: customer Utm: description: UTM parameters for tracking marketing campaigns type: object properties: campaign: description: Campaign example: spring_sale maxLength: 255 minLength: 1 type: string content: description: Ad content example: textlink maxLength: 255 minLength: 1 type: string medium: description: Medium example: cpc maxLength: 255 minLength: 1 type: string source: description: Source example: Google maxLength: 255 minLength: 1 type: string term: description: Keyword example: running maxLength: 255 minLength: 1 type: string SendMessageRequestCustomer: description: Contains information about the customer sending a message type: object properties: avatar: description: Sender avatar URL example: https://avatar.demo/customer-avatar format: uri type: string country: description: Sender country code example: US type: string email: description: Sender email example: customer@customer.demo format: email type: string external_id: description: External identifier of the sender example: cs9109 maxLength: 64 minLength: 1 type: string secondary_external_ids: description: Array of additional external customer identifiers items: type: string type: array first_name: description: Sender name example: John type: string language: description: Sender language example: en type: string last_name: description: Sender last name example: Doe type: string nickname: description: Sender nickname example: John Doe maxLength: 255 minLength: 1 type: string phone: description: Sender phone example: '+14844578894' type: string profile_url: description: Sender profile URL example: https://profile.demo/customer-profile format: uri type: string utm: allOf: - $ref: '#/components/schemas/Utm' required: - external_id - nickname SendMessageRequestMessageFileItem: description: Represents a file attachment in a message properties: caption: description: Description of the message media attachment maxLength: 1024 minLength: 1 type: string id: description: UUID of the uploaded file format: uuid type: string required: - id SendMessageRequestMessage: description: Defines the message content in a sending request type: object properties: text: description: Message text example: demo text maxLength: 65535 minLength: 1 type: string product: allOf: - $ref: '#/components/schemas/MessageProduct' order: allOf: - $ref: '#/components/schemas/MessageOrder' items: description: List of media objects in a message items: $ref: '#/components/schemas/SendMessageRequestMessageFileItem' type: array note: description: Message description (for messages with media data) maxLength: 64000 minLength: 1 type: string created_at: description: Message creation date example: '2021-08-02T10:11:12' format: date-time type: string external_id: description: External identifier of a message example: m45418 maxLength: 255 type: string page_link: description: Link to the page from which the message was sent example: https://our.local.site/product/1 type: string type: allOf: - $ref: '#/components/schemas/MessageType' required: - type - text - items EditMessageRequestMessage: description: Defines the message content in a editing request allOf: - $ref: '#/components/schemas/MessageIdentifier' - type: object properties: edited_at: description: Date and time of last update of message example: 1652767093 format: int64 type: integer page_link: description: Link to the page from which the message was sent example: https://our.local.site/product/1 type: string text: description: Message text example: Lorem Ipsum maxLength: 65535 minLength: 1 type: string required: - text MessageIdentifier: description: Message identifier type: object properties: id: description: Message identifier in MessageGateway example: 45 format: int64 type: integer external_id: description: External identifier of the message example: rm2884 maxLength: 255 type: string AckMessageCustomer: description: Customer identity resolved by transport while acknowledging a deferred outgoing message type: object properties: external_id: description: Primary external customer identifier example: RU.1545487730617822 maxLength: 64 minLength: 1 type: string secondary_external_ids: description: Additional customer identifiers, for example wa_id items: type: string type: array phone: description: Customer phone number if known example: '79604598479' maxLength: 16 type: string first_name: description: Customer first name type: string last_name: description: Customer last name type: string avatar: description: Customer avatar URL format: uri type: string profile_url: description: Customer profile URL format: uri type: string country: description: Customer country code type: string language: description: Customer language type: string email: description: Customer email format: email type: string required: - external_id AckMessageChat: description: Chat identity resolved by transport while acknowledging a deferred outgoing message type: object properties: external_id: description: Primary external chat identifier example: RU.1545487730617822 maxLength: 64 minLength: 1 type: string secondary_external_ids: description: Additional external chat identifiers items: type: string type: array required: - external_id requestBodies: ActivateChannelRequest: description: Channel activation request content: application/json: schema: type: object properties: id: description: Channel identifier example: 146 format: int64 minimum: 0 type: integer external_id: description: External identifier of a channel example: ac3249 maxLength: 64 type: string name: description: Channel name example: demo channel maxLength: 100 type: string avatar_url: description: Channel avatar URL example: https://avatar.demo/avatar format: uri maxLength: 255 type: string settings: $ref: '#/components/schemas/ChannelSettings' type: allOf: - $ref: '#/components/schemas/ChannelType' required: - id - type UpdateChannelRequest: description: Channel update request content: application/json: schema: type: object properties: external_id: description: External identifier example: ac3249 maxLength: 64 type: string name: description: Channel name example: demo channel maxLength: 100 type: string avatar_url: description: Channel avatar URL example: https://avatar.demo/avatar maxLength: 255 type: string settings: $ref: '#/components/schemas/ChannelSettings' type: allOf: - $ref: '#/components/schemas/ChannelType' UploadFileByUrlRequest: description: Upload file by URL content: application/json: schema: type: object properties: url: description: Upload source URL example: https://url.demo/demo-url format: uri type: string required: - url ActivateTemplateRequest: description: Request to activate a new template content: application/json: schema: allOf: - $ref: '#/components/schemas/TemplateBase' - type: object properties: code: description: Template unique code example: DEMO_TEMPLATE maxLength: 512 minLength: 1 type: string type: allOf: - $ref: '#/components/schemas/TemplateType' required: - name - code - type UpdateTemplateRequest: description: Request to update an existing template content: application/json: schema: allOf: - $ref: '#/components/schemas/TemplateBase' - type: object properties: verification_status: allOf: - $ref: '#/components/schemas/TemplateVerificationStatus' required: - name - verification_status AckMessageRequest: description: Request for acknowledging message delivery status content: application/json: schema: type: object properties: channel: description: Sending channel identifier example: 92 format: int64 type: integer created_at: description: Date and time of sending example: '2021-08-02T10:11:12' format: date-time type: string error: allOf: - $ref: '#/components/schemas/SendingError' customer: allOf: - $ref: '#/components/schemas/AckMessageCustomer' chat: allOf: - $ref: '#/components/schemas/AckMessageChat' external_message_id: deprecated: true description: External identifier of a message example: em3948 type: string transport_message_id: description: Message identifier in transport example: ydi73-end72-lkmxd-k2en8-827bs maxLength: 255 type: string message: $ref: '#/components/schemas/MessageIdentifier' required: - channel MarkMessageReadRequest: description: Request for mark message read content: application/json: schema: type: object properties: channel_id: description: Identifier of the sending channel example: 92 format: int64 type: integer message: allOf: - $ref: '#/components/schemas/MessageIdentifier' required: - message - channel_id MarkMessagesReadUntilRequest: description: Request for mark message read until some datetime content: application/json: schema: type: object properties: channel_id: description: Channel identifier example: 145 format: int64 minimum: 1 type: integer customer_external_id: description: Customer external identifier example: cs9109 type: string until: description: Read until date example: '2022-10-15T23:20:50.52Z' format: date-time type: string required: - customer_external_id - channel_id - until RestoreMessageRequest: description: Request for restore message content: application/json: schema: type: object properties: channel_id: description: Identifier of the sending channel example: 92 format: int64 type: integer message: allOf: - $ref: '#/components/schemas/MessageIdentifier' required: - message - channel_id SendMessageRequest: description: Request for sending message content: application/json: schema: type: object properties: channel: description: Channel identifier example: 618 format: int64 type: integer customer: allOf: - $ref: '#/components/schemas/SendMessageRequestCustomer' external_chat_id: description: External identifier example: c7832 maxLength: 64 type: string message: allOf: - $ref: '#/components/schemas/SendMessageRequestMessage' originator: allOf: - $ref: '#/components/schemas/Originator' quote: allOf: - $ref: '#/components/schemas/MessageIdentifier' reply_deadline: description: Deadline for response example: '2021-08-02T10:11:12' format: date-time type: string secondary_external_chat_ids: description: Array of additional external chat identifiers items: type: string type: array user: deprecated: true allOf: - $ref: '#/components/schemas/SendMessageRequestCustomer' required: - message - channel DeleteMessageRequest: description: Request for delete message content: application/json: schema: properties: channel: description: Channel identifier example: 88 format: int64 type: integer message: allOf: - $ref: '#/components/schemas/MessageIdentifier' required: - message - channel EditMessageRequest: description: Request for edit message content: application/json: schema: type: object properties: channel: description: Message channel example: 46 format: int64 type: integer message: allOf: - $ref: '#/components/schemas/EditMessageRequestMessage' required: - message - channel SendHistoryMessageRequest: description: Request for send history message content: application/json: schema: type: object properties: channel_id: description: Channel identifier example: 618 format: int64 type: integer customer: allOf: - $ref: '#/components/schemas/SendMessageRequestCustomer' external_chat_id: description: External identifier example: c7832 maxLength: 64 type: string message: allOf: - $ref: '#/components/schemas/SendMessageRequestMessage' originator: allOf: - $ref: '#/components/schemas/Originator' quote: allOf: - $ref: '#/components/schemas/MessageIdentifier' reply_deadline: description: Deadline for response example: '2021-08-02T10:11:12' format: date-time type: string required: - message - channel_id AddReactionRequest: description: Request for add reaction content: application/json: schema: type: object properties: channel: description: Sending channel identifier example: 88 format: int64 type: integer message: allOf: - $ref: '#/components/schemas/MessageIdentifier' reaction: description: Removable reaction type: string required: - message - channel - reaction DeleteReactionRequest: description: Request for delete reaction content: application/json: schema: type: object properties: channel: description: Sending channel identifier example: 88 format: int64 type: integer message: allOf: - $ref: '#/components/schemas/MessageIdentifier' reaction: description: Removable reaction type: string required: - message - channel responses: EmptyResponse: description: Success content: application/json: schema: type: object properties: {} ErrorResponse: description: Error response content: application/json: schema: properties: errors: description: List of errors items: type: string type: array type: object ChannelsListResponse: description: List of channels content: application/json: schema: type: array items: $ref: '#/components/schemas/Channel' ActivateChannelResponse: description: Activated channel content: application/json: schema: type: object properties: id: description: Channel identifier example: 34 format: int64 type: integer activated_at: description: Date and time of channel activation example: 2006-01-02T15:04:05Z07:00 format: date-time type: string required: - id - activated_at DeactivateChannelResponse: description: Deactivated channel content: application/json: schema: type: object properties: id: description: Identifier of the deactivated channel example: 34 format: int64 type: integer deactivated_at: description: Date and time of channel deactivation example: 2006-01-02T15:04:05Z07:00 format: date-time type: string required: - id - deactivated_at UpdateChannelResponse: description: Updated channel content: application/json: schema: type: object properties: id: description: Channel identifier example: 23 format: int64 type: integer updated_at: description: Date and time of last update example: 2006-01-02T15:04:05Z07:00 format: date-time type: string required: - id - updated_at FileResponse: description: File information content: application/json: schema: $ref: '#/components/schemas/File' TemplateListResponse: description: List of templates content: application/json: schema: items: $ref: '#/components/schemas/Template' type: array MarkMessagesReadUntilResponse: description: List of message ids that marks read content: application/json: schema: type: object properties: ids: description: Identifiers of messages marked as read items: format: int64 type: integer type: array required: - ids MessageResponse: description: Message information content: application/json: schema: $ref: '#/components/schemas/Message' SendMessageResponse: description: Information about sent message content: application/json: schema: type: object properties: message_id: description: Identifier of the created message example: 34 format: int64 type: integer time: description: Message creation time example: '2021-08-02T10:11:12' format: date-time type: string warnings: description: Warnings that occurred while creating a message items: type: string type: array required: - message_id - time