Texa DeskDevelopers

Texa Desk Application API · Messages

Create New Message

POST/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages

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_tokenheaderrequired

A 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_idintegerrequired

The numeric ID of the account

conversation_idintegerrequired

The numeric ID of the conversation

Body application/json

contentstringrequired

The content of the message

message_typestring

The type of the message One of: outgoing, incoming.

privateboolean

Flag to identify if it is a private note

content_typestring

Content type of the message One of: text, input_email, cards, input_select, form, article.

content_attributesobject

Attributes 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_idinteger

The campaign id to which the message belongs

template_paramsobject

WhatsApp template parameters for sending structured messages

template_params.namestringrequired

Name of the WhatsApp template (must be approved in WhatsApp Business Manager)

template_params.categorystringrequired

Category of the template One of: UTILITY, MARKETING, SHIPPING_UPDATE, TICKET_UPDATE, ISSUE_RESOLUTION.

template_params.languagestringrequired

Language code of the template (BCP 47 format)

template_params.content_modestring

Format 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_paramsobjectrequired

Processed template parameters organized by component type

template_params.processed_params.bodyobject

Body component parameters with variable placeholders

template_params.processed_params.headerobject

Header component parameters for media templates

template_params.processed_params.buttonsarray of object

Button component parameters for interactive templates

Responses

200

Success

idnumber

The ID of the message

contentstring

The text content of the message

account_idnumber

The ID of the account

inbox_idnumber

The ID of the inbox

conversation_idnumber

The ID of the conversation

message_typeinteger

The type of the message One of: 0, 1, 2, 3.

created_atinteger

The time at which message was created

updated_atinteger or string

The time at which message was updated

privateboolean

The flags which shows whether the message is private or not

statusstring

The status of the message One of: sent, delivered, read, failed.

source_idstring

The source ID of the message

content_typestring

The 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_attributesobject

The content attributes for each content_type

sender_typestring

The type of the sender One of: Contact, User, AgentBot.

sender_idnumber

The ID of the sender

external_source_idsobject

The external source IDs of the message

additional_attributesobject

The additional attributes of the message

processed_message_contentstring

The processed message content

sentimentobject

The sentiment of the message

conversationobject

The conversation object

attachmentobject

The file object attached to the image

senderobject

User/Agent/AgentBot object

404

Conversation not found

descriptionstring
errorsarray of object
errors[].fieldstring
errors[].messagestring
errors[].codestring
403

Access denied

descriptionstring
errorsarray of object
errors[].fieldstring
errors[].messagestring
errors[].codestring