### Handle Incoming WhatsApp Messages (Webhook) Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt This example shows the structure of a webhook payload for an incoming WhatsApp message. It includes event details, session information, and the message content, sender, and timestamp. This is fundamental for building event-driven WhatsApp automation. ```json { "event": "message", "session": "session-001", "payload": { "from": "6281234567890@c.us", "fromMe": false, "body": "Hello, I need help with my order", "messageId": "3EB0C1F4E8F5A1234567890", "timestamp": "2024-01-06T13:00:00.000Z", "chat": { "id": "6281234567890@c.us", "name": "John Doe" } } } ``` -------------------------------- ### Get WhatsApp Group Invite Code Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt This code snippet demonstrates how to retrieve the invite code and URL for a specific WhatsApp group. You need to provide the session ID and the group ID. This is useful for sharing group access with others. ```typescript const getInviteCode = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/groups/invite-code', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', groupId: '123456789012345678@g.us' } }; // Invite code response // { // "inviteCode": "AbCdEfGhIjK", // "inviteUrl": "https://chat.whatsapp.com/AbCdEfGhIjK" // } ``` -------------------------------- ### Webhook Trigger Configuration Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Details on configuring webhook triggers to listen for real-time WhatsApp events. ```APIDOC ## Webhook Trigger Events ### Description Receives real-time events from WhatsApp, such as incoming messages, connection updates, and group participant changes. ### Method POST (Webhook endpoint) ### Endpoint (Configurable in n8n node settings) ### Event Types and Payload Structures #### Incoming Message **Event:** `message` **Payload:** - **from** (string) - The sender's WhatsApp ID. - **fromMe** (boolean) - Indicates if the message is from the current session. - **body** (string) - The content of the message. - **messageId** (string) - The unique ID of the message. - **timestamp** (string) - The time the message was sent. - **chat** (object) - Information about the chat the message belongs to. - **id** (string) - The chat ID. - **name** (string) - The name of the chat. **Example Payload:** ```json { "event": "message", "session": "session-001", "payload": { "from": "6281234567890@c.us", "fromMe": false, "body": "Hello, I need help with my order", "messageId": "3EB0C1F4E8F5A1234567890", "timestamp": "2024-01-06T13:00:00.000Z", "chat": { "id": "6281234567890@c.us", "name": "John Doe" } } } ``` #### Connection Update **Event:** `connection.update` **Payload:** - **status** (string) - The connection status (e.g., 'connected'). - **phone** (object) - Information about the phone number associated with the session. - **number** (string) - The phone number. - **connectedAt** (string) - The timestamp when the connection was established. **Example Payload:** ```json { "event": "connection.update", "session": "session-001", "payload": { "status": "connected", "phone": { "number": "6281234567890" }, "connectedAt": "2024-01-06T12:31:00.000Z" } } ``` #### Group Participants Event **Event:** `group.participants` **Payload:** - **groupId** (string) - The ID of the group. - **action** (string) - The action performed (e.g., 'add'). - **participants** (array of strings) - List of participants affected. - **author** (string) - The user who performed the action. **Example Payload:** ```json { "event": "group.participants", "session": "session-001", "payload": { "groupId": "123456789012345678@g.us", "action": "add", "participants": ["6281234567895@c.us"], "author": "6281234567890@c.us" } } ``` ### n8n Trigger Configuration Options - **event** (string) - The type of event to listen for (e.g., 'message', 'connection.update', 'group.participants'). - **options** (object) - Filtering options for the trigger. - **sessionFilter** (string) - Filter by session ID. - **chatIdFilter** (string) - Filter by chat ID. - **ignoreStatus** (boolean) - Ignore messages based on status. - **onlyFromMe** (boolean) - Only receive messages sent by the current session. - **onlyFromOthers** (boolean) - Only receive messages sent by others. **Example Configuration:** ```json { "event": "message", "options": { "sessionFilter": "session-001", "chatIdFilter": "", "ignoreStatus": true, "onlyFromMe": false, "onlyFromOthers": true } } ``` ``` -------------------------------- ### Credentials Configuration Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Configure Chatery API authentication credentials for node access. This involves setting the API URL and an API key. The node sends authentication headers with each request and provides a test endpoint to verify credentials. ```APIDOC ## Credentials Configuration ### Description Configure Chatery API authentication credentials for node access. ### Method GET ### Endpoint `https://api.chatery.app/api/health` ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **status** (string) - Health status of the API. #### Response Example ```json { "status": "healthy" } ``` ``` -------------------------------- ### Create WhatsApp Group Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt This snippet demonstrates how to create a new WhatsApp group using the Chatery API. It requires a session ID, group name, and a list of participant phone numbers. The response includes the new group ID and an invite code. ```typescript const createGroup = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/groups/create', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', name: 'Project Team', participants: ['6281234567890', '6281234567891', '6281234567892'] } }; // Group creation response // { // "success": true, // "groupId": "123456789012345678@g.us", // "inviteCode": "AbCdEfGhIjK" // } ``` -------------------------------- ### Configure Chatery API Credentials for n8n Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Set up authentication credentials for the n8n Chatery WhatsApp node. This involves providing the API URL and a valid API key. The node then uses these credentials to form authentication headers for requests and can test the connection using a health check endpoint. ```typescript // Credential configuration in n8n { "url": "https://api.chatery.app", "apiKey": "your-api-key-here" } ``` ```http // Authentication headers sent with requests { "X-Api-Key": "your-api-key-here", "Content-Type": "application/json" } ``` ```http // Test endpoint to verify credentials GET https://api.chatery.app/api/health ``` -------------------------------- ### Manage WhatsApp Sessions using TypeScript Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Manages WhatsApp Web sessions including connecting, monitoring status, and retrieving QR codes for scanning. Requires API key and session ID. Supports configuring webhooks for event notifications. ```typescript // List all sessions const listSessions = { method: 'GET', url: 'https://api.chatery.app/api/whatsapp/sessions', headers: { 'X-Api-Key': 'your-api-key' } }; // Connect new session const connectSession = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/sessions/session-001/connect', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { metadata: { environment: 'production', owner: 'john@example.com' }, webhooks: [ { url: 'https://n8n.example.com/webhook/whatsapp', events: ['message', 'message.update', 'connection.update'] } ] } }; // Get QR code for scanning const getQR = { method: 'GET', url: 'https://api.chatery.app/api/whatsapp/sessions/session-001/qr', headers: { 'X-Api-Key': 'your-api-key' } }; // QR response { "qr": "1@ABC123DEF456...", "timestamp": "2024-01-06T12:30:00.000Z" } // Get session status const getStatus = { method: 'GET', url: 'https://api.chatery.app/api/whatsapp/sessions/session-001/status', headers: { 'X-Api-Key': 'your-api-key' } }; // Status response { "sessionId": "session-001", "status": "connected", "phone": "6281234567890", "connectedAt": "2024-01-06T12:31:00.000Z" } ``` -------------------------------- ### POST /api/whatsapp/chats/send-image Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Send an image file from a URL to a WhatsApp chat with an optional caption. Supports typing simulation and reply functionality. ```APIDOC ## POST /api/whatsapp/chats/send-image ### Description Send an image file from URL to a WhatsApp chat with optional caption. Supports typing simulation and reply functionality. ### Method POST ### Endpoint `https://api.chatery.app/api/whatsapp/chats/send-image` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **sessionId** (string) - Required - The ID of the WhatsApp session. - **chatId** (string) - Required - The ID of the chat to send the image to. - **imageUrl** (string) - Required - The URL of the image to send. - **caption** (string) - Optional - The caption for the image. - **typingTime** (number) - Optional - The duration in milliseconds to simulate typing before sending. - **replyTo** (string) - Optional - The message ID to reply to. ### Request Example ```json { "sessionId": "session-001", "chatId": "6281234567890@c.us", "imageUrl": "https://example.com/images/product.jpg", "caption": "Check out our new product!", "typingTime": 1500, "replyTo": "previous-message-id" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the image was sent successfully. - **messageId** (string) - The unique ID of the sent message. - **timestamp** (string) - The timestamp when the message was sent. #### Response Example ```json { "success": true, "messageId": "3EB0C1F4E8F5A9876543210", "timestamp": "2024-01-06T12:05:00.000Z" } ``` ``` -------------------------------- ### Add Participants to WhatsApp Group Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt This code shows how to add new participants to an existing WhatsApp group. You need to provide the session ID, the group ID, and a list of phone numbers for the participants to be added. This functionality is crucial for dynamic group management. ```typescript const addParticipants = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/groups/participants/add', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', groupId: '123456789012345678@g.us', participants: ['6281234567893', '6281234567894'] } }; ``` -------------------------------- ### Group Management API Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Endpoints for creating groups, managing participants, updating group settings, and retrieving invite codes. ```APIDOC ## POST /api/whatsapp/groups/create ### Description Creates a new WhatsApp group with specified participants. ### Method POST ### Endpoint https://api.chatery.app/api/whatsapp/groups/create ### Parameters #### Request Body - **sessionId** (string) - Required - The ID of the WhatsApp session to use. - **name** (string) - Required - The name of the new group. - **participants** (array of strings) - Required - A list of participant phone numbers (e.g., '6281234567890'). ### Request Example ```json { "sessionId": "session-001", "name": "Project Team", "participants": ["6281234567890", "6281234567891", "6281234567892"] } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the group creation was successful. - **groupId** (string) - The ID of the newly created group. - **inviteCode** (string) - The invite code for the new group. #### Response Example ```json { "success": true, "groupId": "123456789012345678@g.us", "inviteCode": "AbCdEfGhIjK" } ``` --- ## POST /api/whatsapp/groups/participants/add ### Description Adds participants to an existing WhatsApp group. ### Method POST ### Endpoint https://api.chatery.app/api/whatsapp/groups/participants/add ### Parameters #### Request Body - **sessionId** (string) - Required - The ID of the WhatsApp session to use. - **groupId** (string) - Required - The ID of the group to add participants to. - **participants** (array of strings) - Required - A list of participant phone numbers to add. ### Request Example ```json { "sessionId": "session-001", "groupId": "123456789012345678@g.us", "participants": ["6281234567893", "6281234567894"] } ``` ### Response (No specific success response documented, assumes success if no error is returned) --- ## POST /api/whatsapp/groups/settings ### Description Updates settings for a specified WhatsApp group. ### Method POST ### Endpoint https://api.chatery.app/api/whatsapp/groups/settings ### Parameters #### Request Body - **sessionId** (string) - Required - The ID of the WhatsApp session to use. - **groupId** (string) - Required - The ID of the group to update settings for. - **setting** (string) - Required - The setting to update (e.g., 'announcement'). ### Request Example ```json { "sessionId": "session-001", "groupId": "123456789012345678@g.us", "setting": "announcement" } ``` ### Response (No specific success response documented, assumes success if no error is returned) --- ## POST /api/whatsapp/groups/invite-code ### Description Retrieves the invite code and URL for a given WhatsApp group. ### Method POST ### Endpoint https://api.chatery.app/api/whatsapp/groups/invite-code ### Parameters #### Request Body - **sessionId** (string) - Required - The ID of the WhatsApp session to use. - **groupId** (string) - Required - The ID of the group to get the invite code for. ### Request Example ```json { "sessionId": "session-001", "groupId": "123456789012345678@g.us" } ``` ### Response #### Success Response (200) - **inviteCode** (string) - The invite code for the group. - **inviteUrl** (string) - The direct URL to join the group. #### Response Example ```json { "inviteCode": "AbCdEfGhIjK", "inviteUrl": "https://chat.whatsapp.com/AbCdEfGhIjK" } ``` ``` -------------------------------- ### Send Bulk Messages using TypeScript Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Sends messages to multiple recipients efficiently using background job processing. Requires a session ID, a list of recipient phone numbers, the message content, and optional delay between messages and typing time. ```typescript // Send bulk text messages const bulkOptions = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/chats/send-bulk', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', recipients: ['628123456789', '628987654321', '628111222333'], message: 'Important announcement: Our office will be closed on Monday.', delayBetweenMessages: 1000, typingTime: 2000 } }; // Job creation response { "success": true, "jobId": "bulk_1704326400000_abc123def", "totalRecipients": 3, "status": "processing" } // Check job status const statusOptions = { method: 'GET', url: 'https://api.chatery.app/api/whatsapp/chats/bulk-status/bulk_1704326400000_abc123def', headers: { 'X-Api-Key': 'your-api-key' } }; // Status response { "jobId": "bulk_1704326400000_abc123def", "status": "completed", "totalRecipients": 3, "completed": 3, "failed": 0, "results": [ { "recipient": "628123456789", "status": "success", "messageId": "msg-001" }, { "recipient": "628987654321", "status": "success", "messageId": "msg-002" }, { "recipient": "628111222333", "status": "success", "messageId": "msg-003" } ] } ``` -------------------------------- ### Configure n8n Webhook Trigger for WhatsApp Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt This JSON configuration outlines how to set up an n8n webhook trigger to listen for WhatsApp events. It includes options for filtering by session, chat ID, and message origin, allowing for granular control over which events trigger workflows. ```json { "event": "message", "options": { "sessionFilter": "session-001", "chatIdFilter": "", "ignoreStatus": true, "onlyFromMe": false, "onlyFromOthers": true } } ``` -------------------------------- ### Send Image with Caption via Chatery WhatsApp API Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Transmit an image file from a URL to a WhatsApp chat, optionally including a caption. The API request specifies the session, chat ID, image URL, and caption text. It also supports typing simulation and replying to a previous message. The response confirms the message's success and provides its ID. ```typescript // Send image via API const options = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/chats/send-image', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', chatId: '6281234567890@c.us', imageUrl: 'https://example.com/images/product.jpg', caption: 'Check out our new product!', typingTime: 1500, replyTo: 'previous-message-id' } }; // Expected response { "success": true, "messageId": "3EB0C1F4E8F5A9876543210", "timestamp": "2024-01-06T12:05:00.000Z" } ``` -------------------------------- ### Handle WhatsApp Group Participant Events Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt This JSON payload details a 'group.participants' event, specifying the group ID, the action performed (e.g., 'add'), the participants involved, and the author of the action. This enables automated responses to group membership changes. ```json { "event": "group.participants", "session": "session-001", "payload": { "groupId": "123456789012345678@g.us", "action": "add", "participants": ["6281234567895@c.us"], "author": "6281234567890@c.us" } } ``` -------------------------------- ### Send Button Message using TypeScript Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Sends an interactive message with clickable buttons via the Chatery WhatsApp API. Requires session ID, chat ID, message text, and button options. Can include an optional footer and reply-to context. ```typescript // Send button message via API const options = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/chats/send-button', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', chatId: '6281234567890@c.us', text: 'Please select an option:', footer: 'Powered by n8n automation', buttons: ['Option 1', 'Option 2', 'Cancel'], replyTo: 'context-message-id' } }; // Expected response { "success": true, "messageId": "3EB0C1F4E8F5A7788990011", "timestamp": "2024-01-06T12:25:00.000Z" } ``` -------------------------------- ### Send Document via Chatery WhatsApp API Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Upload and send a document or file attachment to a WhatsApp chat. The request requires the session ID, chat ID, the URL of the document, its filename, and MIME type. The API handles the file transfer and returns a success status with the message ID. Typing simulation is optional. ```typescript // Send document via API const options = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/chats/send-document', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', chatId: '6281234567890@c.us', documentUrl: 'https://example.com/files/invoice-2024-001.pdf', filename: 'invoice-2024-001.pdf', mimetype: 'application/pdf', typingTime: 0 } }; // Expected response { "success": true, "messageId": "3EB0C1F4E8F5A1122334455", "timestamp": "2024-01-06T12:10:00.000Z" } ``` -------------------------------- ### Update WhatsApp Group Settings Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt This snippet illustrates how to update settings for a WhatsApp group, such as enabling announcement mode. It requires the session ID, group ID, and the specific setting to be changed. This allows for controlling group permissions and behavior. ```typescript const updateSettings = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/groups/settings', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', groupId: '123456789012345678@g.us', setting: 'announcement' } }; ``` -------------------------------- ### Chat History Operations using TypeScript Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Performs operations on chat history, including retrieving chat overviews, fetching messages, and marking messages as read. Requires session ID and chat ID for specific operations. Supports pagination for message retrieval. ```typescript // Get chat overview const getOverview = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/chats/overview', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', limit: 50, offset: 0, type: 'private' } }; // Get messages from chat const getMessages = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/chats/messages', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', chatId: '6281234567890@c.us', limit: 50, cursor: 'last-message-id' } }; // Messages response { "messages": [ { "id": "3EB0C1F4E8F5A1234567890", "from": "6281234567890@c.us", "body": "Hello!", "timestamp": "2024-01-06T11:00:00.000Z", "fromMe": false } ], "hasMore": true, "nextCursor": "next-message-id" } // Mark chat as read const markRead = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/chats/mark-read', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', chatId: '6281234567890@c.us', messageId: '3EB0C1F4E8F5A1234567890' } }; ``` -------------------------------- ### POST /api/whatsapp/chats/send-document Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Send a document or file attachment to a WhatsApp chat. Requires session ID, chat ID, document URL, and optionally filename and MIME type. ```APIDOC ## POST /api/whatsapp/chats/send-document ### Description Send a document or file attachment to a WhatsApp chat. Requires session ID, chat ID, document URL, and optionally filename and MIME type. ### Method POST ### Endpoint `https://api.chatery.app/api/whatsapp/chats/send-document` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **sessionId** (string) - Required - The ID of the WhatsApp session. - **chatId** (string) - Required - The ID of the chat to send the document to. - **documentUrl** (string) - Required - The URL of the document to send. - **filename** (string) - Optional - The name of the file. - **mimetype** (string) - Optional - The MIME type of the document. - **typingTime** (number) - Optional - The duration in milliseconds to simulate typing before sending. ### Request Example ```json { "sessionId": "session-001", "chatId": "6281234567890@c.us", "documentUrl": "https://example.com/files/invoice-2024-001.pdf", "filename": "invoice-2024-001.pdf", "mimetype": "application/pdf", "typingTime": 0 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the document was sent successfully. - **messageId** (string) - The unique ID of the sent message. - **timestamp** (string) - The timestamp when the message was sent. #### Response Example ```json { "success": true, "messageId": "3EB0C1F4E8F5A1122334455", "timestamp": "2024-01-06T12:10:00.000Z" } ``` ``` -------------------------------- ### POST /api/whatsapp/chats/send-contact Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Send a contact's vCard information to a WhatsApp chat. Requires session ID, chat ID, contact name, and contact phone number. ```APIDOC ## POST /api/whatsapp/chats/send-contact ### Description Send a contact's vCard information to a WhatsApp chat. Requires session ID, chat ID, contact name, and contact phone number. ### Method POST ### Endpoint `https://api.chatery.app/api/whatsapp/chats/send-contact` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **sessionId** (string) - Required - The ID of the WhatsApp session. - **chatId** (string) - Required - The ID of the chat to send the contact to. - **contactName** (string) - Required - The name of the contact. - **contactPhone** (string) - Required - The phone number of the contact. - **typingTime** (number) - Optional - The duration in milliseconds to simulate typing before sending. ### Request Example ```json { "sessionId": "session-001", "chatId": "6281234567890@c.us", "contactName": "John Doe", "contactPhone": "6289876543210", "typingTime": 500 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the contact card was sent successfully. - **messageId** (string) - The unique ID of the sent message. - **timestamp** (string) - The timestamp when the message was sent. #### Response Example ```json { "success": true, "messageId": "3EB0C1F4E8F5A6677889900", "timestamp": "2024-01-06T12:20:00.000Z" } ``` ``` -------------------------------- ### Handle WhatsApp Connection Update Events Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt This JSON structure represents a 'connection.update' event from WhatsApp, indicating the status of a session, the associated phone number, and when it was connected. This is useful for monitoring WhatsApp connection health within your workflows. ```json { "event": "connection.update", "session": "session-001", "payload": { "status": "connected", "phone": "6281234567890", "connectedAt": "2024-01-06T12:31:00.000Z" } } ``` -------------------------------- ### Bulk Messaging API Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Send messages to multiple recipients efficiently with background job processing. This API supports setting delays and typing indicators for a more natural interaction. ```APIDOC ## POST /api/whatsapp/chats/send-bulk ### Description Send messages to multiple recipients with background job processing. ### Method POST ### Endpoint https://api.chatery.app/api/whatsapp/chats/send-bulk ### Parameters #### Headers - **X-Api-Key** (string) - Required - Your Chatery API key - **Content-Type** (string) - Required - application/json #### Request Body - **sessionId** (string) - Required - The ID of the WhatsApp session to use. - **recipients** (array of strings) - Required - An array of phone numbers to send the message to. - **message** (string) - Required - The content of the message to send. - **delayBetweenMessages** (integer) - Optional - The delay in milliseconds between sending messages to different recipients. - **typingTime** (integer) - Optional - The duration in milliseconds to simulate typing before sending a message. ### Request Example ```json { "sessionId": "session-001", "recipients": ["628123456789", "628987654321", "628111222333"], "message": "Important announcement: Our office will be closed on Monday.", "delayBetweenMessages": 1000, "typingTime": 2000 } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the bulk message job was created successfully. - **jobId** (string) - The unique identifier for the bulk messaging job. - **totalRecipients** (integer) - The total number of recipients for this job. - **status** (string) - The initial status of the job (e.g., 'processing'). #### Response Example ```json { "success": true, "jobId": "bulk_1704326400000_abc123def", "totalRecipients": 3, "status": "processing" } ``` ``` ```APIDOC ## GET /api/whatsapp/chats/bulk-status/{jobId} ### Description Check the status and results of a previously initiated bulk messaging job. ### Method GET ### Endpoint https://api.chatery.app/api/whatsapp/chats/bulk-status/{jobId} ### Parameters #### Path Parameters - **jobId** (string) - Required - The ID of the bulk messaging job to check. #### Headers - **X-Api-Key** (string) - Required - Your Chatery API key ### Response #### Success Response (200) - **jobId** (string) - The ID of the bulk messaging job. - **status** (string) - The current status of the job (e.g., 'completed', 'failed', 'processing'). - **totalRecipients** (integer) - The total number of recipients. - **completed** (integer) - The number of messages successfully sent. - **failed** (integer) - The number of messages that failed to send. - **results** (array of objects) - An array containing the status for each recipient. - **recipient** (string) - The phone number of the recipient. - **status** (string) - The status of the message for this recipient ('success' or 'failed'). - **messageId** (string) - The message ID if the status is 'success'. #### Response Example ```json { "jobId": "bulk_1704326400000_abc123def", "status": "completed", "totalRecipients": 3, "completed": 3, "failed": 0, "results": [ { "recipient": "628123456789", "status": "success", "messageId": "msg-001" }, { "recipient": "628987654321", "status": "success", "messageId": "msg-002" }, { "recipient": "628111222333", "status": "success", "messageId": "msg-003" } ] } ``` ``` -------------------------------- ### POST /api/whatsapp/chats/send-text Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Send a text message to a WhatsApp chat with optional typing simulation and reply functionality. Requires session ID, chat ID, and the message content. ```APIDOC ## POST /api/whatsapp/chats/send-text ### Description Send a text message to a WhatsApp chat with optional typing simulation and reply functionality. ### Method POST ### Endpoint `https://api.chatery.app/api/whatsapp/chats/send-text` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **sessionId** (string) - Required - The ID of the WhatsApp session. - **chatId** (string) - Required - The ID of the chat to send the message to. - **message** (string) - Required - The content of the message. - **typingTime** (number) - Optional - The duration in milliseconds to simulate typing before sending. - **replyTo** (string) - Optional - The message ID to reply to. ### Request Example ```json { "sessionId": "session-001", "chatId": "6281234567890@c.us", "message": "Hello! This is an automated message from n8n.", "typingTime": 2000, "replyTo": "message-id-to-quote" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the message was sent successfully. - **messageId** (string) - The unique ID of the sent message. - **timestamp** (string) - The timestamp when the message was sent. #### Response Example ```json { "success": true, "messageId": "3EB0C1F4E8F5A1234567890", "timestamp": "2024-01-06T12:00:00.000Z" } ``` ``` -------------------------------- ### Send Contact Card via Chatery WhatsApp API Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Share a contact's information in a WhatsApp chat by sending a vCard. The API request includes the session ID, chat ID, the contact's name, and phone number. The function supports typing simulation and returns a confirmation of the sent message with its ID. ```typescript // Send contact card via API const options = { method: 'POST', url: 'https://api.chatery.app/api/whatsapp/chats/send-contact', headers: { 'X-Api-Key': 'your-api-key', 'Content-Type': 'application/json' }, body: { sessionId: 'session-001', chatId: '6281234567890@c.us', contactName: 'John Doe', contactPhone: '6289876543210', typingTime: 500 } }; // Expected response { "success": true, "messageId": "3EB0C1F4E8F5A6677889900", "timestamp": "2024-01-06T12:20:00.000Z" } ``` -------------------------------- ### Session Management API Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Manage your WhatsApp Web sessions, including connecting new sessions, monitoring their status, and retrieving QR codes for authentication. ```APIDOC ## GET /api/whatsapp/sessions ### Description List all active WhatsApp sessions managed by the API. ### Method GET ### Endpoint https://api.chatery.app/api/whatsapp/sessions ### Parameters #### Headers - **X-Api-Key** (string) - Required - Your Chatery API key ### Response #### Success Response (200) (Response structure not explicitly defined in the provided text, but would typically return a list of session objects.) ``` ```APIDOC ## POST /api/whatsapp/sessions/{sessionId}/connect ### Description Connect a new WhatsApp session or re-establish an existing one. Allows configuration of metadata and webhooks for event notifications. ### Method POST ### Endpoint https://api.chatery.app/api/whatsapp/sessions/{sessionId}/connect ### Parameters #### Path Parameters - **sessionId** (string) - Required - The unique identifier for the session to connect. #### Headers - **X-Api-Key** (string) - Required - Your Chatery API key - **Content-Type** (string) - Required - application/json #### Request Body - **metadata** (object) - Optional - Additional information about the session (e.g., environment, owner). - **environment** (string) - Optional - The environment for this session. - **owner** (string) - Optional - The owner or identifier for this session. - **webhooks** (array of objects) - Optional - A list of webhook URLs to receive event notifications. - **url** (string) - Required - The URL to send webhook events to. - **events** (array of strings) - Required - A list of events to subscribe to (e.g., 'message', 'message.update', 'connection.update'). ### Request Example ```json { "metadata": {"environment": "production", "owner": "john@example.com"}, "webhooks": [ { "url": "https://n8n.example.com/webhook/whatsapp", "events": ["message", "message.update", "connection.update"] } ] } ``` ### Response #### Success Response (200) (Response structure not explicitly defined in the provided text, but would typically confirm session connection status.) ``` ```APIDOC ## GET /api/whatsapp/sessions/{sessionId}/qr ### Description Retrieve the QR code required to authenticate and connect a WhatsApp session. This QR code is typically scanned using the WhatsApp mobile application. ### Method GET ### Endpoint https://api.chatery.app/api/whatsapp/sessions/{sessionId}/qr ### Parameters #### Path Parameters - **sessionId** (string) - Required - The unique identifier for the session for which to get the QR code. #### Headers - **X-Api-Key** (string) - Required - Your Chatery API key ### Response #### Success Response (200) - **qr** (string) - The QR code string, typically used to generate a QR image. - **timestamp** (string) - The timestamp when the QR code was generated. #### Response Example ```json { "qr": "1@ABC123DEF456...", "timestamp": "2024-01-06T12:30:00.000Z" } ``` ``` ```APIDOC ## GET /api/whatsapp/sessions/{sessionId}/status ### Description Get the current connection status and details of a specific WhatsApp session. ### Method GET ### Endpoint https://api.chatery.app/api/whatsapp/sessions/{sessionId}/status ### Parameters #### Path Parameters - **sessionId** (string) - Required - The unique identifier for the session to check. #### Headers - **X-Api-Key** (string) - Required - Your Chatery API key ### Response #### Success Response (200) - **sessionId** (string) - The ID of the session. - **status** (string) - The current connection status (e.g., 'connected', 'disconnected', 'connecting'). - **phone** (string) - The phone number associated with the session, if connected. - **connectedAt** (string) - The timestamp when the session was last connected. #### Response Example ```json { "sessionId": "session-001", "status": "connected", "phone": "6281234567890", "connectedAt": "2024-01-06T12:31:00.000Z" } ``` ``` -------------------------------- ### Send Button Message API Source: https://context7.com/farinchan/n8n-nodes-chatery-whatsapp/llms.txt Send an interactive message with clickable buttons to a WhatsApp chat. This endpoint allows for customized button options and footers. ```APIDOC ## POST /api/whatsapp/chats/send-button ### Description Send an interactive message with clickable buttons. ### Method POST ### Endpoint https://api.chatery.app/api/whatsapp/chats/send-button ### Parameters #### Headers - **X-Api-Key** (string) - Required - Your Chatery API key - **Content-Type** (string) - Required - application/json #### Request Body - **sessionId** (string) - Required - The ID of the WhatsApp session to use. - **chatId** (string) - Required - The ID of the chat to send the message to (e.g., '6281234567890@c.us'). - **text** (string) - Required - The main text content of the message. - **footer** (string) - Optional - Text to display below the buttons. - **buttons** (array of strings) - Required - An array of strings, each representing a clickable button. - **replyTo** (string) - Optional - The ID of a message to which this button message is a reply. ### Request Example ```json { "sessionId": "session-001", "chatId": "6281234567890@c.us", "text": "Please select an option:", "footer": "Powered by n8n automation", "buttons": ["Option 1", "Option 2", "Cancel"], "replyTo": "context-message-id" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the message was sent successfully. - **messageId** (string) - The unique identifier for the sent message. - **timestamp** (string) - The timestamp when the message was sent. #### Response Example ```json { "success": true, "messageId": "3EB0C1F4E8F5A7788990011", "timestamp": "2024-01-06T12:25:00.000Z" } ``` ```