Skip to main content
POST
/
messages
Send message to phone number
curl --request POST \
  --url https://app.timelines.ai/integrations/api/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "phone": "+14840000000",
  "whatsapp_account_phone": "+14841111111",
  "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.

Body

application/json

A JSON describing recipient and message payload.

phone
string
required

a phone number, formatted according to international phone number standard, i.e.: [+][country code][area code][local phone number]

Example:

"+14840000000"

whatsapp_account_phone
string

the WhatsApp account (as a phone number, in international format) to which the chat specified by JID belongs to. If omitted, the most recently connected WhatsApp account in the workspace will be used.

Example:

"+14841111111"

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

Success

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

"ok"

data
object
required