דלג לתוכן הראשי
POST
/
messages
/
send
/
{chatId}
curl --request POST \
  --url https://{projectID}.texterchat.com/server/api/v2/messages/send/{chatId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "text",
  "text": "Hey there!"
}
'
{
  "success": true,
  "messages": [
    {
      "_id": "6909177d962e17ab3033fa2a",
      "chatChannelInfo": {
        "name": "whatsapp",
        "id": "972521234567",
        "accountId": "972509876543"
      },
      "channelInfo": {
        "id": "wamid.HBgMOTcyNTI3NzYwOTg5FQIAERgSRDI2RjUwMkFFQTNEQjE0MEVBAA=="
      },
      "direction": "outgoing",
      "parent_chat": "67a87067aeedqdee1271ck4d",
      "status": 0,
      "statusHistory": [
        {
          "status": 0,
          "timestamp": 1762203517914
        }
      ],
      "text": "Hey there!",
      "timestamp": 1762203517914,
      "type": "text",
      "updatedAt": "2025-11-03T20:58:37.936Z"
    }
  ]
}

הרשאות

Authorization
string
header
נדרש

API token generated in Texter: gear icon → Developers → API Tokens. When creating a token, assign it the scopes required by the endpoints you plan to call - each endpoint lists its required scopes.

פרמטרי נתיב

chatId
string
נדרש

The unique identifier of the chat. You can obtain this value by using the Search Chats endpoint with the contact's phone number

גוף

application/json

The message contents. type selects the message structure; each type has its own required fields. All types also accept the generic context and tmpSendId options

type
enum<string>
נדרש

Defines the message structure and required fields

אפשרויות זמינות:
text,
media,
buttons,
list,
contacts,
location
context
string

Reply to a specific message. Use the provider message ID (e.g. wamid...) from message.channelInfo.id

tmpSendId
string

A custom client-side ID for tracking the message

text
string

The message text. Required for text, buttons and list. For text messages: up to 4096 characters (WhatsApp limit)

Minimum string length: 1
media
object[]

Array of media items. Required for media. Each item needs mediaType plus either a public url (Texter downloads and stores the file) or a fileId of a file already stored in Texter

Required array length: 1 - 10 elements
buttons
object[]

Reply buttons. Required for buttons. Max 3 buttons (WhatsApp limit)

Required array length: 1 - 3 elements
list
object

List menu configuration. Required for list. Max 10 rows total across all sections (WhatsApp limit)

contacts
object[]

Contact cards to share. Required for contacts

Minimum array length: 1
location
object

Location to share. Required for location

תגובה

A confirmation object containing the sent message(s). Field-by-field reference: The Message object

success
boolean
דוגמה:

true

messages
object[]