Send a Message to Chat
Send a session message to an existing chat. Messages can include text, media (image, video, document, audio), interactive buttons, list menus, contact cards and locations.
Required token scopes: Send session message
⚠ Important: session messages are subject to WhatsApp’s 24-hour window. If the contact has not sent a message in the last 24 hours, WhatsApp blocks session messages and the request fails. In that case, you can only send a Template Message.
Session messages can only be sent to existing chats - sending to a chat that doesn’t exist returns an error.
All status values, type enums and the ID cheat sheet: Enums & Common Fields.
הרשאות
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.
פרמטרי נתיב
The unique identifier of the chat. You can obtain this value by using the Search Chats endpoint with the contact's phone number
גוף
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
Defines the message structure and required fields
text, media, buttons, list, contacts, location Reply to a specific message. Use the provider message ID (e.g. wamid...) from message.channelInfo.id
A custom client-side ID for tracking the message
The message text. Required for text, buttons and list. For text messages: up to 4096 characters (WhatsApp limit)
1Array 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
1 - 10 elementsReply buttons. Required for buttons. Max 3 buttons (WhatsApp limit)
1 - 3 elementsList menu configuration. Required for list. Max 10 rows total across all sections (WhatsApp limit)
Contact cards to share. Required for contacts
1Location to share. Required for location
תגובה
A confirmation object containing the sent message(s). Field-by-field reference: The Message object