Texa Desk Application API · Messages
Create New Message
POST/
Create a new message in the conversation.
Use application/json for text messages and multipart/form-data when the
message includes file attachments.
Multipart attachment request
Send files with the attachments[] form field. curl -F sets the
multipart/form-data content type and boundary automatically.
bash
curl -X POST "https://desk.texadesk.com/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages" \
-H "api_access_token: <your-api-token>" \
-F "content=Here is the screenshot" \
-F "message_type=outgoing" \
-F "private=false" \
-F "attachments[]=@/path/to/screenshot.png"
WhatsApp Template Messages
For WhatsApp channels, you can send structured template messages using the template_params field.
Templates must be pre-approved in WhatsApp Business Manager.
By default, content is treated as the already-rendered transcript text for
compatibility with existing API and mobile clients. To submit the original
template body instead, set template_params.content_mode to raw_template;
Texa Desk will substitute processed_params.body before saving the transcript.
Example Templates
Text with Image Header:
json
{
"content": "Hi your order 121212 is confirmed. Please wait for further updates",
"template_params": {
"name": "order_confirmation",
"category": "MARKETING",
"language": "en",
"processed_params": {
"body": {
"1": "121212"
},
"header": {
"media_url": "https://picsum.photos/200/300",
"media_type": "image"
}
}
}
}
Text with Copy Code Button:
json
{
"content": "Special offer! Get 30% off your next purchase. Use the code below",
"template_params": {
"name": "discount_coupon",
"category": "MARKETING",
"language": "en",
"processed_params": {
"body": {
"discount_percentage": "30"
},
"buttons": [{
"type": "copy_code",
"parameter": "SAVE20"
}]
}
}
}
Authorization
api_access_tokenheaderrequiredA person's access token (Texa Desk, Profile settings → Access token) or an agent bot's token, in the api_access_token header. It acts as that person, with their role's permissions.
Path parameters
account_idintegerrequiredThe numeric ID of the account
conversation_idintegerrequiredThe numeric ID of the conversation
Body application/json
contentstringrequiredThe content of the message
message_typestringThe type of the message One of: outgoing, incoming.
privatebooleanFlag to identify if it is a private note
content_typestringContent type of the message One of: text, input_email, cards, input_select, form, article.
content_attributesobjectAttributes based on the content type. For input_select, provide an items array with
title, value, and optional description. WhatsApp list messages use description
as the row subtitle when present.
campaign_idintegerThe campaign id to which the message belongs
template_paramsobjectWhatsApp template parameters for sending structured messages
template_params.namestringrequiredName of the WhatsApp template (must be approved in WhatsApp Business Manager)
template_params.categorystringrequiredCategory of the template One of: UTILITY, MARKETING, SHIPPING_UPDATE, TICKET_UPDATE, ISSUE_RESOLUTION.
template_params.languagestringrequiredLanguage code of the template (BCP 47 format)
template_params.content_modestringFormat of the top-level content field. Existing clients may send rendered
content or omit this field. Set this to raw_template only when content
contains the original template body placeholders.
One of: raw_template, rendered. Default "rendered".
template_params.processed_paramsobjectrequiredProcessed template parameters organized by component type
template_params.processed_params.bodyobjectBody component parameters with variable placeholders
template_params.processed_params.headerobjectHeader component parameters for media templates
template_params.processed_params.buttonsarray of objectButton component parameters for interactive templates
Responses
200Success
idnumberThe ID of the message
contentstringThe text content of the message
account_idnumberThe ID of the account
inbox_idnumberThe ID of the inbox
conversation_idnumberThe ID of the conversation
message_typeintegerThe type of the message One of: 0, 1, 2, 3.
created_atintegerThe time at which message was created
updated_atinteger or stringThe time at which message was updated
privatebooleanThe flags which shows whether the message is private or not
statusstringThe status of the message One of: sent, delivered, read, failed.
source_idstringThe source ID of the message
content_typestringThe type of the template message One of: text, input_text, input_textarea, input_email, input_select, cards, form, article, incoming_email, input_csat, integrations, sticker, voice_call.
content_attributesobjectThe content attributes for each content_type
sender_typestringThe type of the sender One of: Contact, User, AgentBot.
sender_idnumberThe ID of the sender
external_source_idsobjectThe external source IDs of the message
additional_attributesobjectThe additional attributes of the message
processed_message_contentstringThe processed message content
sentimentobjectThe sentiment of the message
conversationobjectThe conversation object
attachmentobjectThe file object attached to the image
senderobjectUser/Agent/AgentBot object
404Conversation not found
descriptionstringerrorsarray of objecterrors[].fieldstringerrors[].messagestringerrors[].codestring403Access denied
descriptionstringerrorsarray of objecterrors[].fieldstringerrors[].messagestringerrors[].codestring