> For the complete documentation index, see [llms.txt](https://docs.chatcaptain.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatcaptain.com/api/api-dokumentation/conversation-messages.md).

# Conversation messages

## Lists all messages for a conversation

> \
> \
> \*\*Required Permission:\*\* \`chatbots.messages.list\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Conversation messages","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/conversations/{conversationId}/messages":{"get":{"operationId":"ConversationMessageController_listMessages[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"conversationId","required":true,"in":"path","description":"The ID of the conversation.","schema":{"type":"string"}}],"responses":{"200":{"description":"A list of all messages in the conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMessagesResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Lists all messages for a conversation","tags":["Conversation messages"],"description":"\n\n**Required Permission:** `chatbots.messages.list`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"ListMessagesResponseDto":{"type":"object","properties":{"messages":{"description":"The list of messages.","type":"array","items":{"$ref":"#/components/schemas/MessageDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["messages"]},"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string"},"file":{"$ref":"#/components/schemas/MessageContentFileDto"},"buttons":{"$ref":"#/components/schemas/MessageContentButtonsDto"},"selectedButton":{"$ref":"#/components/schemas/MessageContentButtonReplyDto"},"template":{"$ref":"#/components/schemas/MessageTemplateDto"},"contact":{"$ref":"#/components/schemas/MessageContentContactDto"},"location":{"$ref":"#/components/schemas/MessageLocationDto"},"note":{"$ref":"#/components/schemas/MessageNoteDto"},"voiceHangup":{"$ref":"#/components/schemas/MessageVoiceHangupDto"},"voiceTransfer":{"$ref":"#/components/schemas/MessageVoiceTransferDto"},"agentHandover":{"$ref":"#/components/schemas/MessageAgentHandoverDto"},"email":{"$ref":"#/components/schemas/MessageContentEmailDto"},"transcription":{"$ref":"#/components/schemas/MessageContentTranscriptionDto"},"textToSpeech":{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"},"reaction":{"$ref":"#/components/schemas/MessageContentReactionDto"},"callSettings":{"$ref":"#/components/schemas/MessageContentCallSettingsDto"},"metaWhatsappTemplate":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"},"operator":{"$ref":"#/components/schemas/OperatorDto"},"delay":{"type":"number"},"leadAiId":{"type":"string"}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"type":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"},"attachmentRef":{"type":"string"},"caption":{"type":"string"},"transcript":{"type":"string"}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"payload":{"type":"string"}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"payload":{"type":"string"},"type":{"type":"string"},"reference":{"type":"string"}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string"},"header":{"type":"string"},"footer":{"type":"string"}},"required":["body"]},"MessageContentContactDto":{"type":"object","properties":{"addresses":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactAddressDto"}},"emails":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactEmailDto"}},"name":{"$ref":"#/components/schemas/MessageContentContactNameDto"},"org":{"$ref":"#/components/schemas/MessageContentContactOrgDto"},"phones":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactPhoneDto"}}},"required":["addresses","emails","phones"]},"MessageContentContactAddressDto":{"type":"object","properties":{"city":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":"string"},"street":{"type":"string"},"type":{"type":"string"},"zip":{"type":"string"}}},"MessageContentContactEmailDto":{"type":"object","properties":{"email":{"type":"string","format":"email"},"type":{"type":"string"}},"required":["email"]},"MessageContentContactNameDto":{"type":"object","properties":{"firstName":{"type":"string"},"formattedName":{"type":"string"},"lastName":{"type":"string"}}},"MessageContentContactOrgDto":{"type":"object","properties":{"company":{"type":"string"},"title":{"type":"string"}}},"MessageContentContactPhoneDto":{"type":"object","properties":{"phone":{"type":"string"},"type":{"type":"string"},"waId":{"type":"string"}}},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["latitude","longitude"]},"MessageNoteDto":{"type":"object","properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"string"}}},"required":["text","mentions"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string"},"reason":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string"},"timeoutSeconds":{"type":"number"},"agentId":{"type":"string"},"groupId":{"type":"string"},"assignmentMethod":{"type":"string"}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string"},"body":{"type":"string"},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"attachmentIds":{"type":"array","items":{"type":"string"}},"references":{"type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTranscriptionDto":{"type":"object","properties":{"text":{"type":"string"},"language":{"type":"string"},"audioRef":{"type":"string"}},"required":["text","language","audioRef"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string"},"speech":{"type":"string"}},"required":["text"]},"MessageContentReactionDto":{"type":"object","properties":{"reactionToMid":{"type":"string"},"action":{"type":"string"},"reaction":{"type":"string"},"emoji":{"type":"string"}},"required":["reactionToMid","action","reaction","emoji"]},"MessageContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number"},"dtmf":{"type":"boolean"},"bargeIn":{"type":"boolean"}}},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attachment for the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"List of parameter values for header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL to access the file."},"type":{"type":"string","description":"The file type category."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The internal attachment reference ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The button type (e.g., QUICK_REPLY, URL, PHONE_NUMBER)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick reply buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## Creates a new message in a conversation

> \
> \
> \*\*Required Permission:\*\* \`chatbots.messages.create\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Conversation messages","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/conversations/{conversationId}/messages":{"post":{"operationId":"ConversationMessageController_createConversationMessage[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"conversationId","required":true,"in":"path","description":"The ID of the conversation.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageRequestDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Creates a new message in a conversation","tags":["Conversation messages"],"description":"\n\n**Required Permission:** `chatbots.messages.create`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"CreateMessageRequestDto":{"type":"object","properties":{"disableSending":{"type":"boolean","description":"Whether to skip sending the message to the channel."},"message":{"description":"The message data to create.","allOf":[{"$ref":"#/components/schemas/CreateMessageDto"}]}},"required":["disableSending","message"]},"CreateMessageDto":{"type":"object","properties":{"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"sender":{"type":"string","description":"The sender type.","enum":["agent","bot","user"]},"type":{"type":"string","description":"The type of message content."},"persona":{"description":"The persona used for this message.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created (ISO format)."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received."},"read":{"type":"string","description":"Timestamp when the message was read."},"outgoing":{"type":"boolean","description":"Whether this is an outgoing message from the bot/operator."},"contextId":{"type":"string","description":"The context ID for message threading."},"messengerId":{"type":"string","description":"The messenger-specific ID."},"author":{"type":"string","description":"The author of the message (operator ID)."},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive data."},"leadAiId":{"type":"string","description":"The Lead AI ID associated with this message."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending."}},"required":["content","sender","type","status","created","outgoing"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string"},"file":{"$ref":"#/components/schemas/MessageContentFileDto"},"buttons":{"$ref":"#/components/schemas/MessageContentButtonsDto"},"selectedButton":{"$ref":"#/components/schemas/MessageContentButtonReplyDto"},"template":{"$ref":"#/components/schemas/MessageTemplateDto"},"contact":{"$ref":"#/components/schemas/MessageContentContactDto"},"location":{"$ref":"#/components/schemas/MessageLocationDto"},"note":{"$ref":"#/components/schemas/MessageNoteDto"},"voiceHangup":{"$ref":"#/components/schemas/MessageVoiceHangupDto"},"voiceTransfer":{"$ref":"#/components/schemas/MessageVoiceTransferDto"},"agentHandover":{"$ref":"#/components/schemas/MessageAgentHandoverDto"},"email":{"$ref":"#/components/schemas/MessageContentEmailDto"},"transcription":{"$ref":"#/components/schemas/MessageContentTranscriptionDto"},"textToSpeech":{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"},"reaction":{"$ref":"#/components/schemas/MessageContentReactionDto"},"callSettings":{"$ref":"#/components/schemas/MessageContentCallSettingsDto"},"metaWhatsappTemplate":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"},"operator":{"$ref":"#/components/schemas/OperatorDto"},"delay":{"type":"number"},"leadAiId":{"type":"string"}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"type":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"},"attachmentRef":{"type":"string"},"caption":{"type":"string"},"transcript":{"type":"string"}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"payload":{"type":"string"}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"payload":{"type":"string"},"type":{"type":"string"},"reference":{"type":"string"}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string"},"header":{"type":"string"},"footer":{"type":"string"}},"required":["body"]},"MessageContentContactDto":{"type":"object","properties":{"addresses":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactAddressDto"}},"emails":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactEmailDto"}},"name":{"$ref":"#/components/schemas/MessageContentContactNameDto"},"org":{"$ref":"#/components/schemas/MessageContentContactOrgDto"},"phones":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactPhoneDto"}}},"required":["addresses","emails","phones"]},"MessageContentContactAddressDto":{"type":"object","properties":{"city":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":"string"},"street":{"type":"string"},"type":{"type":"string"},"zip":{"type":"string"}}},"MessageContentContactEmailDto":{"type":"object","properties":{"email":{"type":"string","format":"email"},"type":{"type":"string"}},"required":["email"]},"MessageContentContactNameDto":{"type":"object","properties":{"firstName":{"type":"string"},"formattedName":{"type":"string"},"lastName":{"type":"string"}}},"MessageContentContactOrgDto":{"type":"object","properties":{"company":{"type":"string"},"title":{"type":"string"}}},"MessageContentContactPhoneDto":{"type":"object","properties":{"phone":{"type":"string"},"type":{"type":"string"},"waId":{"type":"string"}}},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["latitude","longitude"]},"MessageNoteDto":{"type":"object","properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"string"}}},"required":["text","mentions"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string"},"reason":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string"},"timeoutSeconds":{"type":"number"},"agentId":{"type":"string"},"groupId":{"type":"string"},"assignmentMethod":{"type":"string"}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string"},"body":{"type":"string"},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"attachmentIds":{"type":"array","items":{"type":"string"}},"references":{"type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTranscriptionDto":{"type":"object","properties":{"text":{"type":"string"},"language":{"type":"string"},"audioRef":{"type":"string"}},"required":["text","language","audioRef"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string"},"speech":{"type":"string"}},"required":["text"]},"MessageContentReactionDto":{"type":"object","properties":{"reactionToMid":{"type":"string"},"action":{"type":"string"},"reaction":{"type":"string"},"emoji":{"type":"string"}},"required":["reactionToMid","action","reaction","emoji"]},"MessageContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number"},"dtmf":{"type":"boolean"},"bargeIn":{"type":"boolean"}}},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attachment for the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"List of parameter values for header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL to access the file."},"type":{"type":"string","description":"The file type category."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The internal attachment reference ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The button type (e.g., QUICK_REPLY, URL, PHONE_NUMBER)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick reply buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"MessageResponseDto":{"type":"object","properties":{"message":{"description":"The message.","allOf":[{"$ref":"#/components/schemas/MessageDto"}]},"error":{"type":"string","description":"Optional error message."}}},"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]}}}}
```

## Retrieves a specific message

> \
> \
> \*\*Required Permission:\*\* \`chatbots.messages.get\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Conversation messages","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/conversations/{conversationId}/messages/{messageId}":{"get":{"operationId":"ConversationMessageController_getConversationMessage[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"conversationId","required":true,"in":"path","description":"The ID of the conversation.","schema":{"type":"string"}},{"name":"messageId","required":true,"in":"path","description":"The Id of the message to retrieve.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Retrieves a specific message","tags":["Conversation messages"],"description":"\n\n**Required Permission:** `chatbots.messages.get`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"MessageResponseDto":{"type":"object","properties":{"message":{"description":"The message.","allOf":[{"$ref":"#/components/schemas/MessageDto"}]},"error":{"type":"string","description":"Optional error message."}}},"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string"},"file":{"$ref":"#/components/schemas/MessageContentFileDto"},"buttons":{"$ref":"#/components/schemas/MessageContentButtonsDto"},"selectedButton":{"$ref":"#/components/schemas/MessageContentButtonReplyDto"},"template":{"$ref":"#/components/schemas/MessageTemplateDto"},"contact":{"$ref":"#/components/schemas/MessageContentContactDto"},"location":{"$ref":"#/components/schemas/MessageLocationDto"},"note":{"$ref":"#/components/schemas/MessageNoteDto"},"voiceHangup":{"$ref":"#/components/schemas/MessageVoiceHangupDto"},"voiceTransfer":{"$ref":"#/components/schemas/MessageVoiceTransferDto"},"agentHandover":{"$ref":"#/components/schemas/MessageAgentHandoverDto"},"email":{"$ref":"#/components/schemas/MessageContentEmailDto"},"transcription":{"$ref":"#/components/schemas/MessageContentTranscriptionDto"},"textToSpeech":{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"},"reaction":{"$ref":"#/components/schemas/MessageContentReactionDto"},"callSettings":{"$ref":"#/components/schemas/MessageContentCallSettingsDto"},"metaWhatsappTemplate":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"},"operator":{"$ref":"#/components/schemas/OperatorDto"},"delay":{"type":"number"},"leadAiId":{"type":"string"}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"type":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"},"attachmentRef":{"type":"string"},"caption":{"type":"string"},"transcript":{"type":"string"}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"payload":{"type":"string"}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"payload":{"type":"string"},"type":{"type":"string"},"reference":{"type":"string"}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string"},"header":{"type":"string"},"footer":{"type":"string"}},"required":["body"]},"MessageContentContactDto":{"type":"object","properties":{"addresses":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactAddressDto"}},"emails":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactEmailDto"}},"name":{"$ref":"#/components/schemas/MessageContentContactNameDto"},"org":{"$ref":"#/components/schemas/MessageContentContactOrgDto"},"phones":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactPhoneDto"}}},"required":["addresses","emails","phones"]},"MessageContentContactAddressDto":{"type":"object","properties":{"city":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":"string"},"street":{"type":"string"},"type":{"type":"string"},"zip":{"type":"string"}}},"MessageContentContactEmailDto":{"type":"object","properties":{"email":{"type":"string","format":"email"},"type":{"type":"string"}},"required":["email"]},"MessageContentContactNameDto":{"type":"object","properties":{"firstName":{"type":"string"},"formattedName":{"type":"string"},"lastName":{"type":"string"}}},"MessageContentContactOrgDto":{"type":"object","properties":{"company":{"type":"string"},"title":{"type":"string"}}},"MessageContentContactPhoneDto":{"type":"object","properties":{"phone":{"type":"string"},"type":{"type":"string"},"waId":{"type":"string"}}},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["latitude","longitude"]},"MessageNoteDto":{"type":"object","properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"string"}}},"required":["text","mentions"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string"},"reason":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string"},"timeoutSeconds":{"type":"number"},"agentId":{"type":"string"},"groupId":{"type":"string"},"assignmentMethod":{"type":"string"}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string"},"body":{"type":"string"},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"attachmentIds":{"type":"array","items":{"type":"string"}},"references":{"type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTranscriptionDto":{"type":"object","properties":{"text":{"type":"string"},"language":{"type":"string"},"audioRef":{"type":"string"}},"required":["text","language","audioRef"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string"},"speech":{"type":"string"}},"required":["text"]},"MessageContentReactionDto":{"type":"object","properties":{"reactionToMid":{"type":"string"},"action":{"type":"string"},"reaction":{"type":"string"},"emoji":{"type":"string"}},"required":["reactionToMid","action","reaction","emoji"]},"MessageContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number"},"dtmf":{"type":"boolean"},"bargeIn":{"type":"boolean"}}},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attachment for the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"List of parameter values for header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL to access the file."},"type":{"type":"string","description":"The file type category."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The internal attachment reference ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The button type (e.g., QUICK_REPLY, URL, PHONE_NUMBER)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick reply buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## Updates an existing message

> \
> \
> \*\*Required Permission:\*\* \`chatbots.messages.edit\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Conversation messages","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/conversations/{conversationId}/messages/{messageId}":{"patch":{"operationId":"ConversationMessageController_updateConversationMessage[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"conversationId","required":true,"in":"path","description":"The Id of the conversation.","schema":{"type":"string"}},{"name":"messageId","required":true,"in":"path","description":"The Id of the message to retrieve.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMessageRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Updates an existing message","tags":["Conversation messages"],"description":"\n\n**Required Permission:** `chatbots.messages.edit`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"UpdateMessageRequestDto":{"type":"object","properties":{"message":{"description":"The message data to update.","allOf":[{"$ref":"#/components/schemas/UpdateMessageDto"}]}},"required":["message"]},"UpdateMessageDto":{"type":"object","properties":{"providerMessageId":{"type":"string","description":"The new provider message ID."},"status":{"type":"string","description":"The new delivery status."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received."},"read":{"type":"string","description":"Timestamp when the message was read."},"tags":{"description":"Tags to set on the message.","allOf":[{"$ref":"#/components/schemas/UpdateMessage_TagsDto"}]},"messengerId":{"type":"string","description":"The new messenger-specific ID."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"deleted":{"type":"boolean","description":"Whether to mark the message as deleted."},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive data."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending."}}},"UpdateMessage_TagsDto":{"type":"object","properties":{"tags":{"description":"The tags to set on the message.","type":"array","items":{"type":"string"}}},"required":["tags"]},"MessageResponseDto":{"type":"object","properties":{"message":{"description":"The message.","allOf":[{"$ref":"#/components/schemas/MessageDto"}]},"error":{"type":"string","description":"Optional error message."}}},"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string"},"file":{"$ref":"#/components/schemas/MessageContentFileDto"},"buttons":{"$ref":"#/components/schemas/MessageContentButtonsDto"},"selectedButton":{"$ref":"#/components/schemas/MessageContentButtonReplyDto"},"template":{"$ref":"#/components/schemas/MessageTemplateDto"},"contact":{"$ref":"#/components/schemas/MessageContentContactDto"},"location":{"$ref":"#/components/schemas/MessageLocationDto"},"note":{"$ref":"#/components/schemas/MessageNoteDto"},"voiceHangup":{"$ref":"#/components/schemas/MessageVoiceHangupDto"},"voiceTransfer":{"$ref":"#/components/schemas/MessageVoiceTransferDto"},"agentHandover":{"$ref":"#/components/schemas/MessageAgentHandoverDto"},"email":{"$ref":"#/components/schemas/MessageContentEmailDto"},"transcription":{"$ref":"#/components/schemas/MessageContentTranscriptionDto"},"textToSpeech":{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"},"reaction":{"$ref":"#/components/schemas/MessageContentReactionDto"},"callSettings":{"$ref":"#/components/schemas/MessageContentCallSettingsDto"},"metaWhatsappTemplate":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"},"operator":{"$ref":"#/components/schemas/OperatorDto"},"delay":{"type":"number"},"leadAiId":{"type":"string"}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"type":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"},"attachmentRef":{"type":"string"},"caption":{"type":"string"},"transcript":{"type":"string"}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"payload":{"type":"string"}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"payload":{"type":"string"},"type":{"type":"string"},"reference":{"type":"string"}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string"},"header":{"type":"string"},"footer":{"type":"string"}},"required":["body"]},"MessageContentContactDto":{"type":"object","properties":{"addresses":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactAddressDto"}},"emails":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactEmailDto"}},"name":{"$ref":"#/components/schemas/MessageContentContactNameDto"},"org":{"$ref":"#/components/schemas/MessageContentContactOrgDto"},"phones":{"type":"array","items":{"$ref":"#/components/schemas/MessageContentContactPhoneDto"}}},"required":["addresses","emails","phones"]},"MessageContentContactAddressDto":{"type":"object","properties":{"city":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":"string"},"street":{"type":"string"},"type":{"type":"string"},"zip":{"type":"string"}}},"MessageContentContactEmailDto":{"type":"object","properties":{"email":{"type":"string","format":"email"},"type":{"type":"string"}},"required":["email"]},"MessageContentContactNameDto":{"type":"object","properties":{"firstName":{"type":"string"},"formattedName":{"type":"string"},"lastName":{"type":"string"}}},"MessageContentContactOrgDto":{"type":"object","properties":{"company":{"type":"string"},"title":{"type":"string"}}},"MessageContentContactPhoneDto":{"type":"object","properties":{"phone":{"type":"string"},"type":{"type":"string"},"waId":{"type":"string"}}},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["latitude","longitude"]},"MessageNoteDto":{"type":"object","properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"string"}}},"required":["text","mentions"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string"},"reason":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string"},"timeoutSeconds":{"type":"number"},"agentId":{"type":"string"},"groupId":{"type":"string"},"assignmentMethod":{"type":"string"}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string"},"body":{"type":"string"},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"attachmentIds":{"type":"array","items":{"type":"string"}},"references":{"type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTranscriptionDto":{"type":"object","properties":{"text":{"type":"string"},"language":{"type":"string"},"audioRef":{"type":"string"}},"required":["text","language","audioRef"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string"},"speech":{"type":"string"}},"required":["text"]},"MessageContentReactionDto":{"type":"object","properties":{"reactionToMid":{"type":"string"},"action":{"type":"string"},"reaction":{"type":"string"},"emoji":{"type":"string"}},"required":["reactionToMid","action","reaction","emoji"]},"MessageContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number"},"dtmf":{"type":"boolean"},"bargeIn":{"type":"boolean"}}},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attachment for the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"List of parameter values for header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL to access the file."},"type":{"type":"string","description":"The file type category."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The internal attachment reference ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The button type (e.g., QUICK_REPLY, URL, PHONE_NUMBER)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick reply buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.chatcaptain.com/api/api-dokumentation/conversation-messages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
