{"openapi":"3.0.3","info":{"title":"WaBaCRM WhatsApp API","version":"1.0.0","description":"Welcome to the WaBaCRM API documentation. The API offers endpoints to integrate and automate WhatsApp Web from your own software — a shop, CRM, ERP or automation tool (n8n, Make, Zapier).\n\nMessages are sent from **your own WhatsApp number**, through the WhatsApp Web tab where the WaBaCRM extension is running.\n\n### Getting started\n1. In WhatsApp Web open **WaBaCRM → API**, click **Generate Token** and switch **Enable/Disable API** on.\n2. Copy the token (it starts with `wat_`). It goes in the URL of every request: `/api/send-text/{token}`.\n3. Keep WhatsApp Web open on a computer. When the tab is closed, requests answer `501` and nothing is sent.\n\n### Phone numbers\nFull number with country code, digits only: `919876543210` (India), `14155550123` (USA). A group id such as `120363000000000000@g.us` is sent as-is.\n\n### Files\nImages, videos, documents and audio are sent as a base64 **data URL**, e.g. `data:image/jpeg;base64,/9j/4AAQ...` — up to 40 MB per file.\n\n### Moving from WaScript?\nThe Portuguese paths work too and behave identically: `/api/enviar-texto/{token}`, `/api/enviar-imagem/{token}`, `/api/enviar-video/{token}`, `/api/enviar-documento/{token}`, `/api/enviar-audio/{token}`, `/api/modificar-etiquetas/{token}`, `/api/listar-etiquetas/{token}`, `/api/criar-nota/{token}`. Only the domain changes."},"servers":[{"url":"https://login.waba-crm.com/ws-whatsapp-api","description":"WaBaCRM"}],"tags":[{"name":"Messages","description":"Send text, images, videos, documents and audio."},{"name":"Labels","description":"Manage WhatsApp labels."},{"name":"Notes","description":"Create notes on contacts."},{"name":"Connection","description":"Check that WhatsApp Web is online."}],"paths":{"/api/send-video/{token}":{"post":{"tags":["Messages"],"summary":"Send a video","description":"Receives a video in base64 and sends it, with an optional caption.","operationId":"sendVideo","parameters":[{"name":"token","in":"path","required":true,"description":"Your API token (WaBaCRM → API → Generate Token)","schema":{"type":"string","example":"wat_9c07c9b0020242f66cf34167c49483be"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone","base64"],"properties":{"phone":{"type":"string","description":"Phone number the message is sent to — country code + number, digits only","example":"919876543210"},"base64":{"type":"string","description":"File as a base64 data URL","example":"data:video/mp4;base64,..."},"message":{"type":"string","description":"Caption (optional)"}}},"example":{"phone":"919876543210","base64":"data:video/mp4;base64,AAAAIGZ0eXBpc29t...","message":"Please see the attached video."}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"success":true,"message":"Video sent successfully"}}}},"400":{"description":"Invalid request — a required field is missing","content":{"application/json":{"example":{"success":false,"message":"phone and message are required","error":"VALIDATION"}}}},"402":{"description":"The base64 file exceeds the size limit","content":{"application/json":{"example":{"success":false,"message":"The base64 file exceeds the 40 MB limit","error":"FILE_TOO_LARGE"}}}},"403":{"description":"The license for this token is inactive or expired","content":{"application/json":{"example":{"success":false,"message":"The WaBaCRM license for this token is inactive or expired","error":"LICENSE_EXPIRED"}}}},"404":{"description":"Token not registered","content":{"application/json":{"example":{"success":false,"message":"Token not registered","error":"TOKEN_NOT_FOUND"}}}},"424":{"description":"Invalid phone number","content":{"application/json":{"example":{"success":false,"message":"Invalid phone number","error":"INVALID_PHONE"}}}},"500":{"description":"Server error","content":{"application/json":{"example":{"success":false,"message":"Server error. Please try again later.","error":"SERVER_ERROR"}}}},"501":{"description":"WhatsApp Web is not open or the API is disconnected","content":{"application/json":{"example":{"success":false,"message":"WhatsApp Web is not open or the API is disconnected.","error":"WHATSAPP_OFFLINE"}}}}}}},"/api/send-text/{token}":{"get":{"tags":["Messages"],"summary":"Send a text message (GET)","description":"Sends a text message to a phone number using a simple GET link — handy for tools that can only open a URL.","operationId":"sendTextGet","parameters":[{"name":"token","in":"path","required":true,"description":"Your API token (WaBaCRM → API → Generate Token)","schema":{"type":"string","example":"wat_9c07c9b0020242f66cf34167c49483be"}},{"name":"phone","in":"query","required":true,"description":"Phone number the message is sent to — country code + number, digits only","schema":{"type":"string"},"example":"919876543210"},{"name":"message","in":"query","required":true,"description":"Text of the message. WhatsApp formatting works: *bold*, _italic_, ~strike~","schema":{"type":"string"},"example":"Hello, this is a sample message!"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"success":true,"message":"Message sent successfully"}}}},"400":{"description":"Invalid request — a required field is missing","content":{"application/json":{"example":{"success":false,"message":"phone and message are required","error":"VALIDATION"}}}},"403":{"description":"The license for this token is inactive or expired","content":{"application/json":{"example":{"success":false,"message":"The WaBaCRM license for this token is inactive or expired","error":"LICENSE_EXPIRED"}}}},"404":{"description":"Token not registered","content":{"application/json":{"example":{"success":false,"message":"Token not registered","error":"TOKEN_NOT_FOUND"}}}},"424":{"description":"Invalid phone number","content":{"application/json":{"example":{"success":false,"message":"Invalid phone number","error":"INVALID_PHONE"}}}},"500":{"description":"Server error","content":{"application/json":{"example":{"success":false,"message":"Server error. Please try again later.","error":"SERVER_ERROR"}}}},"501":{"description":"WhatsApp Web is not open or the API is disconnected","content":{"application/json":{"example":{"success":false,"message":"WhatsApp Web is not open or the API is disconnected.","error":"WHATSAPP_OFFLINE"}}}}}},"post":{"tags":["Messages"],"summary":"Send a text message","description":"Sends a text message to a phone number on WhatsApp.","operationId":"sendText","parameters":[{"name":"token","in":"path","required":true,"description":"Your API token (WaBaCRM → API → Generate Token)","schema":{"type":"string","example":"wat_9c07c9b0020242f66cf34167c49483be"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone","message"],"properties":{"phone":{"type":"string","description":"Phone number the message is sent to — country code + number, digits only","example":"919876543210"},"message":{"type":"string","description":"Text of the message. WhatsApp formatting works: *bold*, _italic_, ~strike~"}}},"example":{"phone":"919876543210","message":"Hello! Your order #1042 has been shipped."}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"success":true,"message":"Message sent successfully"}}}},"400":{"description":"Invalid request — a required field is missing","content":{"application/json":{"example":{"success":false,"message":"phone and message are required","error":"VALIDATION"}}}},"403":{"description":"The license for this token is inactive or expired","content":{"application/json":{"example":{"success":false,"message":"The WaBaCRM license for this token is inactive or expired","error":"LICENSE_EXPIRED"}}}},"404":{"description":"Token not registered","content":{"application/json":{"example":{"success":false,"message":"Token not registered","error":"TOKEN_NOT_FOUND"}}}},"424":{"description":"Invalid phone number","content":{"application/json":{"example":{"success":false,"message":"Invalid phone number","error":"INVALID_PHONE"}}}},"500":{"description":"Server error","content":{"application/json":{"example":{"success":false,"message":"Server error. Please try again later.","error":"SERVER_ERROR"}}}},"501":{"description":"WhatsApp Web is not open or the API is disconnected","content":{"application/json":{"example":{"success":false,"message":"WhatsApp Web is not open or the API is disconnected.","error":"WHATSAPP_OFFLINE"}}}}}}},"/api/send-image/{token}":{"post":{"tags":["Messages"],"summary":"Send an image","description":"Receives an image in base64 and sends it, with an optional caption.","operationId":"sendImage","parameters":[{"name":"token","in":"path","required":true,"description":"Your API token (WaBaCRM → API → Generate Token)","schema":{"type":"string","example":"wat_9c07c9b0020242f66cf34167c49483be"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone","base64"],"properties":{"phone":{"type":"string","description":"Phone number the message is sent to — country code + number, digits only","example":"919876543210"},"base64":{"type":"string","description":"File as a base64 data URL","example":"data:image/png;base64,..."},"message":{"type":"string","description":"Caption (optional)"}}},"example":{"phone":"919876543210","base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...","message":"Our new catalogue"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"success":true,"message":"Image sent successfully"}}}},"400":{"description":"Invalid request — a required field is missing","content":{"application/json":{"example":{"success":false,"message":"phone and message are required","error":"VALIDATION"}}}},"402":{"description":"The base64 file exceeds the size limit","content":{"application/json":{"example":{"success":false,"message":"The base64 file exceeds the 40 MB limit","error":"FILE_TOO_LARGE"}}}},"403":{"description":"The license for this token is inactive or expired","content":{"application/json":{"example":{"success":false,"message":"The WaBaCRM license for this token is inactive or expired","error":"LICENSE_EXPIRED"}}}},"404":{"description":"Token not registered","content":{"application/json":{"example":{"success":false,"message":"Token not registered","error":"TOKEN_NOT_FOUND"}}}},"424":{"description":"Invalid phone number","content":{"application/json":{"example":{"success":false,"message":"Invalid phone number","error":"INVALID_PHONE"}}}},"500":{"description":"Server error","content":{"application/json":{"example":{"success":false,"message":"Server error. Please try again later.","error":"SERVER_ERROR"}}}},"501":{"description":"WhatsApp Web is not open or the API is disconnected","content":{"application/json":{"example":{"success":false,"message":"WhatsApp Web is not open or the API is disconnected.","error":"WHATSAPP_OFFLINE"}}}}}}},"/api/send-document/{token}":{"post":{"tags":["Messages"],"summary":"Send a document","description":"Receives any file (PDF, XLSX, DOCX, ZIP…) in base64 and sends it as a document.","operationId":"sendDocument","parameters":[{"name":"token","in":"path","required":true,"description":"Your API token (WaBaCRM → API → Generate Token)","schema":{"type":"string","example":"wat_9c07c9b0020242f66cf34167c49483be"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone","base64"],"properties":{"phone":{"type":"string","description":"Phone number the message is sent to — country code + number, digits only","example":"919876543210"},"base64":{"type":"string","description":"File as a base64 data URL","example":"data:application/pdf;base64,..."},"name":{"type":"string","description":"File name the recipient sees (optional)"}}},"example":{"phone":"919876543210","base64":"data:application/pdf;base64,JVBERi0xLjQK...","name":"Invoice-1042.pdf"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"success":true,"message":"Document sent successfully"}}}},"400":{"description":"Invalid request — a required field is missing","content":{"application/json":{"example":{"success":false,"message":"phone and message are required","error":"VALIDATION"}}}},"402":{"description":"The base64 file exceeds the size limit","content":{"application/json":{"example":{"success":false,"message":"The base64 file exceeds the 40 MB limit","error":"FILE_TOO_LARGE"}}}},"403":{"description":"The license for this token is inactive or expired","content":{"application/json":{"example":{"success":false,"message":"The WaBaCRM license for this token is inactive or expired","error":"LICENSE_EXPIRED"}}}},"404":{"description":"Token not registered","content":{"application/json":{"example":{"success":false,"message":"Token not registered","error":"TOKEN_NOT_FOUND"}}}},"424":{"description":"Invalid phone number","content":{"application/json":{"example":{"success":false,"message":"Invalid phone number","error":"INVALID_PHONE"}}}},"500":{"description":"Server error","content":{"application/json":{"example":{"success":false,"message":"Server error. Please try again later.","error":"SERVER_ERROR"}}}},"501":{"description":"WhatsApp Web is not open or the API is disconnected","content":{"application/json":{"example":{"success":false,"message":"WhatsApp Web is not open or the API is disconnected.","error":"WHATSAPP_OFFLINE"}}}}}}},"/api/send-audio/{token}":{"post":{"tags":["Messages"],"summary":"Send an audio","description":"Receives audio in base64 (MP3, OGG, M4A) and sends it as a voice message.","operationId":"sendAudio","parameters":[{"name":"token","in":"path","required":true,"description":"Your API token (WaBaCRM → API → Generate Token)","schema":{"type":"string","example":"wat_9c07c9b0020242f66cf34167c49483be"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone","base64"],"properties":{"phone":{"type":"string","description":"Phone number the message is sent to — country code + number, digits only","example":"919876543210"},"base64":{"type":"string","description":"File as a base64 data URL","example":"data:audio/mp3;base64,..."}}},"example":{"phone":"919876543210","base64":"data:audio/mp3;base64,SUQzBAAAAA..."}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"success":true,"message":"Audio sent successfully"}}}},"400":{"description":"Invalid request — a required field is missing","content":{"application/json":{"example":{"success":false,"message":"phone and message are required","error":"VALIDATION"}}}},"402":{"description":"The base64 file exceeds the size limit","content":{"application/json":{"example":{"success":false,"message":"The base64 file exceeds the 40 MB limit","error":"FILE_TOO_LARGE"}}}},"403":{"description":"The license for this token is inactive or expired","content":{"application/json":{"example":{"success":false,"message":"The WaBaCRM license for this token is inactive or expired","error":"LICENSE_EXPIRED"}}}},"404":{"description":"Token not registered","content":{"application/json":{"example":{"success":false,"message":"Token not registered","error":"TOKEN_NOT_FOUND"}}}},"424":{"description":"Invalid phone number","content":{"application/json":{"example":{"success":false,"message":"Invalid phone number","error":"INVALID_PHONE"}}}},"500":{"description":"Server error","content":{"application/json":{"example":{"success":false,"message":"Server error. Please try again later.","error":"SERVER_ERROR"}}}},"501":{"description":"WhatsApp Web is not open or the API is disconnected","content":{"application/json":{"example":{"success":false,"message":"WhatsApp Web is not open or the API is disconnected.","error":"WHATSAPP_OFFLINE"}}}}}}},"/api/modify-labels/{token}":{"post":{"tags":["Labels"],"summary":"Add or remove labels","description":"Adds or removes several labels on one or more numbers at once. Get label ids from List labels.","operationId":"modifyLabels","parameters":[{"name":"token","in":"path","required":true,"description":"Your API token (WaBaCRM → API → Generate Token)","schema":{"type":"string","example":"wat_9c07c9b0020242f66cf34167c49483be"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone","actions"],"properties":{"phone":{"type":"array","description":"One or more phone numbers","items":{"type":"string"}},"actions":{"type":"array","description":"Label changes: labelId + type (\"add\" or \"remove\")","items":{"type":"object","required":["labelId","type"],"properties":{"labelId":{"type":"string"},"type":{"type":"string","enum":["add","remove"]}}}}}},"example":{"phone":["919876543210","919812345678"],"actions":[{"labelId":"1","type":"add"},{"labelId":"2","type":"remove"}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"success":true,"message":"Labels updated successfully","results":[{"phone":"919876543210","success":true,"actions":[{"success":true,"type":"add","labelId":"1","phone":"919876543210@c.us"},{"success":true,"type":"remove","labelId":"2","phone":"919876543210@c.us"}]}]}}}},"400":{"description":"Invalid request — a required field is missing","content":{"application/json":{"example":{"success":false,"message":"phone and message are required","error":"VALIDATION"}}}},"403":{"description":"The license for this token is inactive or expired","content":{"application/json":{"example":{"success":false,"message":"The WaBaCRM license for this token is inactive or expired","error":"LICENSE_EXPIRED"}}}},"404":{"description":"Token not registered","content":{"application/json":{"example":{"success":false,"message":"Token not registered","error":"TOKEN_NOT_FOUND"}}}},"406":{"description":"Chat not found","content":{"application/json":{"example":{"success":false,"message":"Chat not found in the WhatsApp inbox","error":"CHAT_NOT_FOUND","id":"919876543210"}}}},"422":{"description":"Invalid labelId or type","content":{"application/json":{"example":{"success":false,"message":"Each action must contain a valid labelId and type (\"add\" or \"remove\").","error":"VALIDATION","example":{"actions":{"labelId":"1","type":"add"}}}}}},"424":{"description":"Invalid phone number","content":{"application/json":{"example":{"success":false,"message":"Invalid phone number","error":"INVALID_PHONE"}}}},"500":{"description":"Server error","content":{"application/json":{"example":{"success":false,"message":"Server error. Please try again later.","error":"SERVER_ERROR"}}}},"501":{"description":"WhatsApp Web is not open or the API is disconnected","content":{"application/json":{"example":{"success":false,"message":"WhatsApp Web is not open or the API is disconnected.","error":"WHATSAPP_OFFLINE"}}}},"504":{"description":"Timeout — WhatsApp Web did not answer","content":{"application/json":{"example":{"success":false,"message":"Timeout - WhatsApp Web did not answer.","error":"WHATSAPP_TIMEOUT"}}}}}}},"/api/list-labels/{token}":{"get":{"tags":["Labels"],"summary":"List labels","description":"Returns the labels (WhatsApp Business) or lists (newer WhatsApp) of the connected account.","operationId":"listLabels","parameters":[{"name":"token","in":"path","required":true,"description":"Your API token (WaBaCRM → API → Generate Token)","schema":{"type":"string","example":"wat_9c07c9b0020242f66cf34167c49483be"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"success":true,"message":"Labels retrieved successfully","labels":[{"id":"1","name":"New customer","color":0},{"id":"2","name":"Paid","color":4}]}}}},"403":{"description":"The license for this token is inactive or expired","content":{"application/json":{"example":{"success":false,"message":"The WaBaCRM license for this token is inactive or expired","error":"LICENSE_EXPIRED"}}}},"404":{"description":"Token not registered","content":{"application/json":{"example":{"success":false,"message":"Token not registered","error":"TOKEN_NOT_FOUND"}}}},"500":{"description":"Server error","content":{"application/json":{"example":{"success":false,"message":"Server error. Please try again later.","error":"SERVER_ERROR"}}}},"501":{"description":"WhatsApp Web is not open or the API is disconnected","content":{"application/json":{"example":{"success":false,"message":"WhatsApp Web is not open or the API is disconnected.","error":"WHATSAPP_OFFLINE"}}}},"504":{"description":"Timeout — WhatsApp Web did not answer","content":{"application/json":{"example":{"success":false,"message":"Timeout - could not retrieve the labels.","error":"WHATSAPP_TIMEOUT"}}}}}}},"/api/create-note/{token}":{"post":{"tags":["Notes"],"summary":"Create a note","description":"Saves a note on a contact in WaBaCRM, optionally with an attached file.","operationId":"createNote","parameters":[{"name":"token","in":"path","required":true,"description":"Your API token (WaBaCRM → API → Generate Token)","schema":{"type":"string","example":"wat_9c07c9b0020242f66cf34167c49483be"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userID","text"],"properties":{"userID":{"type":"string","description":"Phone number of the contact the note belongs to","example":"919876543210"},"text":{"type":"string","description":"Text of the note"},"base64":{"type":"string","description":"Attachment as a base64 data URL (optional)"}}},"example":{"userID":"919876543210","text":"Called back — wants a quote for 50 units.","base64":"data:application/pdf;base64,JVBERi0xLjQK..."}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"success":true,"message":"Note created successfully"}}}},"400":{"description":"Invalid request — a required field is missing","content":{"application/json":{"example":{"success":false,"message":"phone and message are required","error":"VALIDATION"}}}},"402":{"description":"The base64 file exceeds the size limit","content":{"application/json":{"example":{"success":false,"message":"The base64 file exceeds the 40 MB limit","error":"FILE_TOO_LARGE"}}}},"403":{"description":"The license for this token is inactive or expired","content":{"application/json":{"example":{"success":false,"message":"The WaBaCRM license for this token is inactive or expired","error":"LICENSE_EXPIRED"}}}},"404":{"description":"Token not registered","content":{"application/json":{"example":{"success":false,"message":"Token not registered","error":"TOKEN_NOT_FOUND"}}}},"424":{"description":"Invalid phone number","content":{"application/json":{"example":{"success":false,"message":"Invalid phone number","error":"INVALID_PHONE"}}}},"500":{"description":"Server error","content":{"application/json":{"example":{"success":false,"message":"Server error. Please try again later.","error":"SERVER_ERROR"}}}},"501":{"description":"WhatsApp Web is not open or the API is disconnected","content":{"application/json":{"example":{"success":false,"message":"WhatsApp Web is not open or the API is disconnected.","error":"WHATSAPP_OFFLINE"}}}}}}},"/api/status/{token}":{"get":{"tags":["Connection"],"summary":"Connection status","description":"Tells whether WhatsApp Web is open with the API switched on.","operationId":"status","parameters":[{"name":"token","in":"path","required":true,"description":"Your API token (WaBaCRM → API → Generate Token)","schema":{"type":"string","example":"wat_9c07c9b0020242f66cf34167c49483be"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"success":true,"message":"WhatsApp Web is connected","online":true}}}},"403":{"description":"The license for this token is inactive or expired","content":{"application/json":{"example":{"success":false,"message":"The WaBaCRM license for this token is inactive or expired","error":"LICENSE_EXPIRED"}}}},"404":{"description":"Token not registered","content":{"application/json":{"example":{"success":false,"message":"Token not registered","error":"TOKEN_NOT_FOUND"}}}}}}}}}