The WhatsApp gateway in Kantuta POS is powered by @whiskeysockets/baileys, an open-source multi-device WhatsApp Web implementation for Node.js. Once a phone number is linked by scanning a QR code, the API can send text messages, images, documents, and group broadcasts entirely from the backend — no third-party SaaS or Meta Business Account required. All messaging endpoints (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Eleazarguitar18/kantuta_pos_back/llms.txt
Use this file to discover all available pages before exploring further.
/send*, /list-groups, /connect/view) are decorated with @Public() and bypass the global JWT guard.
Connection & QR Code
Render QR code as HTML page
<img> tag. Scan the displayed QR with your WhatsApp mobile app to link the corporate number. If WhatsApp is already connected, the page shows a confirmation message instead.
Access: Public — no Authorization header required.
Usage: Navigate directly in a browser:
Get QR as Base64 JSON
Authorization: Bearer <access_token>.
Response (not yet connected)
Always
true.Base64-encoded PNG data URI of the QR code. Use as
<img src={qrBase64} /> in your frontend.Response (already connected)
Always
true."WhatsApp ya está vinculado o el código se está generando de fondo...".Send text message
code and phone fields are concatenated server-side to build the full international number (e.g. 591 + 71234567 → 59171234567).
Access: Public — no Authorization header required.
Request body
Country calling code — digits only, no
+ prefix. Must be 2–3 digits long (e.g. "591" for Bolivia, "51" for Peru).Local phone number — digits only, no spaces or symbols. Must be 8–15 digits (e.g.
"71234567").Plain-text content of the WhatsApp message to deliver.
Response
true on successful delivery."Mensaje enviado con éxito".Raw Baileys message send result containing message ID and server timestamp.
Example
Send image
Authorization header required.
Content-Type: multipart/form-data
Request fields
Country calling code — digits only, 2–3 characters (e.g.
"591").Local phone number — digits only, 8–15 characters (e.g.
"71234567").Optional image caption / description displayed below the image in WhatsApp.
Image file to send (
.png, .jpg, .jpeg, .gif, etc.). Maximum size: 5 MB. Requests exceeding this limit are rejected with HTTP 400.Response
true on successful delivery."Archivo de imagen enviado con éxito".Raw Baileys media send result.
Example
Send document
Authorization header required.
Content-Type: multipart/form-data
Request fields
Country calling code — digits only, 2–3 characters (e.g.
"591").Local phone number — digits only, 8–15 characters (e.g.
"71234567").Optional custom filename shown to the recipient (e.g.
"Factura_Mayo_2025.pdf"). Falls back to the original uploaded filename if omitted.Document file to send. Maximum size: 15 MB. Files exceeding this limit are rejected with HTTP 400 and the message:
"El archivo es demasiado pesado. El límite máximo permitido es de 15 MB.".Response
true on successful delivery."Documento enviado con éxito".Raw Baileys media send result.
Example
Send message to group
@g.us identifier). Retrieve group JIDs with GET /whatsapp/list-groups.
Access: Public — no Authorization header required.
Request body
The full Baileys JID of the target group (e.g.
"[email protected]"). Both groupId and message are validated server-side — a missing field returns HTTP 400.Content of the group broadcast message.
Response
true on successful delivery."Comunicado enviado al grupo con éxito".Raw Baileys message send result.
Example
List groups
id values when calling POST /whatsapp/send-to-group.
Access: Public — no Authorization header required.
Response
true.Array of group objects.
Example
Phone number format
All send endpoints (/send, /send-image, /send-document) accept code and phone as separate fields. The server concatenates them internally before building the WhatsApp JID:
+, no spaces, no parentheses. The code field must be 2–3 digits and phone must be 8–15 digits.