{ "openapi": "3.0.3", "info": { "title": "@fazer-ai/baileys-api", "description": "Baileys API for WhatsApp. [See on GitHub](https://github.com/fazer-ai/baileys-api.git)", "version": "1.0.0" }, "servers": [ { "url": "http://localhost:3025", "description": "Local development server" }, { "url": "{scheme}://{customUrl}", "description": "Custom server", "variables": { "scheme": { "enum": [ "http", "https" ], "default": "https", "description": "HTTP or HTTPS" }, "customUrl": { "default": "your-domain.com", "description": "Your API domain (without protocol)" } } } ], "tags": [ { "name": "Status", "description": "Fetch server status" }, { "name": "Connections", "description": "WhatsApp connections operations" }, { "name": "Admin", "description": "Admin operations" }, { "name": "Media", "description": "Retrieve media content from a message" }, { "name": "Cluster", "description": "Instance health and cluster identity" } ], "components": { "securitySchemes": { "xApiKey": { "type": "apiKey", "in": "header", "name": "x-api-key", "description": "API key. See scripts/manage-api-keys.ts" } }, "schemas": {} }, "paths": { "/status": { "get": { "operationId": "getStatus", "tags": [ "Status" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Server running", "content": { "application/json": { "schema": { "type": "object", "properties": { "packageInfo": { "type": "object", "properties": { "name": { "type": "string", "example": "baileys-api" }, "version": { "type": "string", "example": "1.0.0" }, "description": { "type": "string" }, "repository": { "type": "object", "properties": { "type": { "type": "string", "example": "git" }, "url": { "type": "string", "example": "https://github.com/fazer-ai/baileys-api.git" } } } } }, "port": { "type": "number", "example": 3025 }, "env": { "type": "string", "enum": [ "development", "production" ], "example": "development" }, "logLevel": { "type": "string", "example": "info" }, "baileys": { "type": "object", "properties": { "logLevel": { "type": "string", "example": "warn" }, "clientVersion": { "type": "string", "example": "default" }, "ignoreGroupMessages": { "type": "boolean", "example": false }, "ignoreStatusMessages": { "type": "boolean", "example": true }, "ignoreBroadcastMessages": { "type": "boolean", "example": true }, "ignoreNewsletterMessages": { "type": "boolean", "example": true }, "ignoreBotMessages": { "type": "boolean", "example": true }, "ignoreMetaAiMessages": { "type": "boolean", "example": true } } }, "redis": { "type": "object", "properties": { "url": { "type": "string", "example": "redis://localhost:6379" }, "password": { "type": "string", "example": "********", "description": "Omitted password" } } }, "webhook": { "type": "object", "properties": { "retryPolicy": { "type": "object", "properties": { "maxRetries": { "type": "number", "example": 3 }, "retryInterval": { "type": "number", "example": 5000 }, "backoffFactor": { "type": "number", "example": 3 } } } } }, "corsOrigin": { "type": "string", "example": "localhost" }, "keyStore": { "type": "object", "properties": { "lruCacheMax": { "type": "number", "example": 100 }, "lruCacheTtl": { "type": "number", "example": 600000 } } } } } } } } } } }, "/status/auth": { "get": { "operationId": "getStatusAuth", "tags": [ "Status" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Authenticated" } } } }, "/admin/connections/logout-all": { "post": { "operationId": "postAdminConnectionsLogout-all", "tags": [ "Admin" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Initiated logout for all connections" } } } }, "/connections/{phoneNumber}": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumber", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Connection initiated" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "409": { "description": "Conflict — in cluster mode, the connection is owned by another live instance (id in the x-baileys-owner header); a proxy re-routes the takeover there instead of stealing a healthy socket.", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "clientName": { "description": "Name of the client to be used on WhatsApp connection", "example": "My WhatsApp Client", "type": "string" }, "webhookUrl": { "format": "uri", "description": "URL for receiving updates", "example": "http://localhost:3026/whatsapp/+1234567890", "type": "string" }, "webhookVerifyToken": { "minLength": 6, "description": "Token for verifying webhook", "example": "a3f4b2", "type": "string" }, "includeMedia": { "description": "Include media in messages.upsert event payload as base64 string", "default": true, "type": "boolean" }, "syncFullHistory": { "description": "Sync full history of messages on connection.", "default": false, "type": "boolean" }, "groupsEnabled": { "description": "Enable full group message processing. When false, group messages are accumulated and sent as activity summaries.", "default": true, "type": "boolean" }, "autoPresenceSubscribe": { "description": "Automatically subscribe to presence updates when sending/receiving messages or typing status to/from a contact. Subscriptions are ephemeral and re-established automatically.", "default": false, "type": "boolean" } }, "required": [ "webhookUrl", "webhookVerifyToken" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "clientName": { "description": "Name of the client to be used on WhatsApp connection", "example": "My WhatsApp Client", "type": "string" }, "webhookUrl": { "format": "uri", "description": "URL for receiving updates", "example": "http://localhost:3026/whatsapp/+1234567890", "type": "string" }, "webhookVerifyToken": { "minLength": 6, "description": "Token for verifying webhook", "example": "a3f4b2", "type": "string" }, "includeMedia": { "description": "Include media in messages.upsert event payload as base64 string", "default": true, "type": "boolean" }, "syncFullHistory": { "description": "Sync full history of messages on connection.", "default": false, "type": "boolean" }, "groupsEnabled": { "description": "Enable full group message processing. When false, group messages are accumulated and sent as activity summaries.", "default": true, "type": "boolean" }, "autoPresenceSubscribe": { "description": "Automatically subscribe to presence updates when sending/receiving messages or typing status to/from a contact. Subscriptions are ephemeral and re-established automatically.", "default": false, "type": "boolean" } }, "required": [ "webhookUrl", "webhookVerifyToken" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "clientName": { "description": "Name of the client to be used on WhatsApp connection", "example": "My WhatsApp Client", "type": "string" }, "webhookUrl": { "format": "uri", "description": "URL for receiving updates", "example": "http://localhost:3026/whatsapp/+1234567890", "type": "string" }, "webhookVerifyToken": { "minLength": 6, "description": "Token for verifying webhook", "example": "a3f4b2", "type": "string" }, "includeMedia": { "description": "Include media in messages.upsert event payload as base64 string", "default": true, "type": "boolean" }, "syncFullHistory": { "description": "Sync full history of messages on connection.", "default": false, "type": "boolean" }, "groupsEnabled": { "description": "Enable full group message processing. When false, group messages are accumulated and sent as activity summaries.", "default": true, "type": "boolean" }, "autoPresenceSubscribe": { "description": "Automatically subscribe to presence updates when sending/receiving messages or typing status to/from a contact. Subscriptions are ephemeral and re-established automatically.", "default": false, "type": "boolean" } }, "required": [ "webhookUrl", "webhookVerifyToken" ] } } } } }, "delete": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "deleteConnectionsByPhoneNumber", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Disconnected (auth state cleared)" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "409": { "description": "Owned by another live instance (worker role)" }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } } } }, "/connections/{phoneNumber}/import-session": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberImport-session", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "202": { "description": "Session import accepted; connecting" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "409": { "description": "Conflict — in cluster mode, the connection is owned by another live instance (id in the x-baileys-owner header).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } }, "422": { "description": "Unprocessable Entity — the requested noise candidate index is out of range." } }, "summary": "Import an extracted WhatsApp Web session (no QR)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "session": { "description": "Impersonation credentials — never log this object. Transported over HTTPS only.", "type": "object", "properties": { "noiseCandidates": { "minItems": 1, "maxItems": 20, "description": "Noise keypair candidates (base64). Only one is the real pair; the server cycles them until the socket opens.", "type": "array", "items": { "type": "object", "properties": { "private": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "public": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "private", "public" ] } }, "identityKey": { "type": "object", "properties": { "private": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "public": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "private", "public" ] }, "registrationId": { "type": "number" }, "advSecretKey": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "description": "ADV secret key (base64)", "type": "string" }, "account": { "type": "object", "properties": { "details": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "accountSignatureKey": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "accountSignature": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "deviceSignature": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "details", "accountSignatureKey", "accountSignature", "deviceSignature" ] }, "id": { "description": "Companion device JID", "example": "551101234567:12@s.whatsapp.net", "type": "string" }, "lid": { "type": "string" }, "platform": { "type": "string" }, "signedPreKey": { "type": "object", "properties": { "keyId": { "type": "number" }, "private": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "public": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "signature": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "keyId", "private", "public", "signature" ] }, "pushName": { "type": "string" }, "routingInfo": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "noiseCandidates", "identityKey", "registrationId", "advSecretKey", "account", "id" ] }, "candidateIndex": { "minimum": 0, "default": 0, "description": "Index into session.noiseCandidates to try first (only one candidate is the real pair).", "type": "number" }, "clientName": { "description": "Name of the client to be used on WhatsApp connection", "example": "My WhatsApp Client", "type": "string" }, "webhookUrl": { "format": "uri", "description": "URL for receiving updates", "example": "http://localhost:3026/whatsapp/+1234567890", "type": "string" }, "webhookVerifyToken": { "minLength": 6, "description": "Token for verifying webhook", "example": "a3f4b2", "type": "string" }, "includeMedia": { "description": "Include media in messages.upsert event payload as base64 string", "default": true, "type": "boolean" }, "syncFullHistory": { "description": "Sync full history of messages on connection.", "default": false, "type": "boolean" }, "groupsEnabled": { "description": "Enable full group message processing. When false, group messages are accumulated and sent as activity summaries.", "default": true, "type": "boolean" }, "autoPresenceSubscribe": { "description": "Automatically subscribe to presence updates when sending/receiving messages or typing status to/from a contact. Subscriptions are ephemeral and re-established automatically.", "default": false, "type": "boolean" } }, "required": [ "session", "webhookUrl", "webhookVerifyToken" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "session": { "description": "Impersonation credentials — never log this object. Transported over HTTPS only.", "type": "object", "properties": { "noiseCandidates": { "minItems": 1, "maxItems": 20, "description": "Noise keypair candidates (base64). Only one is the real pair; the server cycles them until the socket opens.", "type": "array", "items": { "type": "object", "properties": { "private": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "public": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "private", "public" ] } }, "identityKey": { "type": "object", "properties": { "private": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "public": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "private", "public" ] }, "registrationId": { "type": "number" }, "advSecretKey": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "description": "ADV secret key (base64)", "type": "string" }, "account": { "type": "object", "properties": { "details": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "accountSignatureKey": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "accountSignature": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "deviceSignature": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "details", "accountSignatureKey", "accountSignature", "deviceSignature" ] }, "id": { "description": "Companion device JID", "example": "551101234567:12@s.whatsapp.net", "type": "string" }, "lid": { "type": "string" }, "platform": { "type": "string" }, "signedPreKey": { "type": "object", "properties": { "keyId": { "type": "number" }, "private": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "public": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "signature": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "keyId", "private", "public", "signature" ] }, "pushName": { "type": "string" }, "routingInfo": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "noiseCandidates", "identityKey", "registrationId", "advSecretKey", "account", "id" ] }, "candidateIndex": { "minimum": 0, "default": 0, "description": "Index into session.noiseCandidates to try first (only one candidate is the real pair).", "type": "number" }, "clientName": { "description": "Name of the client to be used on WhatsApp connection", "example": "My WhatsApp Client", "type": "string" }, "webhookUrl": { "format": "uri", "description": "URL for receiving updates", "example": "http://localhost:3026/whatsapp/+1234567890", "type": "string" }, "webhookVerifyToken": { "minLength": 6, "description": "Token for verifying webhook", "example": "a3f4b2", "type": "string" }, "includeMedia": { "description": "Include media in messages.upsert event payload as base64 string", "default": true, "type": "boolean" }, "syncFullHistory": { "description": "Sync full history of messages on connection.", "default": false, "type": "boolean" }, "groupsEnabled": { "description": "Enable full group message processing. When false, group messages are accumulated and sent as activity summaries.", "default": true, "type": "boolean" }, "autoPresenceSubscribe": { "description": "Automatically subscribe to presence updates when sending/receiving messages or typing status to/from a contact. Subscriptions are ephemeral and re-established automatically.", "default": false, "type": "boolean" } }, "required": [ "session", "webhookUrl", "webhookVerifyToken" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "session": { "description": "Impersonation credentials — never log this object. Transported over HTTPS only.", "type": "object", "properties": { "noiseCandidates": { "minItems": 1, "maxItems": 20, "description": "Noise keypair candidates (base64). Only one is the real pair; the server cycles them until the socket opens.", "type": "array", "items": { "type": "object", "properties": { "private": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "public": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "private", "public" ] } }, "identityKey": { "type": "object", "properties": { "private": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "public": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "private", "public" ] }, "registrationId": { "type": "number" }, "advSecretKey": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "description": "ADV secret key (base64)", "type": "string" }, "account": { "type": "object", "properties": { "details": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "accountSignatureKey": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "accountSignature": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "deviceSignature": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "details", "accountSignatureKey", "accountSignature", "deviceSignature" ] }, "id": { "description": "Companion device JID", "example": "551101234567:12@s.whatsapp.net", "type": "string" }, "lid": { "type": "string" }, "platform": { "type": "string" }, "signedPreKey": { "type": "object", "properties": { "keyId": { "type": "number" }, "private": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "public": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "signature": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "keyId", "private", "public", "signature" ] }, "pushName": { "type": "string" }, "routingInfo": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" } }, "required": [ "noiseCandidates", "identityKey", "registrationId", "advSecretKey", "account", "id" ] }, "candidateIndex": { "minimum": 0, "default": 0, "description": "Index into session.noiseCandidates to try first (only one candidate is the real pair).", "type": "number" }, "clientName": { "description": "Name of the client to be used on WhatsApp connection", "example": "My WhatsApp Client", "type": "string" }, "webhookUrl": { "format": "uri", "description": "URL for receiving updates", "example": "http://localhost:3026/whatsapp/+1234567890", "type": "string" }, "webhookVerifyToken": { "minLength": 6, "description": "Token for verifying webhook", "example": "a3f4b2", "type": "string" }, "includeMedia": { "description": "Include media in messages.upsert event payload as base64 string", "default": true, "type": "boolean" }, "syncFullHistory": { "description": "Sync full history of messages on connection.", "default": false, "type": "boolean" }, "groupsEnabled": { "description": "Enable full group message processing. When false, group messages are accumulated and sent as activity summaries.", "default": true, "type": "boolean" }, "autoPresenceSubscribe": { "description": "Automatically subscribe to presence updates when sending/receiving messages or typing status to/from a contact. Subscriptions are ephemeral and re-established automatically.", "default": false, "type": "boolean" } }, "required": [ "session", "webhookUrl", "webhookVerifyToken" ] } } } } } }, "/connections/{phoneNumber}/presence": { "patch": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "patchConnectionsByPhoneNumberPresence", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Presence update sent successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "unavailable", "available", "composing", "recording", "paused" ], "description": "Presence type. `available` is automatically reset to `unavailable` after 60s. `composing` and `recording` are automatically held for ~25s by WhatsApp. `paused` can be used to reset `composing` and `recording` early.", "example": "available" }, "toJid": { "description": "WhatsApp JID [Required for `composing`, `recording`, and `paused`]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" } }, "required": [ "type" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "unavailable", "available", "composing", "recording", "paused" ], "description": "Presence type. `available` is automatically reset to `unavailable` after 60s. `composing` and `recording` are automatically held for ~25s by WhatsApp. `paused` can be used to reset `composing` and `recording` early.", "example": "available" }, "toJid": { "description": "WhatsApp JID [Required for `composing`, `recording`, and `paused`]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" } }, "required": [ "type" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "unavailable", "available", "composing", "recording", "paused" ], "description": "Presence type. `available` is automatically reset to `unavailable` after 60s. `composing` and `recording` are automatically held for ~25s by WhatsApp. `paused` can be used to reset `composing` and `recording` early.", "example": "available" }, "toJid": { "description": "WhatsApp JID [Required for `composing`, `recording`, and `paused`]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" } }, "required": [ "type" ] } } } } } }, "/connections/{phoneNumber}/presence-subscribe": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberPresence-subscribe", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Presence subscription result" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Subscribe to presence updates for one or more JIDs. Presence updates will be forwarded via the `presence.update` webhook event. Subscriptions are ephemeral, so re-subscribe periodically for continuous monitoring. LID JIDs are automatically resolved to phone number JIDs before subscribing.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jids": { "description": "Array of JIDs to subscribe to presence updates", "minItems": 1, "maxItems": 50, "type": "array", "items": { "description": "WhatsApp JID [WhatsApp JID to subscribe to presence updates for]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" } } }, "required": [ "jids" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jids": { "description": "Array of JIDs to subscribe to presence updates", "minItems": 1, "maxItems": 50, "type": "array", "items": { "description": "WhatsApp JID [WhatsApp JID to subscribe to presence updates for]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" } } }, "required": [ "jids" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jids": { "description": "Array of JIDs to subscribe to presence updates", "minItems": 1, "maxItems": 50, "type": "array", "items": { "description": "WhatsApp JID [WhatsApp JID to subscribe to presence updates for]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" } } }, "required": [ "jids" ] } } } } } }, "/connections/{phoneNumber}/send-message": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberSend-message", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Message sent successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "messageTimestamp": { "type": "string" } }, "required": [ "key", "messageTimestamp" ] } }, "required": [ "data" ] } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "404": { "description": "Phone number not connected" }, "409": { "description": "Message is already being processed" }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } }, "500": { "description": "Message not sent" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "messageContent": { "anyOf": [ { "title": "Text message", "type": "object", "properties": { "text": { "description": "Text message", "example": "Hello world!", "type": "string" }, "mentions": { "type": "array", "items": { "description": "User JID [user to mention in group message]", "example": "551101234567@s.whatsapp.net", "type": "string" } }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "text" ] }, { "title": "Image message", "type": "object", "properties": { "image": { "description": "Base64 encoded image data", "type": "string" }, "caption": { "type": "string" }, "mimetype": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "image" ] }, { "title": "Video message", "type": "object", "properties": { "video": { "description": "Base64 encoded video data", "type": "string" }, "caption": { "type": "string" }, "mimetype": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "video" ] }, { "title": "Document message", "type": "object", "properties": { "document": { "description": "Base64 encoded document data", "type": "string" }, "fileName": { "type": "string" }, "mimetype": { "type": "string" }, "caption": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "document" ] }, { "title": "Audio message", "type": "object", "properties": { "audio": { "description": "Base64 encoded audio data", "type": "string" }, "ptt": { "type": "boolean" }, "mimetype": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "audio" ] }, { "title": "Reaction message", "type": "object", "properties": { "react": { "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "text": { "description": "Emoji to react with", "example": "👍", "type": "string" } }, "required": [ "key", "text" ] } }, "required": [ "react" ] } ] }, "chatwootMessageId": { "type": "string", "enum": [] }, "messageId": { "minLength": 1, "type": "string" } }, "required": [ "jid", "messageContent" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "messageContent": { "anyOf": [ { "title": "Text message", "type": "object", "properties": { "text": { "description": "Text message", "example": "Hello world!", "type": "string" }, "mentions": { "type": "array", "items": { "description": "User JID [user to mention in group message]", "example": "551101234567@s.whatsapp.net", "type": "string" } }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "text" ] }, { "title": "Image message", "type": "object", "properties": { "image": { "description": "Base64 encoded image data", "type": "string" }, "caption": { "type": "string" }, "mimetype": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "image" ] }, { "title": "Video message", "type": "object", "properties": { "video": { "description": "Base64 encoded video data", "type": "string" }, "caption": { "type": "string" }, "mimetype": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "video" ] }, { "title": "Document message", "type": "object", "properties": { "document": { "description": "Base64 encoded document data", "type": "string" }, "fileName": { "type": "string" }, "mimetype": { "type": "string" }, "caption": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "document" ] }, { "title": "Audio message", "type": "object", "properties": { "audio": { "description": "Base64 encoded audio data", "type": "string" }, "ptt": { "type": "boolean" }, "mimetype": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "audio" ] }, { "title": "Reaction message", "type": "object", "properties": { "react": { "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "text": { "description": "Emoji to react with", "example": "👍", "type": "string" } }, "required": [ "key", "text" ] } }, "required": [ "react" ] } ] }, "chatwootMessageId": { "type": "string", "enum": [] }, "messageId": { "minLength": 1, "type": "string" } }, "required": [ "jid", "messageContent" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "messageContent": { "anyOf": [ { "title": "Text message", "type": "object", "properties": { "text": { "description": "Text message", "example": "Hello world!", "type": "string" }, "mentions": { "type": "array", "items": { "description": "User JID [user to mention in group message]", "example": "551101234567@s.whatsapp.net", "type": "string" } }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "text" ] }, { "title": "Image message", "type": "object", "properties": { "image": { "description": "Base64 encoded image data", "type": "string" }, "caption": { "type": "string" }, "mimetype": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "image" ] }, { "title": "Video message", "type": "object", "properties": { "video": { "description": "Base64 encoded video data", "type": "string" }, "caption": { "type": "string" }, "mimetype": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "video" ] }, { "title": "Document message", "type": "object", "properties": { "document": { "description": "Base64 encoded document data", "type": "string" }, "fileName": { "type": "string" }, "mimetype": { "type": "string" }, "caption": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "document" ] }, { "title": "Audio message", "type": "object", "properties": { "audio": { "description": "Base64 encoded audio data", "type": "string" }, "ptt": { "type": "boolean" }, "mimetype": { "type": "string" }, "quotedMessage": { "description": "Message to reply to. Both key and message are required for the quoted message preview to appear correctly.", "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "message": { "description": "Original message content. This is required for the quoted message preview to appear correctly. Use the message object from the original messages.upsert webhook payload.", "example": { "conversation": "Hello!" }, "type": "object", "patternProperties": { "^(.*)$": {} } } }, "required": [ "key", "message" ] } }, "required": [ "audio" ] }, { "title": "Reaction message", "type": "object", "properties": { "react": { "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "text": { "description": "Emoji to react with", "example": "👍", "type": "string" } }, "required": [ "key", "text" ] } }, "required": [ "react" ] } ] }, "chatwootMessageId": { "type": "string", "enum": [] }, "messageId": { "minLength": 1, "type": "string" } }, "required": [ "jid", "messageContent" ] } } } } } }, "/connections/{phoneNumber}/read-messages": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberRead-messages", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Message read successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "keys": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } } } }, "required": [ "keys" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "keys": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } } } }, "required": [ "keys" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "keys": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } } } }, "required": [ "keys" ] } } } } } }, "/connections/{phoneNumber}/chat-modify": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberChat-modify", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Chat modification was successfully applied" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Currently only supports marking chats as read/unread with `markRead` + `lastMessages`.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "mod": { "title": "Mark read/unread", "type": "object", "properties": { "markRead": { "type": "boolean" }, "lastMessages": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "messageTimestamp": { "type": "number" } }, "required": [ "key", "messageTimestamp" ] } } }, "required": [ "markRead", "lastMessages" ] }, "jid": { "description": "WhatsApp JID", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" } }, "required": [ "mod", "jid" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "mod": { "title": "Mark read/unread", "type": "object", "properties": { "markRead": { "type": "boolean" }, "lastMessages": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "messageTimestamp": { "type": "number" } }, "required": [ "key", "messageTimestamp" ] } } }, "required": [ "markRead", "lastMessages" ] }, "jid": { "description": "WhatsApp JID", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" } }, "required": [ "mod", "jid" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "mod": { "title": "Mark read/unread", "type": "object", "properties": { "markRead": { "type": "boolean" }, "lastMessages": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "messageTimestamp": { "type": "number" } }, "required": [ "key", "messageTimestamp" ] } } }, "required": [ "markRead", "lastMessages" ] }, "jid": { "description": "WhatsApp JID", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" } }, "required": [ "mod", "jid" ] } } } } } }, "/connections/{phoneNumber}/fetch-message-history": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberFetch-message-history", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Message history fetched" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "count": { "minimum": 1, "maximum": 50, "description": "Number of messages to fetch", "example": 10, "type": "number" }, "oldestMsgKey": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "oldestMsgTimestamp": { "type": "number" } }, "required": [ "count", "oldestMsgKey", "oldestMsgTimestamp" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "count": { "minimum": 1, "maximum": 50, "description": "Number of messages to fetch", "example": 10, "type": "number" }, "oldestMsgKey": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "oldestMsgTimestamp": { "type": "number" } }, "required": [ "count", "oldestMsgKey", "oldestMsgTimestamp" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "count": { "minimum": 1, "maximum": 50, "description": "Number of messages to fetch", "example": 10, "type": "number" }, "oldestMsgKey": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "oldestMsgTimestamp": { "type": "number" } }, "required": [ "count", "oldestMsgKey", "oldestMsgTimestamp" ] } } } } } }, "/connections/{phoneNumber}/send-receipts": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberSend-receipts", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Receipts sent successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Sends read receipts for the provided message keys. Currently only supports sending `received` event. For `read` receipts, use `read-messages` endpoint.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "keys": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } } } }, "required": [ "keys" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "keys": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } } } }, "required": [ "keys" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "keys": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } } } }, "required": [ "keys" ] } } } } } }, "/connections/{phoneNumber}/messages": { "delete": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "deleteConnectionsByPhoneNumberMessages", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Message deleted successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Deletes a message for everyone in the chat. For group messages not sent by you, this requires admin privileges.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID [Chat JID where the message exists]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] } }, "required": [ "jid", "key" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID [Chat JID where the message exists]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] } }, "required": [ "jid", "key" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID [Chat JID where the message exists]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] } }, "required": [ "jid", "key" ] } } } } }, "patch": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "patchConnectionsByPhoneNumberMessages", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Message edited successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "key": { "type": "object", "properties": { "id": { "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } } }, "messageTimestamp": { "type": "string" } }, "required": [ "key", "messageTimestamp" ] } }, "required": [ "data" ] } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } }, "500": { "description": "Message not edited" } }, "description": "Edits a previously sent message. Only text messages (including captions) can be edited. The message must have been sent by you and must be within the editable time window (approximately 15 minutes).", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID [Chat JID where the message exists]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "messageContent": { "title": "Editable text message", "description": "Message content that can be edited. Only text messages can be edited on WhatsApp.", "type": "object", "properties": { "text": { "description": "New text content for the message", "example": "Updated message text", "type": "string" }, "mentions": { "type": "array", "items": { "description": "User JID [user to mention in group message]", "example": "551101234567@s.whatsapp.net", "type": "string" } } }, "required": [ "text" ] } }, "required": [ "jid", "key", "messageContent" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID [Chat JID where the message exists]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "messageContent": { "title": "Editable text message", "description": "Message content that can be edited. Only text messages can be edited on WhatsApp.", "type": "object", "properties": { "text": { "description": "New text content for the message", "example": "Updated message text", "type": "string" }, "mentions": { "type": "array", "items": { "description": "User JID [user to mention in group message]", "example": "551101234567@s.whatsapp.net", "type": "string" } } }, "required": [ "text" ] } }, "required": [ "jid", "key", "messageContent" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID [Chat JID where the message exists]", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "key": { "type": "object", "properties": { "id": { "description": "Message ID", "type": "string" }, "remoteJid": { "type": "string" }, "fromMe": { "type": "boolean" }, "participant": { "type": "string" } }, "required": [ "id" ] }, "messageContent": { "title": "Editable text message", "description": "Message content that can be edited. Only text messages can be edited on WhatsApp.", "type": "object", "properties": { "text": { "description": "New text content for the message", "example": "Updated message text", "type": "string" }, "mentions": { "type": "array", "items": { "description": "User JID [user to mention in group message]", "example": "551101234567@s.whatsapp.net", "type": "string" } } }, "required": [ "text" ] } }, "required": [ "jid", "key", "messageContent" ] } } } } } }, "/connections/{phoneNumber}/profile-picture-url": { "get": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true }, { "description": "WhatsApp JID", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "schema": { "type": "string" }, "in": "query", "name": "jid", "required": true }, { "description": "Picture quality type", "schema": { "default": "preview", "anyOf": [ { "title": "preview", "const": "preview", "type": "string" }, { "title": "image", "const": "image", "type": "string" } ] }, "in": "query", "name": "type", "required": false } ], "operationId": "getConnectionsByPhoneNumberProfile-picture-url", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Profile picture URL retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "jid": { "type": "string", "description": "WhatsApp JID of the phone number", "example": "551234567890@s.whatsapp.net" }, "profilePictureUrl": { "type": "string", "nullable": true, "example": "https://pps.whatsapp.net/v/t61.24694-24/..." } } } } } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "404": { "description": "Profile picture not found" }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } } } }, "/connections/{phoneNumber}/reachout-timelock": { "get": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "getConnectionsByPhoneNumberReachout-timelock", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Reach-out time-lock state retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "isActive": { "type": "boolean", "description": "Whether the reach-out time-lock is currently enforced", "example": false }, "timeEnforcementEnds": { "type": "string", "format": "date-time", "nullable": true, "description": "When the current enforcement window ends" }, "enforcementType": { "type": "string", "description": "Reason/type of enforcement. 'DEFAULT' means no restriction.", "example": "DEFAULT" } } } } } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "404": { "description": "Phone number not connected" }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Fetch the account's reach-out time-lock state — the restriction behind error 463 ('account restricted') that blocks starting new chats. Read-only: queries WhatsApp directly (MEX) without sending a message, so it is safe to call on a restricted account." } }, "/connections/{phoneNumber}/new-chat-cap": { "get": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "getConnectionsByPhoneNumberNew-chat-cap", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "New-chat message cap retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "total_quota": { "type": "number", "description": "Total new-chat messages allowed in the current cycle", "example": 100 }, "used_quota": { "type": "number", "description": "New-chat messages already used in the current cycle", "example": 0 }, "cycle_start_timestamp": { "type": "string", "nullable": true, "description": "Unix timestamp of the cycle start" }, "cycle_end_timestamp": { "type": "string", "nullable": true, "description": "Unix timestamp of the cycle end" }, "server_sent_timestamp": { "type": "string", "nullable": true, "description": "Unix timestamp when WhatsApp produced this snapshot" }, "ote_status": { "type": "string", "nullable": true, "description": "One-time-engagement cap status (NOT_ELIGIBLE, ELIGIBLE, ACTIVE_IN_CURRENT_CYCLE, EXHAUSTED)" }, "mv_status": { "type": "string", "nullable": true, "description": "Multi-vertical cap status (NOT_ELIGIBLE, NOT_ACTIVE, ACTIVE, ACTIVE_UPGRADE_AVAILABLE)" }, "capping_status": { "type": "string", "nullable": true, "description": "Overall capping status (NONE, FIRST_WARNING, SECOND_WARNING, CAPPED)", "example": "NONE" } } } } } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "404": { "description": "Phone number not connected" }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Fetch the account's new-chat message cap and usage — an antecedent indicator of the 463 restriction (how many new conversations can still be started this cycle). Read-only: queries WhatsApp directly (MEX) without sending a message." } }, "/connections/{phoneNumber}/on-whatsapp": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberOn-whatsapp", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Phone numbers checked successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "jid": { "type": "string", "description": "WhatsApp JID of the phone number", "example": "551234567890@s.whatsapp.net" }, "exists": { "type": "boolean", "description": "Whether the phone number is registered on WhatsApp" } } } } } } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Check if phone numbers are registered on WhatsApp", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jids": { "description": "Array of phone numbers to check if they are on WhatsApp", "minItems": 1, "maxItems": 50, "type": "array", "items": { "description": "Phone number formatted as jid", "pattern": "^\\d{5,15}@s.whatsapp.net$", "example": "551234567890@s.whatsapp.net", "type": "string" } } }, "required": [ "jids" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jids": { "description": "Array of phone numbers to check if they are on WhatsApp", "minItems": 1, "maxItems": 50, "type": "array", "items": { "description": "Phone number formatted as jid", "pattern": "^\\d{5,15}@s.whatsapp.net$", "example": "551234567890@s.whatsapp.net", "type": "string" } } }, "required": [ "jids" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jids": { "description": "Array of phone numbers to check if they are on WhatsApp", "minItems": 1, "maxItems": 50, "type": "array", "items": { "description": "Phone number formatted as jid", "pattern": "^\\d{5,15}@s.whatsapp.net$", "example": "551234567890@s.whatsapp.net", "type": "string" } } }, "required": [ "jids" ] } } } } } }, "/connections/{phoneNumber}/business-profile": { "get": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true }, { "description": "User JID", "schema": { "type": "string", "example": "551101234567@s.whatsapp.net" }, "in": "query", "name": "jid", "required": true } ], "operationId": "getConnectionsByPhoneNumberBusiness-profile", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Business profile retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "wid": { "type": "string", "description": "WhatsApp ID of the business", "example": "551234567890@s.whatsapp.net" }, "description": { "type": "string", "description": "Business description", "example": "We are a company that sells products" }, "email": { "type": "string", "nullable": true, "description": "Business email", "example": "contact@business.com" }, "website": { "type": "array", "items": { "type": "string" }, "description": "Business websites", "example": [ "https://business.com" ] }, "category": { "type": "string", "nullable": true, "description": "Business category", "example": "Retail" }, "address": { "type": "string", "nullable": true, "description": "Business address", "example": "123 Main St, City" }, "business_hours": { "type": "object", "description": "Business hours configuration", "properties": { "timezone": { "type": "string", "description": "Timezone of the business", "example": "America/Sao_Paulo" }, "config": { "type": "array", "items": { "type": "object", "properties": { "day_of_week": { "type": "string" }, "mode": { "type": "string" }, "open_time": { "type": "number" }, "close_time": { "type": "number" } } } } } } } } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Get business profile of a WhatsApp Business account" } }, "/connections/{phoneNumber}/group-metadata": { "get": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true }, { "description": "Group JID", "schema": { "type": "string", "example": "123456789012345678@g.us" }, "in": "query", "name": "jid", "required": true } ], "operationId": "getConnectionsByPhoneNumberGroup-metadata", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Group metadata retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "Group JID", "example": "120363425378794738@g.us" }, "addressingMode": { "type": "string", "description": "Addressing mode of the group", "example": "lid" }, "subject": { "type": "string", "description": "Group name/subject", "example": "My Group" }, "subjectOwner": { "type": "string", "description": "JID of the user who set the subject", "example": "12345678901234@lid" }, "subjectOwnerPn": { "type": "string", "description": "Phone number JID of the subject owner", "example": "551234567890@s.whatsapp.net" }, "subjectTime": { "type": "number", "description": "Timestamp when subject was set" }, "size": { "type": "number", "description": "Number of participants in the group" }, "creation": { "type": "number", "description": "Timestamp when the group was created" }, "owner": { "type": "string", "description": "JID of the group owner", "example": "12345678901234@lid" }, "ownerPn": { "type": "string", "description": "Phone number JID of the group owner", "example": "551234567890@s.whatsapp.net" }, "owner_country_code": { "type": "string", "description": "Country code of the group owner", "example": "BR" }, "desc": { "type": "string", "nullable": true, "description": "Group description" }, "descId": { "type": "string", "nullable": true, "description": "Description ID" }, "descOwner": { "type": "string", "nullable": true, "description": "JID of the user who set the description" }, "descTime": { "type": "number", "nullable": true, "description": "Timestamp when description was set" }, "restrict": { "type": "boolean", "description": "Whether only admins can change group settings", "example": false }, "announce": { "type": "boolean", "description": "Whether only admins can send messages", "example": false }, "isCommunity": { "type": "boolean", "description": "Whether the group is a community", "example": false }, "isCommunityAnnounce": { "type": "boolean", "description": "Whether the group is a community announcement group", "example": false }, "joinApprovalMode": { "type": "boolean", "description": "Whether join requests require admin approval", "example": false }, "memberAddMode": { "type": "boolean", "description": "Whether members can add other members", "example": true }, "participants": { "type": "array", "description": "List of group participants", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Participant JID", "example": "12345678901234@lid" }, "phoneNumber": { "type": "string", "description": "Participant phone number JID", "example": "551234567890@s.whatsapp.net" }, "admin": { "type": "string", "nullable": true, "description": "Admin status: 'superadmin', 'admin', or null", "example": "superadmin" } } } }, "ephemeralDuration": { "type": "number", "nullable": true, "description": "Duration in seconds for disappearing messages", "example": 604800 } } } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } } } }, "/connections/{phoneNumber}/group-participants": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-participants", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Participants updated successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Manage group participants (add, remove, promote, demote)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "participant": { "description": "User JID", "example": "551101234567@s.whatsapp.net", "type": "string" }, "action": { "type": "string", "enum": [ "add", "remove", "promote", "demote" ], "description": "Action to perform on participants. `add` adds participants, `remove` removes them, `promote` makes them admins, `demote` removes admin privileges.", "example": "add" } }, "required": [ "jid", "participant", "action" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "participant": { "description": "User JID", "example": "551101234567@s.whatsapp.net", "type": "string" }, "action": { "type": "string", "enum": [ "add", "remove", "promote", "demote" ], "description": "Action to perform on participants. `add` adds participants, `remove` removes them, `promote` makes them admins, `demote` removes admin privileges.", "example": "add" } }, "required": [ "jid", "participant", "action" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "participant": { "description": "User JID", "example": "551101234567@s.whatsapp.net", "type": "string" }, "action": { "type": "string", "enum": [ "add", "remove", "promote", "demote" ], "description": "Action to perform on participants. `add` adds participants, `remove` removes them, `promote` makes them admins, `demote` removes admin privileges.", "example": "add" } }, "required": [ "jid", "participant", "action" ] } } } } } }, "/connections/{phoneNumber}/group-subject": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-subject", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Group subject updated successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Update group subject (name)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "subject": { "description": "New group subject (name)", "minLength": 1, "maxLength": 100, "example": "My Group Name", "type": "string" } }, "required": [ "jid", "subject" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "subject": { "description": "New group subject (name)", "minLength": 1, "maxLength": 100, "example": "My Group Name", "type": "string" } }, "required": [ "jid", "subject" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "subject": { "description": "New group subject (name)", "minLength": 1, "maxLength": 100, "example": "My Group Name", "type": "string" } }, "required": [ "jid", "subject" ] } } } } } }, "/connections/{phoneNumber}/group-description": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-description", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Group description updated successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Update group description", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "description": { "description": "New group description", "maxLength": 2048, "example": "This is my group description", "type": "string" } }, "required": [ "jid" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "description": { "description": "New group description", "maxLength": 2048, "example": "This is my group description", "type": "string" } }, "required": [ "jid" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "description": { "description": "New group description", "maxLength": 2048, "example": "This is my group description", "type": "string" } }, "required": [ "jid" ] } } } } } }, "/connections/{phoneNumber}/update-profile-picture": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberUpdate-profile-picture", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Profile picture updated successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Update profile picture for a contact or group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "image": { "description": "Base64-encoded image data", "type": "string" } }, "required": [ "jid", "image" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "image": { "description": "Base64-encoded image data", "type": "string" } }, "required": [ "jid", "image" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "WhatsApp JID", "examples": [ "551101234567@s.whatsapp.net", "123456789012345678@g.us" ], "type": "string" }, "image": { "description": "Base64-encoded image data", "type": "string" } }, "required": [ "jid", "image" ] } } } } } }, "/connections/{phoneNumber}/group-create": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-create", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Group created successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Create a new WhatsApp group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "subject": { "description": "Group name/subject", "minLength": 1, "maxLength": 100, "example": "My New Group", "type": "string" }, "participants": { "description": "Array of participant JIDs to add to the group", "minItems": 1, "type": "array", "items": { "description": "User JID [Participant to add to the group]", "example": "551101234567@s.whatsapp.net", "type": "string" } } }, "required": [ "subject", "participants" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "subject": { "description": "Group name/subject", "minLength": 1, "maxLength": 100, "example": "My New Group", "type": "string" }, "participants": { "description": "Array of participant JIDs to add to the group", "minItems": 1, "type": "array", "items": { "description": "User JID [Participant to add to the group]", "example": "551101234567@s.whatsapp.net", "type": "string" } } }, "required": [ "subject", "participants" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "subject": { "description": "Group name/subject", "minLength": 1, "maxLength": 100, "example": "My New Group", "type": "string" }, "participants": { "description": "Array of participant JIDs to add to the group", "minItems": 1, "type": "array", "items": { "description": "User JID [Participant to add to the group]", "example": "551101234567@s.whatsapp.net", "type": "string" } } }, "required": [ "subject", "participants" ] } } } } } }, "/connections/{phoneNumber}/group-leave": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-leave", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Left group successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Leave a WhatsApp group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" } }, "required": [ "jid" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" } }, "required": [ "jid" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" } }, "required": [ "jid" ] } } } } } }, "/connections/{phoneNumber}/group-request-participants-list": { "get": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true }, { "description": "Group JID", "schema": { "type": "string", "example": "123456789012345678@g.us" }, "in": "query", "name": "jid", "required": true } ], "operationId": "getConnectionsByPhoneNumberGroup-request-participants-list", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Pending join requests retrieved successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "List pending join requests for a group" } }, "/connections/{phoneNumber}/group-request-participants-update": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-request-participants-update", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Join requests updated successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Approve or reject pending join requests for a group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "participants": { "description": "Array of participant JIDs to approve or reject", "minItems": 1, "type": "array", "items": { "description": "User JID [Participant to approve or reject]", "example": "551101234567@s.whatsapp.net", "type": "string" } }, "action": { "type": "string", "enum": [ "approve", "reject" ], "description": "Action to perform on join requests", "example": "approve" } }, "required": [ "jid", "participants", "action" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "participants": { "description": "Array of participant JIDs to approve or reject", "minItems": 1, "type": "array", "items": { "description": "User JID [Participant to approve or reject]", "example": "551101234567@s.whatsapp.net", "type": "string" } }, "action": { "type": "string", "enum": [ "approve", "reject" ], "description": "Action to perform on join requests", "example": "approve" } }, "required": [ "jid", "participants", "action" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "participants": { "description": "Array of participant JIDs to approve or reject", "minItems": 1, "type": "array", "items": { "description": "User JID [Participant to approve or reject]", "example": "551101234567@s.whatsapp.net", "type": "string" } }, "action": { "type": "string", "enum": [ "approve", "reject" ], "description": "Action to perform on join requests", "example": "approve" } }, "required": [ "jid", "participants", "action" ] } } } } } }, "/connections/{phoneNumber}/group-invite-code": { "get": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true }, { "description": "Group JID", "schema": { "type": "string", "example": "123456789012345678@g.us" }, "in": "query", "name": "jid", "required": true } ], "operationId": "getConnectionsByPhoneNumberGroup-invite-code", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Invite code retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "jid": { "type": "string" }, "inviteCode": { "type": "string", "nullable": true } } } } } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Get the invite code for a group" } }, "/connections/{phoneNumber}/group-revoke-invite": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-revoke-invite", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Invite code revoked successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "jid": { "type": "string" }, "inviteCode": { "type": "string", "nullable": true } } } } } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Revoke the current invite code and generate a new one for a group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" } }, "required": [ "jid" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" } }, "required": [ "jid" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" } }, "required": [ "jid" ] } } } } } }, "/connections/{phoneNumber}/group-accept-invite": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-accept-invite", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Joined group successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "groupJid": { "type": "string", "nullable": true } } } } } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Join a group using an invite code", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "description": "Group invite code", "example": "ABC123xyz", "type": "string" } }, "required": [ "code" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "code": { "description": "Group invite code", "example": "ABC123xyz", "type": "string" } }, "required": [ "code" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "code": { "description": "Group invite code", "example": "ABC123xyz", "type": "string" } }, "required": [ "code" ] } } } } } }, "/connections/{phoneNumber}/group-revoke-invite-v4": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-revoke-invite-v4", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "V4 invite revoked successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "revoked": { "type": "boolean" } } } } } } } }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Revoke a V4 invite for a specific user", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "groupJid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "invitedJid": { "description": "User JID [JID of the invited user]", "example": "551101234567@s.whatsapp.net", "type": "string" } }, "required": [ "groupJid", "invitedJid" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "groupJid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "invitedJid": { "description": "User JID [JID of the invited user]", "example": "551101234567@s.whatsapp.net", "type": "string" } }, "required": [ "groupJid", "invitedJid" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "groupJid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "invitedJid": { "description": "User JID [JID of the invited user]", "example": "551101234567@s.whatsapp.net", "type": "string" } }, "required": [ "groupJid", "invitedJid" ] } } } } } }, "/connections/{phoneNumber}/group-accept-invite-v4": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-accept-invite-v4", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "V4 invite accepted successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Accept a V4 group invite message", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "key": { "type": "string", "enum": [] }, "inviteMessage": { "description": "Group invite message content", "type": "object", "properties": { "groupJid": { "description": "Group JID [target group for the invite]", "example": "123456789012345678@g.us", "type": "string" }, "inviteCode": { "description": "Invite code", "type": "string" }, "inviteExpiration": { "type": "number" }, "groupName": { "type": "string" }, "caption": { "type": "string" } }, "required": [ "groupJid", "inviteCode" ] } }, "required": [ "key", "inviteMessage" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "key": { "type": "string", "enum": [] }, "inviteMessage": { "description": "Group invite message content", "type": "object", "properties": { "groupJid": { "description": "Group JID [target group for the invite]", "example": "123456789012345678@g.us", "type": "string" }, "inviteCode": { "description": "Invite code", "type": "string" }, "inviteExpiration": { "type": "number" }, "groupName": { "type": "string" }, "caption": { "type": "string" } }, "required": [ "groupJid", "inviteCode" ] } }, "required": [ "key", "inviteMessage" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "key": { "type": "string", "enum": [] }, "inviteMessage": { "description": "Group invite message content", "type": "object", "properties": { "groupJid": { "description": "Group JID [target group for the invite]", "example": "123456789012345678@g.us", "type": "string" }, "inviteCode": { "description": "Invite code", "type": "string" }, "inviteExpiration": { "type": "number" }, "groupName": { "type": "string" }, "caption": { "type": "string" } }, "required": [ "groupJid", "inviteCode" ] } }, "required": [ "key", "inviteMessage" ] } } } } } }, "/connections/{phoneNumber}/group-invite-info": { "get": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true }, { "description": "Group invite code", "schema": { "type": "string", "example": "ABC123xyz" }, "in": "query", "name": "code", "required": true } ], "operationId": "getConnectionsByPhoneNumberGroup-invite-info", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Group invite info retrieved successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Get group metadata from an invite code without joining the group" } }, "/connections/{phoneNumber}/group-toggle-ephemeral": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-toggle-ephemeral", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Ephemeral setting updated successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Toggle disappearing messages for a group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "ephemeralExpiration": { "description": "Duration in seconds for disappearing messages. Use 0 to disable.", "minimum": 0, "example": 604800, "type": "number" } }, "required": [ "jid", "ephemeralExpiration" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "ephemeralExpiration": { "description": "Duration in seconds for disappearing messages. Use 0 to disable.", "minimum": 0, "example": 604800, "type": "number" } }, "required": [ "jid", "ephemeralExpiration" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "ephemeralExpiration": { "description": "Duration in seconds for disappearing messages. Use 0 to disable.", "minimum": 0, "example": 604800, "type": "number" } }, "required": [ "jid", "ephemeralExpiration" ] } } } } } }, "/connections/{phoneNumber}/group-setting-update": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-setting-update", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Group setting updated successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Update group settings (announcement/locked mode)", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "setting": { "type": "string", "enum": [ "announcement", "not_announcement", "locked", "unlocked" ], "description": "Group setting to update. `announcement` makes only admins able to send messages. `not_announcement` allows all participants. `locked` makes only admins able to edit group info. `unlocked` allows all participants to edit.", "example": "announcement" } }, "required": [ "jid", "setting" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "setting": { "type": "string", "enum": [ "announcement", "not_announcement", "locked", "unlocked" ], "description": "Group setting to update. `announcement` makes only admins able to send messages. `not_announcement` allows all participants. `locked` makes only admins able to edit group info. `unlocked` allows all participants to edit.", "example": "announcement" } }, "required": [ "jid", "setting" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "setting": { "type": "string", "enum": [ "announcement", "not_announcement", "locked", "unlocked" ], "description": "Group setting to update. `announcement` makes only admins able to send messages. `not_announcement` allows all participants. `locked` makes only admins able to edit group info. `unlocked` allows all participants to edit.", "example": "announcement" } }, "required": [ "jid", "setting" ] } } } } } }, "/connections/{phoneNumber}/group-member-add-mode": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-member-add-mode", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Member add mode updated successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Set who can add members to the group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "mode": { "type": "string", "enum": [ "admin_add", "all_member_add" ], "description": "Who can add members. `admin_add` restricts to admins only. `all_member_add` allows all members.", "example": "all_member_add" } }, "required": [ "jid", "mode" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "mode": { "type": "string", "enum": [ "admin_add", "all_member_add" ], "description": "Who can add members. `admin_add` restricts to admins only. `all_member_add` allows all members.", "example": "all_member_add" } }, "required": [ "jid", "mode" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "mode": { "type": "string", "enum": [ "admin_add", "all_member_add" ], "description": "Who can add members. `admin_add` restricts to admins only. `all_member_add` allows all members.", "example": "all_member_add" } }, "required": [ "jid", "mode" ] } } } } } }, "/connections/{phoneNumber}/group-join-approval-mode": { "post": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "postConnectionsByPhoneNumberGroup-join-approval-mode", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Join approval mode updated successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Toggle join approval mode for a group", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "mode": { "type": "string", "enum": [ "on", "off" ], "description": "Whether join requests require admin approval. `on` enables approval mode, `off` disables it.", "example": "on" } }, "required": [ "jid", "mode" ] } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "mode": { "type": "string", "enum": [ "on", "off" ], "description": "Whether join requests require admin approval. `on` enables approval mode, `off` disables it.", "example": "on" } }, "required": [ "jid", "mode" ] } }, "text/plain": { "schema": { "type": "object", "properties": { "jid": { "description": "Group JID", "example": "123456789012345678@g.us", "type": "string" }, "mode": { "type": "string", "enum": [ "on", "off" ], "description": "Whether join requests require admin approval. `on` enables approval mode, `off` disables it.", "example": "on" } }, "required": [ "jid", "mode" ] } } } } } }, "/connections/{phoneNumber}/group-fetch-all-participating": { "get": { "parameters": [ { "description": "Phone number for connection. Must have + prefix.", "schema": { "type": "string", "minLength": 6, "maxLength": 16, "pattern": "^\\+\\d{5,15}$", "example": "+551234567890" }, "in": "path", "name": "phoneNumber", "required": true } ], "operationId": "getConnectionsByPhoneNumberGroup-fetch-all-participating", "tags": [ "Connections" ], "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "All group metadata retrieved successfully" }, "403": { "description": "Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key." }, "421": { "description": "Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).", "headers": { "x-baileys-owner": { "description": "Instance id of the connection owner", "schema": { "type": "string" } } } } }, "description": "Fetch metadata for all groups the connected number is participating in" } }, "/media/{messageId}": { "get": { "parameters": [ { "description": "Message ID to download media from", "schema": { "type": "string", "pattern": "^[A-Z0-9]{1,64}$" }, "in": "path", "name": "messageId", "required": true } ], "operationId": "getMediaByMessageId", "tags": [ "Media" ], "description": "Media file download", "security": [ { "xApiKey": [] } ], "responses": { "200": { "description": "Media file" }, "404": { "description": "File not found" } } } }, "/cluster/health": { "get": { "operationId": "getClusterHealth", "tags": [ "Cluster" ], "responses": { "200": { "description": "Instance health and cluster identity" } } } } } }