Qpien Api Docs
Help centerMain website
Help centerMain website
  1. Modules
  • Overview
  • Custom channel
  • Get started
    • Authentication
    • Scopes
  • Modules
    • Contacts
    • CustomerPersons
    • Conversations
    • Messages
    • Channels
    • WhatsappBusinessTemplates
    • SendMessages
  • Webhooks
    • Webhook
  • Custom
    • Custom channel
  1. Modules

Messages

Messages

Description#

The Messages module provides access to messages exchanged within conversations. You can retrieve individual messages or lists of messages and also create new messages programmatically.

Entity Model#

ExternalMessage#

FieldTypeDescription
_idIDUnique identifier of the message.
sendersenderDataInformation about the sender of the message.
conversationIDConversation this message belongs to.
messageTypeMessageTypeType of the message (e.g., text, image, email).
channelTypeChannelTypeChannel through which the message was sent (e.g., WhatsApp, Email).
senderTypeSenderTypeIndicates if the sender is a user, system, or bot.
contentStringPlain text content of the message.
contentHtmlStringHTML-formatted content.
subjectStringSubject of the message (mainly for email).
emailDataEmailDataTypeEmail-related metadata.
commentDataCommentDataTypeComment-related metadata.
questionDataQuestionDataTypeQuestion-related metadata.
media[Media]Attached media (images, videos, files).
template_cardsObjectTemplate cards associated with the message.
product_cardsObjectProduct cards included in the message.
channelMessageIdStringIdentifier of the message in the external channel.
ackStatusAckTypeDelivery status acknowledgment.
createdAtDateTimestamp of when the message was created.
autoCreateBooleanIndicates if the message was auto-generated.
failedReasonFailedReasonTypeReason for delivery failure, if applicable.
surveyDatasurveyDataForLivechatSurvey data for live chat interactions.
informativeButtonsInformativeButtonsTypeInformative buttons included in the message.
flowBotQuickReplyResponseIdStringIdentifier for flow bot quick reply response.
flowBotQuickReplyButtonsRequiredBooleanIndicates if quick reply buttons are required.
flowBotQuickReply[FlowBotQuickReplyType]Flow bot quick reply options.
quotedMessageQuotedMessageTypeReference to the quoted message, if any.
reactionsReactionEnumReactions to the message.
frontMsgIdStringFrontend message ID.
listMessageListMessageTypeList-type interactive message data.
catalogMessageCatalogInteractiveTypeCatalog message data.
catalogOrderDataCatalogOrderDataTypeOrder details for catalog messages.

Queries#

Get Message#

Use this query to get single message.
Input:
Response:

Get Message List#

Use this query to get message lists for the conversation.
Input:
Response:

Mutations#

Create Message#

Use this mutation to create a new message
Input:
COMMENT message type requirements:
When msgType is COMMENT, this mutation replies to an existing comment message. It does not create a standalone comment record. The existing message is updated with reply information in commentData.
FieldDescription
msgTypeMust be COMMENT.
msgIdQpien internal _id of the original comment message to reply to.
senderCustomer person / agent _id that sends the reply.
contentReply text that will be sent to the external platform.
convIdConversation _id that contains the original comment message.
pChannelIdPerson channel _id for the customer/person in the conversation.
channelIdConnected platform/channel _id.
channelTypeChannel type, for example INSTAGRAM.
isTicketSet to false unless the reply is part of a ticket flow.
Important: msgId must be the internal message _id, not the platform channelMessageId.
PRIVATE_REPLY message type requirements:
When msgType is PRIVATE_REPLY, this mutation sends a private message reply for an existing public comment message. The target comment message is updated with private-reply information in commentData, and the created message is returned with messageType: PRIVATE_REPLY.
FieldDescription
msgTypeMust be PRIVATE_REPLY.
msgIdQpien internal _id of the original comment message to privately reply to.
senderCustomer person / agent _id that sends the private reply.
contentPrivate reply text that will be sent to the external platform.
convIdConversation _id that contains the original comment message.
pChannelIdPerson channel _id for the customer/person in the conversation.
channelIdConnected platform/channel _id.
channelTypeSupported channel type: FACEBOOK, INSTAGRAM, or TIKTOK.
isTicketSet to false unless the private reply is part of a ticket flow.
Important: msgId must be the internal message _id of an existing COMMENT message, not the platform channelMessageId. Only one private reply can be sent for a comment.
Response:

Create Message By Whatsapp#

Use this mutation to create a new message by WhatsApp
Input:
Response:

Example Usage#

Query Example — Get Message List#

Bash (cURL)
Node.js

Mutation Example — Create Message#

Bash (cURL)
Node.js

Mutation Example — Create Comment Reply Message#

Use externalCreateMessage with msgType: "COMMENT" to reply to an existing comment message. The msgId value must be the Qpien internal _id of the original comment message.
Bash (cURL)
Node.js

Mutation Example — Create Private Reply Message#

Use externalCreateMessage with msgType: "PRIVATE_REPLY" to send a private reply to an existing public comment message. The msgId value must be the Qpien internal _id of the original comment message.
Bash (cURL)
Node.js
Modified at 2026-07-18 07:53:17
Previous
Conversations
Next
Channels
Built with