Skip to content
Get started
V2 Reference
Chat Messages

Send Message

POST
/api/partner/v2/chats/{chat_id}/chat_messages
curl --request POST \
--url https://api.linqapp.com/api/partner/v2/chats/1/chat_messages \
--header 'Content-Type: multipart/form-data' \
--header 'X-LINQ-INTEGRATION-TOKEN: <X-LINQ-INTEGRATION-TOKEN>' \
--form 'message[text]=Hello, how are you?' \
--form 'message[idempotency_key]=msg-2024_01-23_abc123'

Sends a new message in the specified chat.

Idempotency: To prevent duplicate messages (e.g., due to network retries), include a unique message[idempotency_key] in your request. If a message with the same key was already sent, the API will return the existing message with a 200 status instead of creating a duplicate. The idempotency key must be alphanumeric and may include hyphens and underscores.

Attachments: You can attach files in two ways:

  1. Direct upload - Use message[attachments][] fields in your multipart/form-data request to upload files directly:
-F "message[attachments][][email protected]" \
-F "message[attachments][][email protected]"
  1. URLs - Use message[attachment_urls][] to provide URLs of files. The API will download them from the provided URLs (must be publicly accessible, 30-second timeout per download):
-F "message[attachment_urls][]=https://example.com/document.pdf" \
-F "message[attachment_urls][]=https://example.com/image.jpg"

Both methods can be used together in the same message.

chat_id
required
integer

The chat ID

Media type multipart/form-data
object
message[text]
required

The message text content

string
message[idempotency_key]

Optional unique key to prevent duplicate messages. Must be alphanumeric and may include hyphens and underscores.

string
/^[a-zA-Z0-9_-]+$/
message[attachments][]

Optional file attachments to upload. Include one field per file (e.g., message[attachments][][email protected] message[attachments][][email protected]). Omit this field if not uploading files.

Array<string>
message[attachment_urls][]

Optional URLs of files to attach. The API will download files from these URLs (must be publicly accessible). Uses a 30-second timeout per download. Omit this field if not attaching files via URLs.

Array<string>
Examples

Basic text message

{
"message[text]": "Hello, how are you?",
"message[idempotency_key]": "msg-2024_01-23_abc123"
}

Message sent successfully

Media type application/json
object
data
object
id
integer
text
string
sent_at
string format: date-time
delivered_at
string format: date-time
nullable
delivery_status

Current delivery status of the message

string
Allowed values: pending delivered service_unavailable paused
edited_at
string format: date-time
nullable
is_read
boolean
sent_from

The phone number or identifier that sent this message

string
chat_handle_id
integer
attachments
Array<object>
object
id

Unique identifier for the attachment

string format: uuid
url
string
filename
string
mime_type
string
file_size
integer
reactions
Array<object>
object
id
integer
chat_message_id
integer
reaction

The type of reaction

string
Allowed values: love like dislike laugh emphasize question
is_from_me
boolean
from_phone
string
sent_at
string format: date-time
created_at
string format: date-time
updated_at
string format: date-time
Example
{
"data": {
"id": 224,
"text": "Hello, how are you?",
"sent_at": "2025-05-21T15:30:00.123-05:00",
"delivered_at": "2025-05-21T15:30:05.456-05:00",
"delivery_status": "pending",
"edited_at": "2025-05-21T15:31:00.789-05:00",
"is_read": false,
"sent_from": "+15551234567",
"chat_handle_id": 123,
"attachments": [
{
"id": "abc12345-1234-5678-9abc-def012345678",
"url": "https://storage.googleapis.com/linq-files/attachments/abc123.pdf",
"filename": "document.pdf",
"mime_type": "application/pdf",
"file_size": 12345
}
],
"reactions": [
{
"id": 456,
"chat_message_id": 224,
"reaction": "love",
"is_from_me": false,
"from_phone": "+15551234567",
"sent_at": "2025-05-21T15:30:00.000-05:00",
"created_at": "2025-05-21T15:30:00.000-05:00",
"updated_at": "2025-05-21T15:30:00.000-05:00"
}
]
}
}