Skip to main content
POST
/
chats
/
{chat_id}
/
messages
Send message in existing chat
curl --request POST \
  --url https://app.timelines.ai/integrations/api/chats/{chat_id}/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reply_to": "<string>",
  "text": "hello, world!",
  "file_uid": "afa9d4dd-978d-4a14-aa1b-bd65c272e645",
  "label": "customer",
  "chat_name": "MyChat",
  "attachment_template_id": 123456
}
'
{
  "status": "ok",
  "data": {
    "message_uid": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

chat_id
integer
required

an id of the chat as appears in TimelinesAI (can be found in the URL of the chat page, or in the payload of outbound webhook). Supports sending messages to a group.

Body

application/json

A JSON describing recipient and message payload.

reply_to
string | null

UID of the message this message replies to. Must reference a message in the same workspace and WhatsApp account. Null or empty string is ignored.

text
string

plain text message

Example:

"hello, world!"

file_uid
string

attachment UID

Example:

"afa9d4dd-978d-4a14-aa1b-bd65c272e645"

label
string

assign label to the chat, in which the message is sent (create new label, if not exists)

Example:

"customer"

chat_name
string

an exact name of the chat (or group) as appears in TimelinesAI)

Example:

"MyChat"

attachment_template_id
integer

a template ID of the attachment to be sent. The template must be created in the workspace before sending a message with it.

Example:

123456

Response

Message accepted for async sending

status
enum<string>
required
Available options:
ok,
error
Example:

"ok"

data
object
required