machinaos 0.0.1 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.template +71 -71
- package/LICENSE +21 -21
- package/README.md +145 -87
- package/bin/cli.js +62 -106
- package/client/.dockerignore +45 -45
- package/client/Dockerfile +68 -68
- package/client/dist/assets/index-DFSC53FP.css +1 -0
- package/client/dist/assets/index-fJ-1gTf5.js +613 -0
- package/client/dist/index.html +14 -0
- package/client/eslint.config.js +34 -16
- package/client/nginx.conf +66 -66
- package/client/package.json +61 -48
- package/client/src/App.tsx +27 -27
- package/client/src/Dashboard.tsx +1200 -1172
- package/client/src/ParameterPanel.tsx +302 -300
- package/client/src/components/AIAgentNode.tsx +315 -321
- package/client/src/components/APIKeyValidator.tsx +117 -117
- package/client/src/components/ClaudeChatModelNode.tsx +17 -17
- package/client/src/components/CredentialsModal.tsx +1200 -306
- package/client/src/components/GeminiChatModelNode.tsx +17 -17
- package/client/src/components/GenericNode.tsx +356 -356
- package/client/src/components/LocationParameterPanel.tsx +153 -153
- package/client/src/components/ModelNode.tsx +285 -285
- package/client/src/components/OpenAIChatModelNode.tsx +17 -17
- package/client/src/components/OutputPanel.tsx +470 -470
- package/client/src/components/ParameterRenderer.tsx +1873 -1873
- package/client/src/components/SkillEditorModal.tsx +3 -3
- package/client/src/components/SquareNode.tsx +812 -796
- package/client/src/components/ToolkitNode.tsx +365 -365
- package/client/src/components/auth/LoginPage.tsx +247 -247
- package/client/src/components/auth/ProtectedRoute.tsx +59 -59
- package/client/src/components/base/BaseChatModelNode.tsx +270 -270
- package/client/src/components/icons/AIProviderIcons.tsx +50 -50
- package/client/src/components/maps/GoogleMapsPicker.tsx +136 -136
- package/client/src/components/maps/MapsPreviewPanel.tsx +109 -109
- package/client/src/components/maps/index.ts +25 -25
- package/client/src/components/parameterPanel/InputSection.tsx +1094 -1094
- package/client/src/components/parameterPanel/LocationPanelLayout.tsx +64 -64
- package/client/src/components/parameterPanel/MapsSection.tsx +91 -91
- package/client/src/components/parameterPanel/MiddleSection.tsx +867 -571
- package/client/src/components/parameterPanel/OutputSection.tsx +80 -80
- package/client/src/components/parameterPanel/ParameterPanelLayout.tsx +81 -81
- package/client/src/components/parameterPanel/ToolSchemaEditor.tsx +436 -436
- package/client/src/components/parameterPanel/index.ts +41 -41
- package/client/src/components/shared/DataPanel.tsx +142 -142
- package/client/src/components/shared/JSONTreeRenderer.tsx +105 -105
- package/client/src/components/ui/AIResultModal.tsx +203 -203
- package/client/src/components/ui/ApiKeyInput.tsx +93 -0
- package/client/src/components/ui/CodeEditor.tsx +81 -81
- package/client/src/components/ui/CollapsibleSection.tsx +87 -87
- package/client/src/components/ui/ComponentItem.tsx +153 -153
- package/client/src/components/ui/ComponentPalette.tsx +320 -320
- package/client/src/components/ui/ConsolePanel.tsx +151 -43
- package/client/src/components/ui/ErrorBoundary.tsx +195 -195
- package/client/src/components/ui/InputNodesPanel.tsx +203 -203
- package/client/src/components/ui/MapSelector.tsx +313 -313
- package/client/src/components/ui/Modal.tsx +151 -148
- package/client/src/components/ui/NodeOutputPanel.tsx +1150 -1150
- package/client/src/components/ui/OutputDisplayPanel.tsx +381 -381
- package/client/src/components/ui/QRCodeDisplay.tsx +182 -0
- package/client/src/components/ui/TopToolbar.tsx +736 -736
- package/client/src/components/ui/WorkflowSidebar.tsx +293 -293
- package/client/src/config/antdTheme.ts +186 -186
- package/client/src/contexts/AuthContext.tsx +221 -221
- package/client/src/contexts/ThemeContext.tsx +42 -42
- package/client/src/contexts/WebSocketContext.tsx +2144 -1971
- package/client/src/factories/baseChatModelFactory.ts +255 -255
- package/client/src/hooks/useAndroidOperations.ts +118 -164
- package/client/src/hooks/useApiKeyValidation.ts +106 -106
- package/client/src/hooks/useApiKeys.ts +238 -238
- package/client/src/hooks/useAppTheme.ts +17 -17
- package/client/src/hooks/useComponentPalette.ts +50 -50
- package/client/src/hooks/useDragAndDrop.ts +123 -123
- package/client/src/hooks/useDragVariable.ts +88 -88
- package/client/src/hooks/useExecution.ts +319 -313
- package/client/src/hooks/useParameterPanel.ts +176 -176
- package/client/src/hooks/useReactFlowNodes.ts +188 -188
- package/client/src/hooks/useToolSchema.ts +209 -209
- package/client/src/hooks/useWhatsApp.ts +196 -196
- package/client/src/hooks/useWorkflowManagement.ts +45 -45
- package/client/src/index.css +314 -314
- package/client/src/nodeDefinitions/aiAgentNodes.ts +335 -335
- package/client/src/nodeDefinitions/aiModelNodes.ts +340 -340
- package/client/src/nodeDefinitions/androidServiceNodes.ts +383 -383
- package/client/src/nodeDefinitions/chatNodes.ts +135 -135
- package/client/src/nodeDefinitions/codeNodes.ts +54 -54
- package/client/src/nodeDefinitions/index.ts +14 -14
- package/client/src/nodeDefinitions/locationNodes.ts +462 -462
- package/client/src/nodeDefinitions/schedulerNodes.ts +220 -220
- package/client/src/nodeDefinitions/skillNodes.ts +17 -5
- package/client/src/nodeDefinitions/utilityNodes.ts +284 -284
- package/client/src/nodeDefinitions/whatsappNodes.ts +821 -865
- package/client/src/nodeDefinitions.ts +101 -103
- package/client/src/services/dynamicParameterService.ts +95 -95
- package/client/src/services/execution/aiAgentExecutionService.ts +34 -34
- package/client/src/services/executionService.ts +227 -231
- package/client/src/services/workflowApi.ts +91 -91
- package/client/src/store/useAppStore.ts +578 -581
- package/client/src/styles/theme.ts +513 -508
- package/client/src/styles/zIndex.ts +16 -16
- package/client/src/types/ComponentTypes.ts +38 -38
- package/client/src/types/INodeProperties.ts +287 -287
- package/client/src/types/NodeTypes.ts +27 -27
- package/client/src/utils/formatters.ts +32 -32
- package/client/src/utils/googleMapsLoader.ts +139 -139
- package/client/src/utils/locationUtils.ts +84 -84
- package/client/src/utils/nodeUtils.ts +30 -30
- package/client/src/utils/workflow.ts +29 -29
- package/client/src/vite-env.d.ts +12 -12
- package/client/tailwind.config.js +59 -59
- package/client/tsconfig.json +25 -25
- package/client/vite.config.js +35 -35
- package/package.json +78 -70
- package/scripts/build.js +153 -45
- package/scripts/clean.js +40 -40
- package/scripts/start.js +234 -210
- package/scripts/stop.js +301 -325
- package/server/.dockerignore +44 -44
- package/server/Dockerfile +45 -45
- package/server/constants.py +244 -249
- package/server/core/cache.py +460 -460
- package/server/core/config.py +127 -127
- package/server/core/container.py +98 -98
- package/server/core/database.py +1296 -1210
- package/server/core/logging.py +313 -313
- package/server/main.py +288 -288
- package/server/middleware/__init__.py +5 -5
- package/server/middleware/auth.py +89 -89
- package/server/models/auth.py +52 -52
- package/server/models/cache.py +24 -24
- package/server/models/database.py +235 -210
- package/server/models/nodes.py +435 -455
- package/server/pyproject.toml +75 -72
- package/server/requirements.txt +83 -83
- package/server/routers/android.py +294 -294
- package/server/routers/auth.py +203 -203
- package/server/routers/database.py +150 -150
- package/server/routers/maps.py +141 -141
- package/server/routers/nodejs_compat.py +288 -288
- package/server/routers/webhook.py +90 -90
- package/server/routers/websocket.py +2239 -2127
- package/server/routers/whatsapp.py +761 -761
- package/server/routers/workflow.py +199 -199
- package/server/services/ai.py +2444 -2414
- package/server/services/android_service.py +588 -588
- package/server/services/auth.py +130 -130
- package/server/services/chat_client.py +160 -160
- package/server/services/deployment/manager.py +706 -706
- package/server/services/event_waiter.py +675 -785
- package/server/services/execution/executor.py +1351 -1351
- package/server/services/execution/models.py +1 -1
- package/server/services/handlers/__init__.py +122 -126
- package/server/services/handlers/ai.py +390 -355
- package/server/services/handlers/android.py +69 -260
- package/server/services/handlers/code.py +278 -278
- package/server/services/handlers/http.py +193 -193
- package/server/services/handlers/tools.py +146 -32
- package/server/services/handlers/triggers.py +107 -107
- package/server/services/handlers/utility.py +822 -822
- package/server/services/handlers/whatsapp.py +423 -476
- package/server/services/maps.py +288 -288
- package/server/services/memory_store.py +103 -103
- package/server/services/node_executor.py +372 -375
- package/server/services/scheduler.py +155 -155
- package/server/services/skill_loader.py +1 -1
- package/server/services/status_broadcaster.py +834 -826
- package/server/services/temporal/__init__.py +23 -23
- package/server/services/temporal/activities.py +344 -344
- package/server/services/temporal/client.py +76 -76
- package/server/services/temporal/executor.py +147 -147
- package/server/services/temporal/worker.py +251 -251
- package/server/services/temporal/workflow.py +355 -355
- package/server/services/temporal/ws_client.py +236 -236
- package/server/services/text.py +110 -110
- package/server/services/user_auth.py +172 -172
- package/server/services/websocket_client.py +29 -29
- package/server/services/workflow.py +597 -597
- package/server/skills/android-skill/SKILL.md +4 -4
- package/server/skills/code-skill/SKILL.md +123 -89
- package/server/skills/maps-skill/SKILL.md +3 -3
- package/server/skills/memory-skill/SKILL.md +1 -1
- package/server/skills/web-search-skill/SKILL.md +154 -0
- package/server/skills/whatsapp-skill/SKILL.md +3 -3
- package/server/uv.lock +461 -100
- package/server/whatsapp-rpc/.dockerignore +30 -30
- package/server/whatsapp-rpc/Dockerfile +44 -44
- package/server/whatsapp-rpc/Dockerfile.web +17 -17
- package/server/whatsapp-rpc/README.md +139 -139
- package/server/whatsapp-rpc/bin/whatsapp-rpc-server +0 -0
- package/server/whatsapp-rpc/cli.js +95 -95
- package/server/whatsapp-rpc/configs/config.yaml +6 -6
- package/server/whatsapp-rpc/docker-compose.yml +35 -35
- package/server/whatsapp-rpc/docs/API.md +410 -410
- package/server/whatsapp-rpc/node_modules/.package-lock.json +259 -0
- package/server/whatsapp-rpc/node_modules/chalk/license +9 -0
- package/server/whatsapp-rpc/node_modules/chalk/package.json +83 -0
- package/server/whatsapp-rpc/node_modules/chalk/readme.md +297 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/index.d.ts +325 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/index.js +225 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/utilities.js +33 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
- package/server/whatsapp-rpc/node_modules/commander/LICENSE +22 -0
- package/server/whatsapp-rpc/node_modules/commander/Readme.md +1148 -0
- package/server/whatsapp-rpc/node_modules/commander/esm.mjs +16 -0
- package/server/whatsapp-rpc/node_modules/commander/index.js +26 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/argument.js +145 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/command.js +2179 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/error.js +43 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/help.js +462 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/option.js +329 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/suggestSimilar.js +100 -0
- package/server/whatsapp-rpc/node_modules/commander/package-support.json +16 -0
- package/server/whatsapp-rpc/node_modules/commander/package.json +80 -0
- package/server/whatsapp-rpc/node_modules/commander/typings/esm.d.mts +3 -0
- package/server/whatsapp-rpc/node_modules/commander/typings/index.d.ts +884 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/LICENSE +21 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/README.md +89 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/index.js +39 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/lib/parse.js +91 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/package.json +73 -0
- package/server/whatsapp-rpc/node_modules/execa/index.d.ts +955 -0
- package/server/whatsapp-rpc/node_modules/execa/index.js +309 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/command.js +119 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/error.js +87 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/kill.js +102 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/pipe.js +42 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/promise.js +36 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/stdio.js +49 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/stream.js +133 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/verbose.js +19 -0
- package/server/whatsapp-rpc/node_modules/execa/license +9 -0
- package/server/whatsapp-rpc/node_modules/execa/package.json +90 -0
- package/server/whatsapp-rpc/node_modules/execa/readme.md +822 -0
- package/server/whatsapp-rpc/node_modules/get-stream/license +9 -0
- package/server/whatsapp-rpc/node_modules/get-stream/package.json +53 -0
- package/server/whatsapp-rpc/node_modules/get-stream/readme.md +291 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/array-buffer.js +84 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/array.js +32 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/buffer.js +20 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/contents.js +101 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/index.d.ts +119 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/index.js +5 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/string.js +36 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/utils.js +11 -0
- package/server/whatsapp-rpc/node_modules/get-them-args/LICENSE +21 -0
- package/server/whatsapp-rpc/node_modules/get-them-args/README.md +95 -0
- package/server/whatsapp-rpc/node_modules/get-them-args/index.js +97 -0
- package/server/whatsapp-rpc/node_modules/get-them-args/package.json +36 -0
- package/server/whatsapp-rpc/node_modules/human-signals/LICENSE +201 -0
- package/server/whatsapp-rpc/node_modules/human-signals/README.md +168 -0
- package/server/whatsapp-rpc/node_modules/human-signals/build/src/core.js +273 -0
- package/server/whatsapp-rpc/node_modules/human-signals/build/src/main.d.ts +73 -0
- package/server/whatsapp-rpc/node_modules/human-signals/build/src/main.js +70 -0
- package/server/whatsapp-rpc/node_modules/human-signals/build/src/realtime.js +16 -0
- package/server/whatsapp-rpc/node_modules/human-signals/build/src/signals.js +34 -0
- package/server/whatsapp-rpc/node_modules/human-signals/package.json +61 -0
- package/server/whatsapp-rpc/node_modules/is-stream/index.d.ts +81 -0
- package/server/whatsapp-rpc/node_modules/is-stream/index.js +29 -0
- package/server/whatsapp-rpc/node_modules/is-stream/license +9 -0
- package/server/whatsapp-rpc/node_modules/is-stream/package.json +44 -0
- package/server/whatsapp-rpc/node_modules/is-stream/readme.md +60 -0
- package/server/whatsapp-rpc/node_modules/isexe/LICENSE +15 -0
- package/server/whatsapp-rpc/node_modules/isexe/README.md +51 -0
- package/server/whatsapp-rpc/node_modules/isexe/index.js +57 -0
- package/server/whatsapp-rpc/node_modules/isexe/mode.js +41 -0
- package/server/whatsapp-rpc/node_modules/isexe/package.json +31 -0
- package/server/whatsapp-rpc/node_modules/isexe/test/basic.js +221 -0
- package/server/whatsapp-rpc/node_modules/isexe/windows.js +42 -0
- package/server/whatsapp-rpc/node_modules/kill-port/.editorconfig +12 -0
- package/server/whatsapp-rpc/node_modules/kill-port/.gitattributes +1 -0
- package/server/whatsapp-rpc/node_modules/kill-port/LICENSE +21 -0
- package/server/whatsapp-rpc/node_modules/kill-port/README.md +140 -0
- package/server/whatsapp-rpc/node_modules/kill-port/cli.js +25 -0
- package/server/whatsapp-rpc/node_modules/kill-port/example.js +21 -0
- package/server/whatsapp-rpc/node_modules/kill-port/index.js +46 -0
- package/server/whatsapp-rpc/node_modules/kill-port/logo.png +0 -0
- package/server/whatsapp-rpc/node_modules/kill-port/package.json +41 -0
- package/server/whatsapp-rpc/node_modules/kill-port/pnpm-lock.yaml +4606 -0
- package/server/whatsapp-rpc/node_modules/kill-port/test.js +16 -0
- package/server/whatsapp-rpc/node_modules/merge-stream/LICENSE +21 -0
- package/server/whatsapp-rpc/node_modules/merge-stream/README.md +78 -0
- package/server/whatsapp-rpc/node_modules/merge-stream/index.js +41 -0
- package/server/whatsapp-rpc/node_modules/merge-stream/package.json +19 -0
- package/server/whatsapp-rpc/node_modules/mimic-fn/index.d.ts +52 -0
- package/server/whatsapp-rpc/node_modules/mimic-fn/index.js +71 -0
- package/server/whatsapp-rpc/node_modules/mimic-fn/license +9 -0
- package/server/whatsapp-rpc/node_modules/mimic-fn/package.json +45 -0
- package/server/whatsapp-rpc/node_modules/mimic-fn/readme.md +90 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/index.d.ts +90 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/index.js +52 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/license +9 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/node_modules/path-key/index.d.ts +31 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/node_modules/path-key/index.js +12 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/node_modules/path-key/license +9 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/node_modules/path-key/package.json +41 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/node_modules/path-key/readme.md +57 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/package.json +49 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/readme.md +104 -0
- package/server/whatsapp-rpc/node_modules/onetime/index.d.ts +59 -0
- package/server/whatsapp-rpc/node_modules/onetime/index.js +41 -0
- package/server/whatsapp-rpc/node_modules/onetime/license +9 -0
- package/server/whatsapp-rpc/node_modules/onetime/package.json +45 -0
- package/server/whatsapp-rpc/node_modules/onetime/readme.md +94 -0
- package/server/whatsapp-rpc/node_modules/path-key/index.d.ts +40 -0
- package/server/whatsapp-rpc/node_modules/path-key/index.js +16 -0
- package/server/whatsapp-rpc/node_modules/path-key/license +9 -0
- package/server/whatsapp-rpc/node_modules/path-key/package.json +39 -0
- package/server/whatsapp-rpc/node_modules/path-key/readme.md +61 -0
- package/server/whatsapp-rpc/node_modules/shebang-command/index.js +19 -0
- package/server/whatsapp-rpc/node_modules/shebang-command/license +9 -0
- package/server/whatsapp-rpc/node_modules/shebang-command/package.json +34 -0
- package/server/whatsapp-rpc/node_modules/shebang-command/readme.md +34 -0
- package/server/whatsapp-rpc/node_modules/shebang-regex/index.d.ts +22 -0
- package/server/whatsapp-rpc/node_modules/shebang-regex/index.js +2 -0
- package/server/whatsapp-rpc/node_modules/shebang-regex/license +9 -0
- package/server/whatsapp-rpc/node_modules/shebang-regex/package.json +35 -0
- package/server/whatsapp-rpc/node_modules/shebang-regex/readme.md +33 -0
- package/server/whatsapp-rpc/node_modules/shell-exec/LICENSE +21 -0
- package/server/whatsapp-rpc/node_modules/shell-exec/README.md +60 -0
- package/server/whatsapp-rpc/node_modules/shell-exec/index.js +47 -0
- package/server/whatsapp-rpc/node_modules/shell-exec/package.json +29 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/LICENSE.txt +16 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/README.md +74 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/browser.d.ts +12 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/browser.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/browser.js +10 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/browser.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/index.d.ts +48 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/index.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/index.js +279 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/index.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/package.json +3 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/signals.d.ts +29 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/signals.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/signals.js +42 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/signals.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/browser.d.ts +12 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/browser.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/browser.js +4 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/browser.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/index.d.ts +48 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/index.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/index.js +275 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/index.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/package.json +3 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/signals.d.ts +29 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/signals.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/signals.js +39 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/signals.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/package.json +106 -0
- package/server/whatsapp-rpc/node_modules/strip-final-newline/index.js +14 -0
- package/server/whatsapp-rpc/node_modules/strip-final-newline/license +9 -0
- package/server/whatsapp-rpc/node_modules/strip-final-newline/package.json +43 -0
- package/server/whatsapp-rpc/node_modules/strip-final-newline/readme.md +35 -0
- package/server/whatsapp-rpc/node_modules/which/CHANGELOG.md +166 -0
- package/server/whatsapp-rpc/node_modules/which/LICENSE +15 -0
- package/server/whatsapp-rpc/node_modules/which/README.md +54 -0
- package/server/whatsapp-rpc/node_modules/which/bin/node-which +52 -0
- package/server/whatsapp-rpc/node_modules/which/package.json +43 -0
- package/server/whatsapp-rpc/node_modules/which/which.js +125 -0
- package/server/whatsapp-rpc/package-lock.json +272 -0
- package/server/whatsapp-rpc/package.json +30 -30
- package/server/whatsapp-rpc/schema.json +1294 -1294
- package/server/whatsapp-rpc/scripts/clean.cjs +66 -66
- package/server/whatsapp-rpc/scripts/cli.js +162 -162
- package/server/whatsapp-rpc/src/go/whatsapp/history.go +166 -166
- package/server/whatsapp-rpc/src/python/pyproject.toml +15 -15
- package/server/whatsapp-rpc/src/python/whatsapp_rpc/__init__.py +4 -4
- package/server/whatsapp-rpc/src/python/whatsapp_rpc/client.py +427 -427
- package/server/whatsapp-rpc/web/app.py +609 -609
- package/server/whatsapp-rpc/web/requirements.txt +6 -6
- package/server/whatsapp-rpc/web/rpc_client.py +427 -427
- package/server/whatsapp-rpc/web/static/openapi.yaml +59 -59
- package/server/whatsapp-rpc/web/templates/base.html +149 -149
- package/server/whatsapp-rpc/web/templates/contacts.html +240 -240
- package/server/whatsapp-rpc/web/templates/dashboard.html +319 -319
- package/server/whatsapp-rpc/web/templates/groups.html +328 -328
- package/server/whatsapp-rpc/web/templates/messages.html +465 -465
- package/server/whatsapp-rpc/web/templates/messaging.html +680 -680
- package/server/whatsapp-rpc/web/templates/send.html +258 -258
- package/server/whatsapp-rpc/web/templates/settings.html +459 -459
- package/client/src/components/ui/AndroidSettingsPanel.tsx +0 -401
- package/client/src/components/ui/WhatsAppSettingsPanel.tsx +0 -345
- package/client/src/nodeDefinitions/androidDeviceNodes.ts +0 -140
- package/docker-compose.prod.yml +0 -107
- package/docker-compose.yml +0 -104
- package/docs-MachinaOs/README.md +0 -85
- package/docs-MachinaOs/deployment/docker.mdx +0 -228
- package/docs-MachinaOs/deployment/production.mdx +0 -345
- package/docs-MachinaOs/docs.json +0 -75
- package/docs-MachinaOs/faq.mdx +0 -309
- package/docs-MachinaOs/favicon.svg +0 -5
- package/docs-MachinaOs/installation.mdx +0 -160
- package/docs-MachinaOs/introduction.mdx +0 -114
- package/docs-MachinaOs/logo/dark.svg +0 -6
- package/docs-MachinaOs/logo/light.svg +0 -6
- package/docs-MachinaOs/nodes/ai-agent.mdx +0 -216
- package/docs-MachinaOs/nodes/ai-models.mdx +0 -240
- package/docs-MachinaOs/nodes/android.mdx +0 -411
- package/docs-MachinaOs/nodes/overview.mdx +0 -181
- package/docs-MachinaOs/nodes/schedulers.mdx +0 -316
- package/docs-MachinaOs/nodes/webhooks.mdx +0 -330
- package/docs-MachinaOs/nodes/whatsapp.mdx +0 -305
- package/docs-MachinaOs/quickstart.mdx +0 -119
- package/docs-MachinaOs/tutorials/ai-agent-workflow.mdx +0 -177
- package/docs-MachinaOs/tutorials/android-automation.mdx +0 -242
- package/docs-MachinaOs/tutorials/first-workflow.mdx +0 -134
- package/docs-MachinaOs/tutorials/whatsapp-automation.mdx +0 -185
- package/nul +0 -0
- package/scripts/check-ports.ps1 +0 -33
- package/scripts/kill-port.ps1 +0 -154
|
@@ -1,1294 +1,1294 @@
|
|
|
1
|
-
{
|
|
2
|
-
"openrpc": "1.3.2",
|
|
3
|
-
"info": {
|
|
4
|
-
"title": "WhatsApp RPC API",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"description": "JSON-RPC 2.0 API over WebSocket for WhatsApp messaging"
|
|
7
|
-
},
|
|
8
|
-
"servers": [
|
|
9
|
-
{
|
|
10
|
-
"name": "default",
|
|
11
|
-
"url": "ws://localhost:9400/ws/rpc"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"methods": [
|
|
15
|
-
{
|
|
16
|
-
"name": "status",
|
|
17
|
-
"summary": "Get WhatsApp connection status",
|
|
18
|
-
"params": [],
|
|
19
|
-
"result": {
|
|
20
|
-
"name": "StatusResult",
|
|
21
|
-
"schema": {
|
|
22
|
-
"type": "object",
|
|
23
|
-
"properties": {
|
|
24
|
-
"connected": { "type": "boolean", "description": "Whether WhatsApp is connected" },
|
|
25
|
-
"has_session": { "type": "boolean", "description": "Whether a session exists" },
|
|
26
|
-
"running": { "type": "boolean", "description": "Whether the service is running" },
|
|
27
|
-
"pairing": { "type": "boolean", "description": "Whether pairing is in progress" },
|
|
28
|
-
"device_id": { "type": "string", "description": "Device JID if connected" },
|
|
29
|
-
"timestamp": { "type": "string", "format": "date-time" }
|
|
30
|
-
},
|
|
31
|
-
"required": ["connected", "has_session", "running", "pairing", "timestamp"]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"name": "start",
|
|
37
|
-
"summary": "Start WhatsApp service",
|
|
38
|
-
"params": [],
|
|
39
|
-
"result": {
|
|
40
|
-
"name": "StartResult",
|
|
41
|
-
"schema": {
|
|
42
|
-
"type": "object",
|
|
43
|
-
"properties": {
|
|
44
|
-
"message": { "type": "string", "enum": ["Started"] }
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"name": "stop",
|
|
51
|
-
"summary": "Stop WhatsApp service",
|
|
52
|
-
"params": [],
|
|
53
|
-
"result": {
|
|
54
|
-
"name": "StopResult",
|
|
55
|
-
"schema": {
|
|
56
|
-
"type": "object",
|
|
57
|
-
"properties": {
|
|
58
|
-
"message": { "type": "string", "enum": ["Stopped"] }
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"name": "restart",
|
|
65
|
-
"summary": "Full reset: logout, delete DB, cleanup QR, reinit, start fresh",
|
|
66
|
-
"description": "Performs a complete reset: 1) Logout from WhatsApp servers, 2) Shutdown service, 3) Delete device session, 4) Delete database files, 5) Delete QR code files, 6) Reinitialize client, 7) Start pairing",
|
|
67
|
-
"params": [],
|
|
68
|
-
"result": {
|
|
69
|
-
"name": "RestartResult",
|
|
70
|
-
"schema": {
|
|
71
|
-
"type": "object",
|
|
72
|
-
"properties": {
|
|
73
|
-
"message": { "type": "string", "enum": ["Restarted (session cleared)"] }
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"name": "reset",
|
|
80
|
-
"summary": "Reset WhatsApp session (logout and delete credentials)",
|
|
81
|
-
"params": [],
|
|
82
|
-
"result": {
|
|
83
|
-
"name": "ResetResult",
|
|
84
|
-
"schema": {
|
|
85
|
-
"type": "object",
|
|
86
|
-
"properties": {
|
|
87
|
-
"message": { "type": "string", "enum": ["Reset"] }
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"name": "diagnostics",
|
|
94
|
-
"summary": "Get detailed diagnostics information",
|
|
95
|
-
"params": [],
|
|
96
|
-
"result": {
|
|
97
|
-
"name": "DiagnosticsResult",
|
|
98
|
-
"schema": {
|
|
99
|
-
"type": "object",
|
|
100
|
-
"properties": {
|
|
101
|
-
"client_connected": { "type": "boolean" },
|
|
102
|
-
"client_logged_in": { "type": "boolean" },
|
|
103
|
-
"store_has_id": { "type": "boolean" },
|
|
104
|
-
"service_running": { "type": "boolean" },
|
|
105
|
-
"service_pairing": { "type": "boolean" },
|
|
106
|
-
"service_shutdown": { "type": "boolean" },
|
|
107
|
-
"events_channel_open": { "type": "boolean" },
|
|
108
|
-
"device_store": {
|
|
109
|
-
"type": "object",
|
|
110
|
-
"properties": {
|
|
111
|
-
"device_id": { "type": "string" },
|
|
112
|
-
"user": { "type": "string" },
|
|
113
|
-
"device": { "type": "integer" },
|
|
114
|
-
"server": { "type": "string" }
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
"timestamp": { "type": "string", "format": "date-time" }
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"name": "qr",
|
|
124
|
-
"summary": "Get current QR code for pairing",
|
|
125
|
-
"params": [],
|
|
126
|
-
"result": {
|
|
127
|
-
"name": "QRResult",
|
|
128
|
-
"schema": {
|
|
129
|
-
"type": "object",
|
|
130
|
-
"properties": {
|
|
131
|
-
"has_qr": { "type": "boolean", "enum": [true] },
|
|
132
|
-
"code": { "type": "string", "description": "QR code content string" },
|
|
133
|
-
"filename": { "type": "string", "description": "PNG file path" },
|
|
134
|
-
"image_data": { "type": "string", "description": "Base64-encoded PNG data (for Docker/remote access)" }
|
|
135
|
-
},
|
|
136
|
-
"required": ["has_qr", "code", "filename"]
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
"errors": [
|
|
140
|
-
{
|
|
141
|
-
"code": -32001,
|
|
142
|
-
"message": "No QR available"
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"name": "send",
|
|
148
|
-
"summary": "Send a WhatsApp message",
|
|
149
|
-
"params": [
|
|
150
|
-
{
|
|
151
|
-
"name": "phone",
|
|
152
|
-
"description": "Recipient phone number (without + prefix)",
|
|
153
|
-
"schema": { "type": "string" },
|
|
154
|
-
"required": false
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"name": "group_id",
|
|
158
|
-
"description": "Group JID (e.g., 123456789@g.us)",
|
|
159
|
-
"schema": { "type": "string" },
|
|
160
|
-
"required": false
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"name": "type",
|
|
164
|
-
"description": "Message type",
|
|
165
|
-
"schema": {
|
|
166
|
-
"type": "string",
|
|
167
|
-
"enum": ["text", "image", "video", "audio", "document", "sticker", "location", "contact"]
|
|
168
|
-
},
|
|
169
|
-
"required": true
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"name": "message",
|
|
173
|
-
"description": "Text content (for text messages)",
|
|
174
|
-
"schema": { "type": "string" },
|
|
175
|
-
"required": false
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
"name": "media_data",
|
|
179
|
-
"description": "Media content (for media messages)",
|
|
180
|
-
"schema": { "$ref": "#/components/schemas/MediaData" },
|
|
181
|
-
"required": false
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"name": "location",
|
|
185
|
-
"description": "Location data (for location messages)",
|
|
186
|
-
"schema": { "$ref": "#/components/schemas/LocationData" },
|
|
187
|
-
"required": false
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"name": "contact",
|
|
191
|
-
"description": "Contact card (for contact messages)",
|
|
192
|
-
"schema": { "$ref": "#/components/schemas/ContactCard" },
|
|
193
|
-
"required": false
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"name": "reply",
|
|
197
|
-
"description": "Reply context for quoting a message",
|
|
198
|
-
"schema": { "$ref": "#/components/schemas/ReplyData" },
|
|
199
|
-
"required": false
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"name": "metadata",
|
|
203
|
-
"description": "Custom metadata key-value pairs",
|
|
204
|
-
"schema": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
205
|
-
"required": false
|
|
206
|
-
}
|
|
207
|
-
],
|
|
208
|
-
"result": {
|
|
209
|
-
"name": "SendResult",
|
|
210
|
-
"schema": {
|
|
211
|
-
"type": "object",
|
|
212
|
-
"properties": {
|
|
213
|
-
"message": { "type": "string", "enum": ["Sent"] }
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
"name": "media",
|
|
220
|
-
"summary": "Download media from a received message",
|
|
221
|
-
"params": [
|
|
222
|
-
{
|
|
223
|
-
"name": "message_id",
|
|
224
|
-
"description": "Message ID containing media",
|
|
225
|
-
"schema": { "type": "string" },
|
|
226
|
-
"required": true
|
|
227
|
-
}
|
|
228
|
-
],
|
|
229
|
-
"result": {
|
|
230
|
-
"name": "MediaResult",
|
|
231
|
-
"schema": {
|
|
232
|
-
"type": "object",
|
|
233
|
-
"properties": {
|
|
234
|
-
"data": { "type": "string", "description": "Base64-encoded media data" },
|
|
235
|
-
"mime_type": { "type": "string", "description": "MIME type of the media" }
|
|
236
|
-
},
|
|
237
|
-
"required": ["data", "mime_type"]
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
"name": "groups",
|
|
243
|
-
"summary": "List all groups the user is a member of",
|
|
244
|
-
"params": [],
|
|
245
|
-
"result": {
|
|
246
|
-
"name": "GroupsResult",
|
|
247
|
-
"schema": {
|
|
248
|
-
"type": "array",
|
|
249
|
-
"items": { "$ref": "#/components/schemas/GroupInfo" }
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
"name": "group_info",
|
|
255
|
-
"summary": "Get detailed information about a specific group",
|
|
256
|
-
"params": [
|
|
257
|
-
{
|
|
258
|
-
"name": "group_id",
|
|
259
|
-
"description": "Group JID (e.g., 123456789@g.us)",
|
|
260
|
-
"schema": { "type": "string" },
|
|
261
|
-
"required": true
|
|
262
|
-
}
|
|
263
|
-
],
|
|
264
|
-
"result": {
|
|
265
|
-
"name": "GroupInfoResult",
|
|
266
|
-
"schema": { "$ref": "#/components/schemas/GroupInfo" }
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
"name": "group_update",
|
|
271
|
-
"summary": "Update group name and/or description",
|
|
272
|
-
"params": [
|
|
273
|
-
{
|
|
274
|
-
"name": "group_id",
|
|
275
|
-
"description": "Group JID",
|
|
276
|
-
"schema": { "type": "string" },
|
|
277
|
-
"required": true
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"name": "name",
|
|
281
|
-
"description": "New group name",
|
|
282
|
-
"schema": { "type": "string" },
|
|
283
|
-
"required": false
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
"name": "topic",
|
|
287
|
-
"description": "New group description",
|
|
288
|
-
"schema": { "type": "string" },
|
|
289
|
-
"required": false
|
|
290
|
-
}
|
|
291
|
-
],
|
|
292
|
-
"result": {
|
|
293
|
-
"name": "GroupUpdateResult",
|
|
294
|
-
"schema": {
|
|
295
|
-
"type": "object",
|
|
296
|
-
"properties": {
|
|
297
|
-
"message": { "type": "string", "enum": ["Updated"] }
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
"name": "contact_check",
|
|
304
|
-
"summary": "Check if phone numbers are registered on WhatsApp",
|
|
305
|
-
"params": [
|
|
306
|
-
{
|
|
307
|
-
"name": "phones",
|
|
308
|
-
"description": "Array of phone numbers to check (without + prefix)",
|
|
309
|
-
"schema": { "type": "array", "items": { "type": "string" } },
|
|
310
|
-
"required": true
|
|
311
|
-
}
|
|
312
|
-
],
|
|
313
|
-
"result": {
|
|
314
|
-
"name": "ContactCheckResult",
|
|
315
|
-
"schema": {
|
|
316
|
-
"type": "array",
|
|
317
|
-
"items": {
|
|
318
|
-
"type": "object",
|
|
319
|
-
"properties": {
|
|
320
|
-
"query": { "type": "string", "description": "Original phone number queried" },
|
|
321
|
-
"jid": { "type": "string", "description": "WhatsApp JID if registered" },
|
|
322
|
-
"is_registered": { "type": "boolean" },
|
|
323
|
-
"is_business": { "type": "boolean" },
|
|
324
|
-
"business_name": { "type": "string" }
|
|
325
|
-
},
|
|
326
|
-
"required": ["query", "is_registered"]
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
"name": "contact_profile_pic",
|
|
333
|
-
"summary": "Get profile picture for a user or group",
|
|
334
|
-
"params": [
|
|
335
|
-
{
|
|
336
|
-
"name": "jid",
|
|
337
|
-
"description": "User or group JID",
|
|
338
|
-
"schema": { "type": "string" },
|
|
339
|
-
"required": true
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
"name": "preview",
|
|
343
|
-
"description": "Get smaller preview image",
|
|
344
|
-
"schema": { "type": "boolean" },
|
|
345
|
-
"required": false
|
|
346
|
-
}
|
|
347
|
-
],
|
|
348
|
-
"result": {
|
|
349
|
-
"name": "ProfilePicResult",
|
|
350
|
-
"schema": {
|
|
351
|
-
"type": "object",
|
|
352
|
-
"properties": {
|
|
353
|
-
"exists": { "type": "boolean", "description": "Whether profile picture exists" },
|
|
354
|
-
"url": { "type": "string", "description": "URL to download image" },
|
|
355
|
-
"id": { "type": "string", "description": "Image identifier" },
|
|
356
|
-
"data": { "type": "string", "description": "Base64-encoded image data" }
|
|
357
|
-
},
|
|
358
|
-
"required": ["exists"]
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
"name": "contacts",
|
|
364
|
-
"summary": "List all contacts with saved names",
|
|
365
|
-
"description": "Returns contacts from the whatsmeow_contacts store with user-saved names",
|
|
366
|
-
"params": [
|
|
367
|
-
{
|
|
368
|
-
"name": "query",
|
|
369
|
-
"description": "Optional search query to filter by name or phone number",
|
|
370
|
-
"schema": { "type": "string" },
|
|
371
|
-
"required": false
|
|
372
|
-
}
|
|
373
|
-
],
|
|
374
|
-
"result": {
|
|
375
|
-
"name": "ContactsResult",
|
|
376
|
-
"schema": {
|
|
377
|
-
"type": "object",
|
|
378
|
-
"properties": {
|
|
379
|
-
"contacts": {
|
|
380
|
-
"type": "array",
|
|
381
|
-
"items": {
|
|
382
|
-
"type": "object",
|
|
383
|
-
"properties": {
|
|
384
|
-
"jid": { "type": "string", "description": "Full JID (e.g., 919876543210@s.whatsapp.net)" },
|
|
385
|
-
"phone": { "type": "string", "description": "Phone number without @s.whatsapp.net" },
|
|
386
|
-
"name": { "type": "string", "description": "User's saved contact name (e.g., 'Mummy', 'Dad')" },
|
|
387
|
-
"push_name": { "type": "string", "description": "WhatsApp profile name set by user" },
|
|
388
|
-
"is_contact": { "type": "boolean", "description": "Whether this is a saved contact" }
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
"total": { "type": "integer", "description": "Total number of contacts returned" }
|
|
393
|
-
},
|
|
394
|
-
"required": ["contacts", "total"]
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
"name": "contact_info",
|
|
400
|
-
"summary": "Get full information for a single contact",
|
|
401
|
-
"description": "Returns comprehensive contact info including name, business status, and profile picture URL",
|
|
402
|
-
"params": [
|
|
403
|
-
{
|
|
404
|
-
"name": "phone",
|
|
405
|
-
"description": "Phone number (with or without + prefix)",
|
|
406
|
-
"schema": { "type": "string" },
|
|
407
|
-
"required": true
|
|
408
|
-
}
|
|
409
|
-
],
|
|
410
|
-
"result": {
|
|
411
|
-
"name": "ContactInfoResult",
|
|
412
|
-
"schema": {
|
|
413
|
-
"type": "object",
|
|
414
|
-
"properties": {
|
|
415
|
-
"jid": { "type": "string", "description": "Full JID for sending messages" },
|
|
416
|
-
"phone": { "type": "string", "description": "Phone number" },
|
|
417
|
-
"name": { "type": "string", "description": "User's saved contact name" },
|
|
418
|
-
"push_name": { "type": "string", "description": "WhatsApp profile name" },
|
|
419
|
-
"business_name": { "type": "string", "description": "Business account verified name" },
|
|
420
|
-
"is_business": { "type": "boolean", "description": "Whether this is a business account" },
|
|
421
|
-
"is_contact": { "type": "boolean", "description": "Whether saved in contacts" },
|
|
422
|
-
"profile_pic": { "type": "string", "description": "Profile picture URL" }
|
|
423
|
-
},
|
|
424
|
-
"required": ["jid", "phone"]
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
"name": "typing",
|
|
430
|
-
"summary": "Send typing indicator to a chat",
|
|
431
|
-
"params": [
|
|
432
|
-
{
|
|
433
|
-
"name": "jid",
|
|
434
|
-
"description": "Chat JID (individual or group)",
|
|
435
|
-
"schema": { "type": "string" },
|
|
436
|
-
"required": true
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
"name": "state",
|
|
440
|
-
"description": "Typing state: 'composing' or 'paused'",
|
|
441
|
-
"schema": { "type": "string", "enum": ["composing", "paused"] },
|
|
442
|
-
"required": true
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
"name": "media",
|
|
446
|
-
"description": "Media type: '' for text, 'audio' for voice recording",
|
|
447
|
-
"schema": { "type": "string", "enum": ["", "text", "audio"] },
|
|
448
|
-
"required": false
|
|
449
|
-
}
|
|
450
|
-
],
|
|
451
|
-
"result": {
|
|
452
|
-
"name": "TypingResult",
|
|
453
|
-
"schema": {
|
|
454
|
-
"type": "object",
|
|
455
|
-
"properties": {
|
|
456
|
-
"message": { "type": "string", "enum": ["Typing indicator sent"] }
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
"name": "presence",
|
|
463
|
-
"summary": "Set online/offline presence status",
|
|
464
|
-
"params": [
|
|
465
|
-
{
|
|
466
|
-
"name": "status",
|
|
467
|
-
"description": "Presence status: 'available' or 'unavailable'",
|
|
468
|
-
"schema": { "type": "string", "enum": ["available", "unavailable"] },
|
|
469
|
-
"required": true
|
|
470
|
-
}
|
|
471
|
-
],
|
|
472
|
-
"result": {
|
|
473
|
-
"name": "PresenceResult",
|
|
474
|
-
"schema": {
|
|
475
|
-
"type": "object",
|
|
476
|
-
"properties": {
|
|
477
|
-
"message": { "type": "string", "enum": ["Presence set"] }
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
"name": "mark_read",
|
|
484
|
-
"summary": "Mark messages as read",
|
|
485
|
-
"params": [
|
|
486
|
-
{
|
|
487
|
-
"name": "message_ids",
|
|
488
|
-
"description": "Array of message IDs to mark as read",
|
|
489
|
-
"schema": { "type": "array", "items": { "type": "string" } },
|
|
490
|
-
"required": true
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
"name": "chat_jid",
|
|
494
|
-
"description": "Chat JID where messages are from",
|
|
495
|
-
"schema": { "type": "string" },
|
|
496
|
-
"required": true
|
|
497
|
-
},
|
|
498
|
-
{
|
|
499
|
-
"name": "sender_jid",
|
|
500
|
-
"description": "Sender JID (required for group messages)",
|
|
501
|
-
"schema": { "type": "string" },
|
|
502
|
-
"required": false
|
|
503
|
-
}
|
|
504
|
-
],
|
|
505
|
-
"result": {
|
|
506
|
-
"name": "MarkReadResult",
|
|
507
|
-
"schema": {
|
|
508
|
-
"type": "object",
|
|
509
|
-
"properties": {
|
|
510
|
-
"message": { "type": "string", "enum": ["Messages marked as read"] }
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
"name": "group_participants_add",
|
|
517
|
-
"summary": "Add participants to a group",
|
|
518
|
-
"params": [
|
|
519
|
-
{
|
|
520
|
-
"name": "group_id",
|
|
521
|
-
"description": "Group JID (e.g., 123456789@g.us)",
|
|
522
|
-
"schema": { "type": "string" },
|
|
523
|
-
"required": true
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
"name": "participants",
|
|
527
|
-
"description": "Array of phone numbers or JIDs to add",
|
|
528
|
-
"schema": { "type": "array", "items": { "type": "string" } },
|
|
529
|
-
"required": true
|
|
530
|
-
}
|
|
531
|
-
],
|
|
532
|
-
"result": {
|
|
533
|
-
"name": "GroupParticipantsAddResult",
|
|
534
|
-
"schema": { "$ref": "#/components/schemas/GroupParticipantsResult" }
|
|
535
|
-
}
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
"name": "group_participants_remove",
|
|
539
|
-
"summary": "Remove participants from a group",
|
|
540
|
-
"params": [
|
|
541
|
-
{
|
|
542
|
-
"name": "group_id",
|
|
543
|
-
"description": "Group JID (e.g., 123456789@g.us)",
|
|
544
|
-
"schema": { "type": "string" },
|
|
545
|
-
"required": true
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
"name": "participants",
|
|
549
|
-
"description": "Array of phone numbers or JIDs to remove",
|
|
550
|
-
"schema": { "type": "array", "items": { "type": "string" } },
|
|
551
|
-
"required": true
|
|
552
|
-
}
|
|
553
|
-
],
|
|
554
|
-
"result": {
|
|
555
|
-
"name": "GroupParticipantsRemoveResult",
|
|
556
|
-
"schema": { "$ref": "#/components/schemas/GroupParticipantsResult" }
|
|
557
|
-
}
|
|
558
|
-
},
|
|
559
|
-
{
|
|
560
|
-
"name": "group_invite_link",
|
|
561
|
-
"summary": "Get group invite link",
|
|
562
|
-
"params": [
|
|
563
|
-
{
|
|
564
|
-
"name": "group_id",
|
|
565
|
-
"description": "Group JID",
|
|
566
|
-
"schema": { "type": "string" },
|
|
567
|
-
"required": true
|
|
568
|
-
}
|
|
569
|
-
],
|
|
570
|
-
"result": {
|
|
571
|
-
"name": "GroupInviteLinkResult",
|
|
572
|
-
"schema": { "$ref": "#/components/schemas/GroupInviteLinkResult" }
|
|
573
|
-
}
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
"name": "group_revoke_invite",
|
|
577
|
-
"summary": "Revoke and regenerate group invite link",
|
|
578
|
-
"params": [
|
|
579
|
-
{
|
|
580
|
-
"name": "group_id",
|
|
581
|
-
"description": "Group JID",
|
|
582
|
-
"schema": { "type": "string" },
|
|
583
|
-
"required": true
|
|
584
|
-
}
|
|
585
|
-
],
|
|
586
|
-
"result": {
|
|
587
|
-
"name": "GroupRevokeInviteResult",
|
|
588
|
-
"schema": { "$ref": "#/components/schemas/GroupInviteLinkResult" }
|
|
589
|
-
}
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
"name": "rate_limit_get",
|
|
593
|
-
"summary": "Get rate limit configuration and statistics",
|
|
594
|
-
"params": [],
|
|
595
|
-
"result": {
|
|
596
|
-
"name": "RateLimitGetResult",
|
|
597
|
-
"schema": {
|
|
598
|
-
"type": "object",
|
|
599
|
-
"properties": {
|
|
600
|
-
"config": { "$ref": "#/components/schemas/RateLimitConfig" },
|
|
601
|
-
"stats": { "$ref": "#/components/schemas/RateLimitStats" }
|
|
602
|
-
},
|
|
603
|
-
"required": ["config", "stats"]
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
},
|
|
607
|
-
{
|
|
608
|
-
"name": "rate_limit_set",
|
|
609
|
-
"summary": "Update rate limit configuration",
|
|
610
|
-
"params": [
|
|
611
|
-
{
|
|
612
|
-
"name": "enabled",
|
|
613
|
-
"description": "Enable/disable rate limiting",
|
|
614
|
-
"schema": { "type": "boolean" },
|
|
615
|
-
"required": false
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
"name": "min_delay_ms",
|
|
619
|
-
"description": "Minimum delay between messages (milliseconds)",
|
|
620
|
-
"schema": { "type": "integer" },
|
|
621
|
-
"required": false
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
"name": "max_delay_ms",
|
|
625
|
-
"description": "Maximum delay for randomization (milliseconds)",
|
|
626
|
-
"schema": { "type": "integer" },
|
|
627
|
-
"required": false
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
"name": "typing_delay_ms",
|
|
631
|
-
"description": "Typing indicator duration (milliseconds)",
|
|
632
|
-
"schema": { "type": "integer" },
|
|
633
|
-
"required": false
|
|
634
|
-
},
|
|
635
|
-
{
|
|
636
|
-
"name": "link_extra_delay_ms",
|
|
637
|
-
"description": "Extra delay for messages with links (milliseconds)",
|
|
638
|
-
"schema": { "type": "integer" },
|
|
639
|
-
"required": false
|
|
640
|
-
},
|
|
641
|
-
{
|
|
642
|
-
"name": "max_messages_per_minute",
|
|
643
|
-
"description": "Maximum messages per minute",
|
|
644
|
-
"schema": { "type": "integer" },
|
|
645
|
-
"required": false
|
|
646
|
-
},
|
|
647
|
-
{
|
|
648
|
-
"name": "max_messages_per_hour",
|
|
649
|
-
"description": "Maximum messages per hour",
|
|
650
|
-
"schema": { "type": "integer" },
|
|
651
|
-
"required": false
|
|
652
|
-
},
|
|
653
|
-
{
|
|
654
|
-
"name": "max_new_contacts_per_day",
|
|
655
|
-
"description": "Maximum new contacts per day",
|
|
656
|
-
"schema": { "type": "integer" },
|
|
657
|
-
"required": false
|
|
658
|
-
},
|
|
659
|
-
{
|
|
660
|
-
"name": "simulate_typing",
|
|
661
|
-
"description": "Send typing indicator before messages",
|
|
662
|
-
"schema": { "type": "boolean" },
|
|
663
|
-
"required": false
|
|
664
|
-
},
|
|
665
|
-
{
|
|
666
|
-
"name": "randomize_delays",
|
|
667
|
-
"description": "Add random variance to delays",
|
|
668
|
-
"schema": { "type": "boolean" },
|
|
669
|
-
"required": false
|
|
670
|
-
},
|
|
671
|
-
{
|
|
672
|
-
"name": "pause_on_low_response",
|
|
673
|
-
"description": "Auto-pause if response rate drops",
|
|
674
|
-
"schema": { "type": "boolean" },
|
|
675
|
-
"required": false
|
|
676
|
-
},
|
|
677
|
-
{
|
|
678
|
-
"name": "response_rate_threshold",
|
|
679
|
-
"description": "Minimum response rate threshold (0.0-1.0)",
|
|
680
|
-
"schema": { "type": "number" },
|
|
681
|
-
"required": false
|
|
682
|
-
}
|
|
683
|
-
],
|
|
684
|
-
"result": {
|
|
685
|
-
"name": "RateLimitSetResult",
|
|
686
|
-
"schema": {
|
|
687
|
-
"type": "object",
|
|
688
|
-
"properties": {
|
|
689
|
-
"message": { "type": "string" },
|
|
690
|
-
"config": { "$ref": "#/components/schemas/RateLimitConfig" }
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
},
|
|
695
|
-
{
|
|
696
|
-
"name": "rate_limit_stats",
|
|
697
|
-
"summary": "Get current rate limiting statistics only",
|
|
698
|
-
"params": [],
|
|
699
|
-
"result": {
|
|
700
|
-
"name": "RateLimitStatsResult",
|
|
701
|
-
"schema": { "$ref": "#/components/schemas/RateLimitStats" }
|
|
702
|
-
}
|
|
703
|
-
},
|
|
704
|
-
{
|
|
705
|
-
"name": "rate_limit_unpause",
|
|
706
|
-
"summary": "Resume rate limiting after automatic pause",
|
|
707
|
-
"params": [],
|
|
708
|
-
"result": {
|
|
709
|
-
"name": "RateLimitUnpauseResult",
|
|
710
|
-
"schema": {
|
|
711
|
-
"type": "object",
|
|
712
|
-
"properties": {
|
|
713
|
-
"message": { "type": "string" },
|
|
714
|
-
"stats": { "$ref": "#/components/schemas/RateLimitStats" }
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
},
|
|
719
|
-
{
|
|
720
|
-
"name": "chat_history",
|
|
721
|
-
"summary": "Get chat history from stored messages",
|
|
722
|
-
"description": "Retrieve messages from SQLite history store. Messages are synced on first WhatsApp login and stored for later retrieval. Supports filtering by chat type (individual/group), sender, and message type.",
|
|
723
|
-
"params": [
|
|
724
|
-
{
|
|
725
|
-
"name": "chat_id",
|
|
726
|
-
"description": "Chat JID (e.g., 1234567890@s.whatsapp.net for individual, 123456789@g.us for group)",
|
|
727
|
-
"schema": { "type": "string" },
|
|
728
|
-
"required": false
|
|
729
|
-
},
|
|
730
|
-
{
|
|
731
|
-
"name": "phone",
|
|
732
|
-
"description": "Phone number for individual chats (without +). Converted to JID automatically.",
|
|
733
|
-
"schema": { "type": "string" },
|
|
734
|
-
"required": false
|
|
735
|
-
},
|
|
736
|
-
{
|
|
737
|
-
"name": "group_id",
|
|
738
|
-
"description": "Group JID (e.g., 123456789@g.us)",
|
|
739
|
-
"schema": { "type": "string" },
|
|
740
|
-
"required": false
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
"name": "limit",
|
|
744
|
-
"description": "Maximum messages to return (default: 50, max: 500)",
|
|
745
|
-
"schema": { "type": "integer", "default": 50, "minimum": 1, "maximum": 500 },
|
|
746
|
-
"required": false
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
"name": "offset",
|
|
750
|
-
"description": "Number of messages to skip for pagination (default: 0)",
|
|
751
|
-
"schema": { "type": "integer", "default": 0 },
|
|
752
|
-
"required": false
|
|
753
|
-
},
|
|
754
|
-
{
|
|
755
|
-
"name": "sender_phone",
|
|
756
|
-
"description": "Filter group messages by sender phone number",
|
|
757
|
-
"schema": { "type": "string" },
|
|
758
|
-
"required": false
|
|
759
|
-
},
|
|
760
|
-
{
|
|
761
|
-
"name": "text_only",
|
|
762
|
-
"description": "Only return text messages (default: false)",
|
|
763
|
-
"schema": { "type": "boolean", "default": false },
|
|
764
|
-
"required": false
|
|
765
|
-
}
|
|
766
|
-
],
|
|
767
|
-
"result": {
|
|
768
|
-
"name": "ChatHistoryResult",
|
|
769
|
-
"schema": { "$ref": "#/components/schemas/ChatHistoryResult" }
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
],
|
|
773
|
-
"components": {
|
|
774
|
-
"schemas": {
|
|
775
|
-
"ChatHistoryResult": {
|
|
776
|
-
"type": "object",
|
|
777
|
-
"description": "Chat history query result",
|
|
778
|
-
"properties": {
|
|
779
|
-
"messages": {
|
|
780
|
-
"type": "array",
|
|
781
|
-
"description": "Array of message records",
|
|
782
|
-
"items": { "$ref": "#/components/schemas/MessageRecord" }
|
|
783
|
-
},
|
|
784
|
-
"total": { "type": "integer", "description": "Total matching messages in database" },
|
|
785
|
-
"has_more": { "type": "boolean", "description": "Whether more messages exist beyond limit+offset" }
|
|
786
|
-
},
|
|
787
|
-
"required": ["messages", "total", "has_more"]
|
|
788
|
-
},
|
|
789
|
-
"MessageRecord": {
|
|
790
|
-
"type": "object",
|
|
791
|
-
"description": "Stored message record from history",
|
|
792
|
-
"properties": {
|
|
793
|
-
"message_id": { "type": "string", "description": "Unique message ID" },
|
|
794
|
-
"chat_id": { "type": "string", "description": "Chat JID (individual or group)" },
|
|
795
|
-
"sender": { "type": "string", "description": "Sender JID" },
|
|
796
|
-
"sender_phone": { "type": "string", "description": "Sender phone number" },
|
|
797
|
-
"message_type": {
|
|
798
|
-
"type": "string",
|
|
799
|
-
"enum": ["text", "image", "video", "audio", "document", "sticker", "location", "contact"],
|
|
800
|
-
"description": "Type of message"
|
|
801
|
-
},
|
|
802
|
-
"text": { "type": "string", "description": "Text content (or caption for media)" },
|
|
803
|
-
"timestamp": { "type": "string", "format": "date-time", "description": "Message timestamp" },
|
|
804
|
-
"is_group": { "type": "boolean", "description": "Whether message is from a group chat" },
|
|
805
|
-
"is_from_me": { "type": "boolean", "description": "Whether message was sent by the connected device" }
|
|
806
|
-
},
|
|
807
|
-
"required": ["message_id", "chat_id", "sender", "message_type", "timestamp", "is_group", "is_from_me"]
|
|
808
|
-
},
|
|
809
|
-
"MediaData": {
|
|
810
|
-
"type": "object",
|
|
811
|
-
"description": "Media content for sending",
|
|
812
|
-
"properties": {
|
|
813
|
-
"data": { "type": "string", "description": "Base64-encoded media data" },
|
|
814
|
-
"mime_type": { "type": "string", "description": "MIME type (e.g., image/jpeg, video/mp4)" },
|
|
815
|
-
"filename": { "type": "string", "description": "Optional filename for documents" },
|
|
816
|
-
"caption": { "type": "string", "description": "Optional caption for images/videos" },
|
|
817
|
-
"thumbnail": { "type": "string", "description": "Optional base64 thumbnail" }
|
|
818
|
-
},
|
|
819
|
-
"required": ["data", "mime_type"]
|
|
820
|
-
},
|
|
821
|
-
"LocationData": {
|
|
822
|
-
"type": "object",
|
|
823
|
-
"description": "Location information",
|
|
824
|
-
"properties": {
|
|
825
|
-
"latitude": { "type": "number" },
|
|
826
|
-
"longitude": { "type": "number" },
|
|
827
|
-
"name": { "type": "string", "description": "Location name" },
|
|
828
|
-
"address": { "type": "string", "description": "Address" }
|
|
829
|
-
},
|
|
830
|
-
"required": ["latitude", "longitude"]
|
|
831
|
-
},
|
|
832
|
-
"ContactCard": {
|
|
833
|
-
"type": "object",
|
|
834
|
-
"description": "Contact vCard",
|
|
835
|
-
"properties": {
|
|
836
|
-
"display_name": { "type": "string" },
|
|
837
|
-
"vcard": { "type": "string", "description": "vCard 3.0 format string" }
|
|
838
|
-
},
|
|
839
|
-
"required": ["display_name", "vcard"]
|
|
840
|
-
},
|
|
841
|
-
"ReplyData": {
|
|
842
|
-
"type": "object",
|
|
843
|
-
"description": "Reply context for quoting messages",
|
|
844
|
-
"properties": {
|
|
845
|
-
"message_id": { "type": "string", "description": "ID of message to reply to" },
|
|
846
|
-
"sender": { "type": "string", "description": "Sender JID of quoted message" },
|
|
847
|
-
"content": { "type": "string", "description": "Text preview of quoted message" }
|
|
848
|
-
},
|
|
849
|
-
"required": ["message_id", "sender", "content"]
|
|
850
|
-
},
|
|
851
|
-
"GroupInfo": {
|
|
852
|
-
"type": "object",
|
|
853
|
-
"description": "Group information",
|
|
854
|
-
"properties": {
|
|
855
|
-
"jid": { "type": "string", "description": "Group JID (e.g., 123456789@g.us)" },
|
|
856
|
-
"name": { "type": "string" },
|
|
857
|
-
"topic": { "type": "string", "description": "Group description" },
|
|
858
|
-
"owner": { "type": "string", "description": "Owner JID" },
|
|
859
|
-
"participants": {
|
|
860
|
-
"type": "array",
|
|
861
|
-
"items": { "$ref": "#/components/schemas/GroupParticipant" }
|
|
862
|
-
},
|
|
863
|
-
"created_at": { "type": "string", "format": "date-time" },
|
|
864
|
-
"size": { "type": "integer", "description": "Number of participants" },
|
|
865
|
-
"is_announce": { "type": "boolean", "description": "Only admins can send messages" },
|
|
866
|
-
"is_locked": { "type": "boolean", "description": "Only admins can edit group info" }
|
|
867
|
-
},
|
|
868
|
-
"required": ["jid", "name", "owner", "participants", "size"]
|
|
869
|
-
},
|
|
870
|
-
"GroupParticipant": {
|
|
871
|
-
"type": "object",
|
|
872
|
-
"description": "Group member with resolved phone number",
|
|
873
|
-
"properties": {
|
|
874
|
-
"jid": { "type": "string", "description": "Participant JID (may be LID format)" },
|
|
875
|
-
"phone": { "type": "string", "description": "Real phone number (resolved from LID if needed)" },
|
|
876
|
-
"name": { "type": "string" },
|
|
877
|
-
"is_admin": { "type": "boolean" },
|
|
878
|
-
"is_super_admin": { "type": "boolean", "description": "True for group owner" }
|
|
879
|
-
},
|
|
880
|
-
"required": ["jid", "phone", "is_admin", "is_super_admin"]
|
|
881
|
-
},
|
|
882
|
-
"GroupParticipantsResult": {
|
|
883
|
-
"type": "object",
|
|
884
|
-
"description": "Result of participant changes",
|
|
885
|
-
"properties": {
|
|
886
|
-
"group_id": { "type": "string", "description": "Group JID" },
|
|
887
|
-
"action": { "type": "string", "enum": ["add", "remove"], "description": "Action performed" },
|
|
888
|
-
"results": {
|
|
889
|
-
"type": "array",
|
|
890
|
-
"items": { "$ref": "#/components/schemas/GroupParticipantChangeResult" }
|
|
891
|
-
},
|
|
892
|
-
"added": { "type": "integer", "description": "Number of participants successfully added" },
|
|
893
|
-
"removed": { "type": "integer", "description": "Number of participants successfully removed" },
|
|
894
|
-
"failed": { "type": "integer", "description": "Number of failed operations" }
|
|
895
|
-
},
|
|
896
|
-
"required": ["group_id", "action", "results", "failed"]
|
|
897
|
-
},
|
|
898
|
-
"GroupParticipantChangeResult": {
|
|
899
|
-
"type": "object",
|
|
900
|
-
"description": "Result for a single participant change",
|
|
901
|
-
"properties": {
|
|
902
|
-
"jid": { "type": "string", "description": "Participant JID" },
|
|
903
|
-
"phone": { "type": "string", "description": "Phone number" },
|
|
904
|
-
"success": { "type": "boolean", "description": "Whether operation succeeded" },
|
|
905
|
-
"error": { "type": "string", "description": "Error message if failed" }
|
|
906
|
-
},
|
|
907
|
-
"required": ["jid", "success"]
|
|
908
|
-
},
|
|
909
|
-
"GroupInviteLinkResult": {
|
|
910
|
-
"type": "object",
|
|
911
|
-
"description": "Group invite link information",
|
|
912
|
-
"properties": {
|
|
913
|
-
"group_id": { "type": "string", "description": "Group JID" },
|
|
914
|
-
"invite_link": { "type": "string", "description": "Full invite link (https://chat.whatsapp.com/...)" },
|
|
915
|
-
"revoked": { "type": "boolean", "description": "Whether old link was revoked" }
|
|
916
|
-
},
|
|
917
|
-
"required": ["group_id", "invite_link"]
|
|
918
|
-
},
|
|
919
|
-
"RateLimitConfig": {
|
|
920
|
-
"type": "object",
|
|
921
|
-
"description": "Rate limiting configuration for anti-ban protection",
|
|
922
|
-
"properties": {
|
|
923
|
-
"enabled": { "type": "boolean", "default": true, "description": "Enable rate limiting" },
|
|
924
|
-
"min_delay_ms": { "type": "integer", "default": 3000, "description": "Minimum delay between messages (ms)" },
|
|
925
|
-
"max_delay_ms": { "type": "integer", "default": 8000, "description": "Maximum delay for randomization (ms)" },
|
|
926
|
-
"typing_delay_ms": { "type": "integer", "default": 2000, "description": "Typing indicator duration (ms)" },
|
|
927
|
-
"link_extra_delay_ms": { "type": "integer", "default": 5000, "description": "Extra delay for messages with links (ms)" },
|
|
928
|
-
"max_messages_per_minute": { "type": "integer", "default": 10, "description": "Per-minute message limit" },
|
|
929
|
-
"max_messages_per_hour": { "type": "integer", "default": 60, "description": "Per-hour message limit" },
|
|
930
|
-
"max_new_contacts_per_day": { "type": "integer", "default": 20, "description": "Daily new contacts limit" },
|
|
931
|
-
"simulate_typing": { "type": "boolean", "default": true, "description": "Send typing indicator before messages" },
|
|
932
|
-
"randomize_delays": { "type": "boolean", "default": true, "description": "Add random variance to delays" },
|
|
933
|
-
"pause_on_low_response": { "type": "boolean", "default": false, "description": "Auto-pause if response rate drops" },
|
|
934
|
-
"response_rate_threshold": { "type": "number", "default": 0.3, "description": "Minimum response rate (0.0-1.0)" }
|
|
935
|
-
}
|
|
936
|
-
},
|
|
937
|
-
"RateLimitStats": {
|
|
938
|
-
"type": "object",
|
|
939
|
-
"description": "Current rate limiting statistics",
|
|
940
|
-
"properties": {
|
|
941
|
-
"messages_sent_last_minute": { "type": "integer", "description": "Messages sent in last 60 seconds" },
|
|
942
|
-
"messages_sent_last_hour": { "type": "integer", "description": "Messages sent in last 60 minutes" },
|
|
943
|
-
"messages_sent_today": { "type": "integer", "description": "Total messages sent today" },
|
|
944
|
-
"new_contacts_today": { "type": "integer", "description": "New contacts messaged today" },
|
|
945
|
-
"responses_received": { "type": "integer", "description": "Responses received today" },
|
|
946
|
-
"response_rate": { "type": "number", "description": "Response rate (responses/sent)" },
|
|
947
|
-
"is_paused": { "type": "boolean", "description": "Whether rate limiting is paused" },
|
|
948
|
-
"pause_reason": { "type": "string", "description": "Reason for pause if paused" },
|
|
949
|
-
"last_message_time": { "type": "string", "format": "date-time", "description": "Time of last sent message" },
|
|
950
|
-
"next_allowed_time": { "type": "string", "format": "date-time", "description": "Earliest time next message allowed" }
|
|
951
|
-
}
|
|
952
|
-
},
|
|
953
|
-
"ReceivedMedia": {
|
|
954
|
-
"type": "object",
|
|
955
|
-
"description": "Received media (image/video) information",
|
|
956
|
-
"properties": {
|
|
957
|
-
"mime_type": { "type": "string" },
|
|
958
|
-
"file_sha256": { "type": "string" },
|
|
959
|
-
"file_length": { "type": "integer" },
|
|
960
|
-
"caption": { "type": "string" },
|
|
961
|
-
"url": { "type": "string" },
|
|
962
|
-
"seconds": { "type": "integer", "description": "Duration for video" }
|
|
963
|
-
}
|
|
964
|
-
},
|
|
965
|
-
"ReceivedAudio": {
|
|
966
|
-
"type": "object",
|
|
967
|
-
"description": "Received audio/voice message information",
|
|
968
|
-
"properties": {
|
|
969
|
-
"mime_type": { "type": "string" },
|
|
970
|
-
"file_sha256": { "type": "string" },
|
|
971
|
-
"file_length": { "type": "integer" },
|
|
972
|
-
"seconds": { "type": "integer" },
|
|
973
|
-
"ptt": { "type": "boolean", "description": "True for voice messages (push-to-talk)" },
|
|
974
|
-
"url": { "type": "string" }
|
|
975
|
-
}
|
|
976
|
-
},
|
|
977
|
-
"ReceivedDocument": {
|
|
978
|
-
"type": "object",
|
|
979
|
-
"description": "Received document information",
|
|
980
|
-
"properties": {
|
|
981
|
-
"mime_type": { "type": "string" },
|
|
982
|
-
"file_sha256": { "type": "string" },
|
|
983
|
-
"file_length": { "type": "integer" },
|
|
984
|
-
"file_name": { "type": "string" },
|
|
985
|
-
"title": { "type": "string" },
|
|
986
|
-
"caption": { "type": "string" },
|
|
987
|
-
"url": { "type": "string" }
|
|
988
|
-
}
|
|
989
|
-
},
|
|
990
|
-
"ReceivedContact": {
|
|
991
|
-
"type": "object",
|
|
992
|
-
"description": "Received contact vCard",
|
|
993
|
-
"properties": {
|
|
994
|
-
"display_name": { "type": "string" },
|
|
995
|
-
"vcard": { "type": "string" }
|
|
996
|
-
}
|
|
997
|
-
},
|
|
998
|
-
"ReceivedSticker": {
|
|
999
|
-
"type": "object",
|
|
1000
|
-
"description": "Received sticker information",
|
|
1001
|
-
"properties": {
|
|
1002
|
-
"mime_type": { "type": "string" },
|
|
1003
|
-
"file_sha256": { "type": "string" },
|
|
1004
|
-
"file_length": { "type": "integer" },
|
|
1005
|
-
"is_animated": { "type": "boolean", "description": "True for animated stickers" },
|
|
1006
|
-
"url": { "type": "string" }
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
},
|
|
1010
|
-
"events": {
|
|
1011
|
-
"description": "Server-sent notifications (JSON-RPC without id)",
|
|
1012
|
-
"types": {
|
|
1013
|
-
"event.status": {
|
|
1014
|
-
"description": "Initial status sent on WebSocket connection",
|
|
1015
|
-
"params": {
|
|
1016
|
-
"connected": { "type": "boolean" },
|
|
1017
|
-
"has_session": { "type": "boolean" },
|
|
1018
|
-
"running": { "type": "boolean" },
|
|
1019
|
-
"pairing": { "type": "boolean" },
|
|
1020
|
-
"device_id": { "type": "string" },
|
|
1021
|
-
"timestamp": { "type": "string", "format": "date-time" }
|
|
1022
|
-
}
|
|
1023
|
-
},
|
|
1024
|
-
"event.connected": {
|
|
1025
|
-
"description": "WhatsApp connected successfully",
|
|
1026
|
-
"params": {
|
|
1027
|
-
"status": { "type": "string", "enum": ["connected"] },
|
|
1028
|
-
"device_id": { "type": "string" }
|
|
1029
|
-
}
|
|
1030
|
-
},
|
|
1031
|
-
"event.disconnected": {
|
|
1032
|
-
"description": "WhatsApp disconnected",
|
|
1033
|
-
"params": {
|
|
1034
|
-
"status": { "type": "string", "enum": ["disconnected"] },
|
|
1035
|
-
"reason": { "type": "string" }
|
|
1036
|
-
}
|
|
1037
|
-
},
|
|
1038
|
-
"event.connection_failure": {
|
|
1039
|
-
"description": "Connection failed",
|
|
1040
|
-
"params": {
|
|
1041
|
-
"error": { "type": "string" },
|
|
1042
|
-
"reason": { "type": "string" }
|
|
1043
|
-
}
|
|
1044
|
-
},
|
|
1045
|
-
"event.logged_out": {
|
|
1046
|
-
"description": "User logged out",
|
|
1047
|
-
"params": {
|
|
1048
|
-
"on_connect": { "type": "boolean" },
|
|
1049
|
-
"reason": { "type": "string" }
|
|
1050
|
-
}
|
|
1051
|
-
},
|
|
1052
|
-
"event.temporary_ban": {
|
|
1053
|
-
"description": "Temporary ban received",
|
|
1054
|
-
"params": {
|
|
1055
|
-
"code": { "type": "string" },
|
|
1056
|
-
"reason": { "type": "string" }
|
|
1057
|
-
}
|
|
1058
|
-
},
|
|
1059
|
-
"event.qr_code": {
|
|
1060
|
-
"description": "New QR code available for pairing",
|
|
1061
|
-
"params": {
|
|
1062
|
-
"code": { "type": "string", "description": "QR code content" },
|
|
1063
|
-
"filename": { "type": "string", "description": "PNG file path" },
|
|
1064
|
-
"image_data": { "type": "string", "description": "Base64-encoded PNG data" }
|
|
1065
|
-
}
|
|
1066
|
-
},
|
|
1067
|
-
"event.message_sent": {
|
|
1068
|
-
"description": "Message sent successfully",
|
|
1069
|
-
"params": {
|
|
1070
|
-
"message_id": { "type": "string" },
|
|
1071
|
-
"to": { "type": "string" },
|
|
1072
|
-
"type": { "type": "string" },
|
|
1073
|
-
"timestamp": { "type": "string", "format": "date-time" }
|
|
1074
|
-
}
|
|
1075
|
-
},
|
|
1076
|
-
"event.message_received": {
|
|
1077
|
-
"description": "New message received",
|
|
1078
|
-
"params": {
|
|
1079
|
-
"message_id": { "type": "string" },
|
|
1080
|
-
"sender": { "type": "string", "description": "Sender JID" },
|
|
1081
|
-
"chat_id": { "type": "string", "description": "Chat JID (same as sender for DMs, group JID for groups)" },
|
|
1082
|
-
"timestamp": { "type": "string", "format": "date-time" },
|
|
1083
|
-
"is_from_me": { "type": "boolean" },
|
|
1084
|
-
"is_group": { "type": "boolean" },
|
|
1085
|
-
"is_forwarded": { "type": "boolean", "description": "Whether the message was forwarded" },
|
|
1086
|
-
"forwarding_score": { "type": "integer", "description": "Number of times forwarded (higher = forwarded many times)" },
|
|
1087
|
-
"message_type": {
|
|
1088
|
-
"type": "string",
|
|
1089
|
-
"enum": ["text", "image", "video", "audio", "document", "sticker", "location", "contact", "contacts"]
|
|
1090
|
-
},
|
|
1091
|
-
"content": { "type": "object", "description": "Message content (varies by type)" },
|
|
1092
|
-
"text": { "type": "string", "description": "Text content (for text messages)" },
|
|
1093
|
-
"image": { "$ref": "#/components/schemas/ReceivedMedia" },
|
|
1094
|
-
"video": { "$ref": "#/components/schemas/ReceivedMedia" },
|
|
1095
|
-
"audio": { "$ref": "#/components/schemas/ReceivedAudio" },
|
|
1096
|
-
"document": { "$ref": "#/components/schemas/ReceivedDocument" },
|
|
1097
|
-
"sticker": { "$ref": "#/components/schemas/ReceivedSticker" },
|
|
1098
|
-
"location": { "$ref": "#/components/schemas/LocationData" },
|
|
1099
|
-
"contact": { "$ref": "#/components/schemas/ReceivedContact" },
|
|
1100
|
-
"contacts": {
|
|
1101
|
-
"type": "array",
|
|
1102
|
-
"items": { "$ref": "#/components/schemas/ReceivedContact" }
|
|
1103
|
-
},
|
|
1104
|
-
"group_info": {
|
|
1105
|
-
"type": "object",
|
|
1106
|
-
"description": "Present for group messages",
|
|
1107
|
-
"properties": {
|
|
1108
|
-
"group_jid": { "type": "string" },
|
|
1109
|
-
"sender_jid": { "type": "string" },
|
|
1110
|
-
"sender_name": { "type": "string" }
|
|
1111
|
-
}
|
|
1112
|
-
},
|
|
1113
|
-
"is_reply": { "type": "boolean" },
|
|
1114
|
-
"quoted_message_id": { "type": "string" }
|
|
1115
|
-
}
|
|
1116
|
-
},
|
|
1117
|
-
"event.history_sync_complete": {
|
|
1118
|
-
"description": "History sync completed after first login",
|
|
1119
|
-
"params": {
|
|
1120
|
-
"conversations": { "type": "integer", "description": "Number of conversations synced" },
|
|
1121
|
-
"messages": { "type": "integer", "description": "Total messages stored" }
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
},
|
|
1127
|
-
"examples": {
|
|
1128
|
-
"request": {
|
|
1129
|
-
"description": "JSON-RPC 2.0 request format",
|
|
1130
|
-
"value": {
|
|
1131
|
-
"jsonrpc": "2.0",
|
|
1132
|
-
"id": 1,
|
|
1133
|
-
"method": "status",
|
|
1134
|
-
"params": {}
|
|
1135
|
-
}
|
|
1136
|
-
},
|
|
1137
|
-
"response": {
|
|
1138
|
-
"description": "JSON-RPC 2.0 response format",
|
|
1139
|
-
"value": {
|
|
1140
|
-
"jsonrpc": "2.0",
|
|
1141
|
-
"id": 1,
|
|
1142
|
-
"result": {
|
|
1143
|
-
"connected": true,
|
|
1144
|
-
"has_session": true,
|
|
1145
|
-
"running": true,
|
|
1146
|
-
"pairing": false,
|
|
1147
|
-
"device_id": "1234567890@s.whatsapp.net",
|
|
1148
|
-
"timestamp": "2025-01-15T10:30:00Z"
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
},
|
|
1152
|
-
"event": {
|
|
1153
|
-
"description": "JSON-RPC 2.0 notification (no id)",
|
|
1154
|
-
"value": {
|
|
1155
|
-
"jsonrpc": "2.0",
|
|
1156
|
-
"method": "event.message_received",
|
|
1157
|
-
"params": {
|
|
1158
|
-
"message_id": "ABC123",
|
|
1159
|
-
"sender": "1234567890@s.whatsapp.net",
|
|
1160
|
-
"chat_id": "1234567890@s.whatsapp.net",
|
|
1161
|
-
"timestamp": "2025-01-15T10:30:00Z",
|
|
1162
|
-
"is_from_me": false,
|
|
1163
|
-
"is_group": false,
|
|
1164
|
-
"message_type": "text",
|
|
1165
|
-
"text": "Hello world!",
|
|
1166
|
-
"content": "Hello world!"
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
},
|
|
1170
|
-
"send_text": {
|
|
1171
|
-
"description": "Send text message",
|
|
1172
|
-
"value": {
|
|
1173
|
-
"jsonrpc": "2.0",
|
|
1174
|
-
"id": 2,
|
|
1175
|
-
"method": "send",
|
|
1176
|
-
"params": {
|
|
1177
|
-
"phone": "1234567890",
|
|
1178
|
-
"type": "text",
|
|
1179
|
-
"message": "Hello from API!"
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
},
|
|
1183
|
-
"send_image": {
|
|
1184
|
-
"description": "Send image message",
|
|
1185
|
-
"value": {
|
|
1186
|
-
"jsonrpc": "2.0",
|
|
1187
|
-
"id": 3,
|
|
1188
|
-
"method": "send",
|
|
1189
|
-
"params": {
|
|
1190
|
-
"phone": "1234567890",
|
|
1191
|
-
"type": "image",
|
|
1192
|
-
"media_data": {
|
|
1193
|
-
"data": "base64_encoded_image_data",
|
|
1194
|
-
"mime_type": "image/jpeg",
|
|
1195
|
-
"caption": "Check this out!"
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
},
|
|
1200
|
-
"send_to_group": {
|
|
1201
|
-
"description": "Send message to group",
|
|
1202
|
-
"value": {
|
|
1203
|
-
"jsonrpc": "2.0",
|
|
1204
|
-
"id": 4,
|
|
1205
|
-
"method": "send",
|
|
1206
|
-
"params": {
|
|
1207
|
-
"group_id": "123456789@g.us",
|
|
1208
|
-
"type": "text",
|
|
1209
|
-
"message": "Hello group!"
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
},
|
|
1213
|
-
"send_location": {
|
|
1214
|
-
"description": "Send location message",
|
|
1215
|
-
"value": {
|
|
1216
|
-
"jsonrpc": "2.0",
|
|
1217
|
-
"id": 5,
|
|
1218
|
-
"method": "send",
|
|
1219
|
-
"params": {
|
|
1220
|
-
"phone": "1234567890",
|
|
1221
|
-
"type": "location",
|
|
1222
|
-
"location": {
|
|
1223
|
-
"latitude": 37.7749,
|
|
1224
|
-
"longitude": -122.4194,
|
|
1225
|
-
"name": "San Francisco",
|
|
1226
|
-
"address": "California, USA"
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
},
|
|
1231
|
-
"download_media": {
|
|
1232
|
-
"description": "Download media from message",
|
|
1233
|
-
"value": {
|
|
1234
|
-
"jsonrpc": "2.0",
|
|
1235
|
-
"id": 6,
|
|
1236
|
-
"method": "media",
|
|
1237
|
-
"params": {
|
|
1238
|
-
"message_id": "ABC123DEF456"
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
},
|
|
1242
|
-
"error_response": {
|
|
1243
|
-
"description": "Error response format",
|
|
1244
|
-
"value": {
|
|
1245
|
-
"jsonrpc": "2.0",
|
|
1246
|
-
"id": 1,
|
|
1247
|
-
"error": {
|
|
1248
|
-
"code": -32000,
|
|
1249
|
-
"message": "WhatsApp not connected"
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
},
|
|
1253
|
-
"rate_limit_get": {
|
|
1254
|
-
"description": "Get rate limit config and stats",
|
|
1255
|
-
"value": {
|
|
1256
|
-
"jsonrpc": "2.0",
|
|
1257
|
-
"id": 7,
|
|
1258
|
-
"method": "rate_limit_get",
|
|
1259
|
-
"params": {}
|
|
1260
|
-
}
|
|
1261
|
-
},
|
|
1262
|
-
"rate_limit_set": {
|
|
1263
|
-
"description": "Update rate limit configuration",
|
|
1264
|
-
"value": {
|
|
1265
|
-
"jsonrpc": "2.0",
|
|
1266
|
-
"id": 8,
|
|
1267
|
-
"method": "rate_limit_set",
|
|
1268
|
-
"params": {
|
|
1269
|
-
"enabled": true,
|
|
1270
|
-
"min_delay_ms": 5000,
|
|
1271
|
-
"max_messages_per_hour": 30,
|
|
1272
|
-
"simulate_typing": true
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
},
|
|
1276
|
-
"rate_limit_unpause": {
|
|
1277
|
-
"description": "Resume after automatic pause",
|
|
1278
|
-
"value": {
|
|
1279
|
-
"jsonrpc": "2.0",
|
|
1280
|
-
"id": 9,
|
|
1281
|
-
"method": "rate_limit_unpause",
|
|
1282
|
-
"params": {}
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
},
|
|
1286
|
-
"errorCodes": {
|
|
1287
|
-
"-32700": "Parse error - Invalid JSON",
|
|
1288
|
-
"-32600": "Invalid Request - Not a valid JSON-RPC 2.0 request",
|
|
1289
|
-
"-32601": "Method not found",
|
|
1290
|
-
"-32602": "Invalid params",
|
|
1291
|
-
"-32000": "Server error (WhatsApp operation failed)",
|
|
1292
|
-
"-32001": "No QR available"
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"openrpc": "1.3.2",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "WhatsApp RPC API",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "JSON-RPC 2.0 API over WebSocket for WhatsApp messaging"
|
|
7
|
+
},
|
|
8
|
+
"servers": [
|
|
9
|
+
{
|
|
10
|
+
"name": "default",
|
|
11
|
+
"url": "ws://localhost:9400/ws/rpc"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"methods": [
|
|
15
|
+
{
|
|
16
|
+
"name": "status",
|
|
17
|
+
"summary": "Get WhatsApp connection status",
|
|
18
|
+
"params": [],
|
|
19
|
+
"result": {
|
|
20
|
+
"name": "StatusResult",
|
|
21
|
+
"schema": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"connected": { "type": "boolean", "description": "Whether WhatsApp is connected" },
|
|
25
|
+
"has_session": { "type": "boolean", "description": "Whether a session exists" },
|
|
26
|
+
"running": { "type": "boolean", "description": "Whether the service is running" },
|
|
27
|
+
"pairing": { "type": "boolean", "description": "Whether pairing is in progress" },
|
|
28
|
+
"device_id": { "type": "string", "description": "Device JID if connected" },
|
|
29
|
+
"timestamp": { "type": "string", "format": "date-time" }
|
|
30
|
+
},
|
|
31
|
+
"required": ["connected", "has_session", "running", "pairing", "timestamp"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "start",
|
|
37
|
+
"summary": "Start WhatsApp service",
|
|
38
|
+
"params": [],
|
|
39
|
+
"result": {
|
|
40
|
+
"name": "StartResult",
|
|
41
|
+
"schema": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"properties": {
|
|
44
|
+
"message": { "type": "string", "enum": ["Started"] }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "stop",
|
|
51
|
+
"summary": "Stop WhatsApp service",
|
|
52
|
+
"params": [],
|
|
53
|
+
"result": {
|
|
54
|
+
"name": "StopResult",
|
|
55
|
+
"schema": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"properties": {
|
|
58
|
+
"message": { "type": "string", "enum": ["Stopped"] }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "restart",
|
|
65
|
+
"summary": "Full reset: logout, delete DB, cleanup QR, reinit, start fresh",
|
|
66
|
+
"description": "Performs a complete reset: 1) Logout from WhatsApp servers, 2) Shutdown service, 3) Delete device session, 4) Delete database files, 5) Delete QR code files, 6) Reinitialize client, 7) Start pairing",
|
|
67
|
+
"params": [],
|
|
68
|
+
"result": {
|
|
69
|
+
"name": "RestartResult",
|
|
70
|
+
"schema": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"properties": {
|
|
73
|
+
"message": { "type": "string", "enum": ["Restarted (session cleared)"] }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "reset",
|
|
80
|
+
"summary": "Reset WhatsApp session (logout and delete credentials)",
|
|
81
|
+
"params": [],
|
|
82
|
+
"result": {
|
|
83
|
+
"name": "ResetResult",
|
|
84
|
+
"schema": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"properties": {
|
|
87
|
+
"message": { "type": "string", "enum": ["Reset"] }
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "diagnostics",
|
|
94
|
+
"summary": "Get detailed diagnostics information",
|
|
95
|
+
"params": [],
|
|
96
|
+
"result": {
|
|
97
|
+
"name": "DiagnosticsResult",
|
|
98
|
+
"schema": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"properties": {
|
|
101
|
+
"client_connected": { "type": "boolean" },
|
|
102
|
+
"client_logged_in": { "type": "boolean" },
|
|
103
|
+
"store_has_id": { "type": "boolean" },
|
|
104
|
+
"service_running": { "type": "boolean" },
|
|
105
|
+
"service_pairing": { "type": "boolean" },
|
|
106
|
+
"service_shutdown": { "type": "boolean" },
|
|
107
|
+
"events_channel_open": { "type": "boolean" },
|
|
108
|
+
"device_store": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"properties": {
|
|
111
|
+
"device_id": { "type": "string" },
|
|
112
|
+
"user": { "type": "string" },
|
|
113
|
+
"device": { "type": "integer" },
|
|
114
|
+
"server": { "type": "string" }
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"timestamp": { "type": "string", "format": "date-time" }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "qr",
|
|
124
|
+
"summary": "Get current QR code for pairing",
|
|
125
|
+
"params": [],
|
|
126
|
+
"result": {
|
|
127
|
+
"name": "QRResult",
|
|
128
|
+
"schema": {
|
|
129
|
+
"type": "object",
|
|
130
|
+
"properties": {
|
|
131
|
+
"has_qr": { "type": "boolean", "enum": [true] },
|
|
132
|
+
"code": { "type": "string", "description": "QR code content string" },
|
|
133
|
+
"filename": { "type": "string", "description": "PNG file path" },
|
|
134
|
+
"image_data": { "type": "string", "description": "Base64-encoded PNG data (for Docker/remote access)" }
|
|
135
|
+
},
|
|
136
|
+
"required": ["has_qr", "code", "filename"]
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"errors": [
|
|
140
|
+
{
|
|
141
|
+
"code": -32001,
|
|
142
|
+
"message": "No QR available"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "send",
|
|
148
|
+
"summary": "Send a WhatsApp message",
|
|
149
|
+
"params": [
|
|
150
|
+
{
|
|
151
|
+
"name": "phone",
|
|
152
|
+
"description": "Recipient phone number (without + prefix)",
|
|
153
|
+
"schema": { "type": "string" },
|
|
154
|
+
"required": false
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "group_id",
|
|
158
|
+
"description": "Group JID (e.g., 123456789@g.us)",
|
|
159
|
+
"schema": { "type": "string" },
|
|
160
|
+
"required": false
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "type",
|
|
164
|
+
"description": "Message type",
|
|
165
|
+
"schema": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"enum": ["text", "image", "video", "audio", "document", "sticker", "location", "contact"]
|
|
168
|
+
},
|
|
169
|
+
"required": true
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "message",
|
|
173
|
+
"description": "Text content (for text messages)",
|
|
174
|
+
"schema": { "type": "string" },
|
|
175
|
+
"required": false
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "media_data",
|
|
179
|
+
"description": "Media content (for media messages)",
|
|
180
|
+
"schema": { "$ref": "#/components/schemas/MediaData" },
|
|
181
|
+
"required": false
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "location",
|
|
185
|
+
"description": "Location data (for location messages)",
|
|
186
|
+
"schema": { "$ref": "#/components/schemas/LocationData" },
|
|
187
|
+
"required": false
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "contact",
|
|
191
|
+
"description": "Contact card (for contact messages)",
|
|
192
|
+
"schema": { "$ref": "#/components/schemas/ContactCard" },
|
|
193
|
+
"required": false
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "reply",
|
|
197
|
+
"description": "Reply context for quoting a message",
|
|
198
|
+
"schema": { "$ref": "#/components/schemas/ReplyData" },
|
|
199
|
+
"required": false
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "metadata",
|
|
203
|
+
"description": "Custom metadata key-value pairs",
|
|
204
|
+
"schema": { "type": "object", "additionalProperties": { "type": "string" } },
|
|
205
|
+
"required": false
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"result": {
|
|
209
|
+
"name": "SendResult",
|
|
210
|
+
"schema": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"properties": {
|
|
213
|
+
"message": { "type": "string", "enum": ["Sent"] }
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "media",
|
|
220
|
+
"summary": "Download media from a received message",
|
|
221
|
+
"params": [
|
|
222
|
+
{
|
|
223
|
+
"name": "message_id",
|
|
224
|
+
"description": "Message ID containing media",
|
|
225
|
+
"schema": { "type": "string" },
|
|
226
|
+
"required": true
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"result": {
|
|
230
|
+
"name": "MediaResult",
|
|
231
|
+
"schema": {
|
|
232
|
+
"type": "object",
|
|
233
|
+
"properties": {
|
|
234
|
+
"data": { "type": "string", "description": "Base64-encoded media data" },
|
|
235
|
+
"mime_type": { "type": "string", "description": "MIME type of the media" }
|
|
236
|
+
},
|
|
237
|
+
"required": ["data", "mime_type"]
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"name": "groups",
|
|
243
|
+
"summary": "List all groups the user is a member of",
|
|
244
|
+
"params": [],
|
|
245
|
+
"result": {
|
|
246
|
+
"name": "GroupsResult",
|
|
247
|
+
"schema": {
|
|
248
|
+
"type": "array",
|
|
249
|
+
"items": { "$ref": "#/components/schemas/GroupInfo" }
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "group_info",
|
|
255
|
+
"summary": "Get detailed information about a specific group",
|
|
256
|
+
"params": [
|
|
257
|
+
{
|
|
258
|
+
"name": "group_id",
|
|
259
|
+
"description": "Group JID (e.g., 123456789@g.us)",
|
|
260
|
+
"schema": { "type": "string" },
|
|
261
|
+
"required": true
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
"result": {
|
|
265
|
+
"name": "GroupInfoResult",
|
|
266
|
+
"schema": { "$ref": "#/components/schemas/GroupInfo" }
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"name": "group_update",
|
|
271
|
+
"summary": "Update group name and/or description",
|
|
272
|
+
"params": [
|
|
273
|
+
{
|
|
274
|
+
"name": "group_id",
|
|
275
|
+
"description": "Group JID",
|
|
276
|
+
"schema": { "type": "string" },
|
|
277
|
+
"required": true
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "name",
|
|
281
|
+
"description": "New group name",
|
|
282
|
+
"schema": { "type": "string" },
|
|
283
|
+
"required": false
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "topic",
|
|
287
|
+
"description": "New group description",
|
|
288
|
+
"schema": { "type": "string" },
|
|
289
|
+
"required": false
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"result": {
|
|
293
|
+
"name": "GroupUpdateResult",
|
|
294
|
+
"schema": {
|
|
295
|
+
"type": "object",
|
|
296
|
+
"properties": {
|
|
297
|
+
"message": { "type": "string", "enum": ["Updated"] }
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "contact_check",
|
|
304
|
+
"summary": "Check if phone numbers are registered on WhatsApp",
|
|
305
|
+
"params": [
|
|
306
|
+
{
|
|
307
|
+
"name": "phones",
|
|
308
|
+
"description": "Array of phone numbers to check (without + prefix)",
|
|
309
|
+
"schema": { "type": "array", "items": { "type": "string" } },
|
|
310
|
+
"required": true
|
|
311
|
+
}
|
|
312
|
+
],
|
|
313
|
+
"result": {
|
|
314
|
+
"name": "ContactCheckResult",
|
|
315
|
+
"schema": {
|
|
316
|
+
"type": "array",
|
|
317
|
+
"items": {
|
|
318
|
+
"type": "object",
|
|
319
|
+
"properties": {
|
|
320
|
+
"query": { "type": "string", "description": "Original phone number queried" },
|
|
321
|
+
"jid": { "type": "string", "description": "WhatsApp JID if registered" },
|
|
322
|
+
"is_registered": { "type": "boolean" },
|
|
323
|
+
"is_business": { "type": "boolean" },
|
|
324
|
+
"business_name": { "type": "string" }
|
|
325
|
+
},
|
|
326
|
+
"required": ["query", "is_registered"]
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"name": "contact_profile_pic",
|
|
333
|
+
"summary": "Get profile picture for a user or group",
|
|
334
|
+
"params": [
|
|
335
|
+
{
|
|
336
|
+
"name": "jid",
|
|
337
|
+
"description": "User or group JID",
|
|
338
|
+
"schema": { "type": "string" },
|
|
339
|
+
"required": true
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"name": "preview",
|
|
343
|
+
"description": "Get smaller preview image",
|
|
344
|
+
"schema": { "type": "boolean" },
|
|
345
|
+
"required": false
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"result": {
|
|
349
|
+
"name": "ProfilePicResult",
|
|
350
|
+
"schema": {
|
|
351
|
+
"type": "object",
|
|
352
|
+
"properties": {
|
|
353
|
+
"exists": { "type": "boolean", "description": "Whether profile picture exists" },
|
|
354
|
+
"url": { "type": "string", "description": "URL to download image" },
|
|
355
|
+
"id": { "type": "string", "description": "Image identifier" },
|
|
356
|
+
"data": { "type": "string", "description": "Base64-encoded image data" }
|
|
357
|
+
},
|
|
358
|
+
"required": ["exists"]
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "contacts",
|
|
364
|
+
"summary": "List all contacts with saved names",
|
|
365
|
+
"description": "Returns contacts from the whatsmeow_contacts store with user-saved names",
|
|
366
|
+
"params": [
|
|
367
|
+
{
|
|
368
|
+
"name": "query",
|
|
369
|
+
"description": "Optional search query to filter by name or phone number",
|
|
370
|
+
"schema": { "type": "string" },
|
|
371
|
+
"required": false
|
|
372
|
+
}
|
|
373
|
+
],
|
|
374
|
+
"result": {
|
|
375
|
+
"name": "ContactsResult",
|
|
376
|
+
"schema": {
|
|
377
|
+
"type": "object",
|
|
378
|
+
"properties": {
|
|
379
|
+
"contacts": {
|
|
380
|
+
"type": "array",
|
|
381
|
+
"items": {
|
|
382
|
+
"type": "object",
|
|
383
|
+
"properties": {
|
|
384
|
+
"jid": { "type": "string", "description": "Full JID (e.g., 919876543210@s.whatsapp.net)" },
|
|
385
|
+
"phone": { "type": "string", "description": "Phone number without @s.whatsapp.net" },
|
|
386
|
+
"name": { "type": "string", "description": "User's saved contact name (e.g., 'Mummy', 'Dad')" },
|
|
387
|
+
"push_name": { "type": "string", "description": "WhatsApp profile name set by user" },
|
|
388
|
+
"is_contact": { "type": "boolean", "description": "Whether this is a saved contact" }
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
"total": { "type": "integer", "description": "Total number of contacts returned" }
|
|
393
|
+
},
|
|
394
|
+
"required": ["contacts", "total"]
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"name": "contact_info",
|
|
400
|
+
"summary": "Get full information for a single contact",
|
|
401
|
+
"description": "Returns comprehensive contact info including name, business status, and profile picture URL",
|
|
402
|
+
"params": [
|
|
403
|
+
{
|
|
404
|
+
"name": "phone",
|
|
405
|
+
"description": "Phone number (with or without + prefix)",
|
|
406
|
+
"schema": { "type": "string" },
|
|
407
|
+
"required": true
|
|
408
|
+
}
|
|
409
|
+
],
|
|
410
|
+
"result": {
|
|
411
|
+
"name": "ContactInfoResult",
|
|
412
|
+
"schema": {
|
|
413
|
+
"type": "object",
|
|
414
|
+
"properties": {
|
|
415
|
+
"jid": { "type": "string", "description": "Full JID for sending messages" },
|
|
416
|
+
"phone": { "type": "string", "description": "Phone number" },
|
|
417
|
+
"name": { "type": "string", "description": "User's saved contact name" },
|
|
418
|
+
"push_name": { "type": "string", "description": "WhatsApp profile name" },
|
|
419
|
+
"business_name": { "type": "string", "description": "Business account verified name" },
|
|
420
|
+
"is_business": { "type": "boolean", "description": "Whether this is a business account" },
|
|
421
|
+
"is_contact": { "type": "boolean", "description": "Whether saved in contacts" },
|
|
422
|
+
"profile_pic": { "type": "string", "description": "Profile picture URL" }
|
|
423
|
+
},
|
|
424
|
+
"required": ["jid", "phone"]
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"name": "typing",
|
|
430
|
+
"summary": "Send typing indicator to a chat",
|
|
431
|
+
"params": [
|
|
432
|
+
{
|
|
433
|
+
"name": "jid",
|
|
434
|
+
"description": "Chat JID (individual or group)",
|
|
435
|
+
"schema": { "type": "string" },
|
|
436
|
+
"required": true
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"name": "state",
|
|
440
|
+
"description": "Typing state: 'composing' or 'paused'",
|
|
441
|
+
"schema": { "type": "string", "enum": ["composing", "paused"] },
|
|
442
|
+
"required": true
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"name": "media",
|
|
446
|
+
"description": "Media type: '' for text, 'audio' for voice recording",
|
|
447
|
+
"schema": { "type": "string", "enum": ["", "text", "audio"] },
|
|
448
|
+
"required": false
|
|
449
|
+
}
|
|
450
|
+
],
|
|
451
|
+
"result": {
|
|
452
|
+
"name": "TypingResult",
|
|
453
|
+
"schema": {
|
|
454
|
+
"type": "object",
|
|
455
|
+
"properties": {
|
|
456
|
+
"message": { "type": "string", "enum": ["Typing indicator sent"] }
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"name": "presence",
|
|
463
|
+
"summary": "Set online/offline presence status",
|
|
464
|
+
"params": [
|
|
465
|
+
{
|
|
466
|
+
"name": "status",
|
|
467
|
+
"description": "Presence status: 'available' or 'unavailable'",
|
|
468
|
+
"schema": { "type": "string", "enum": ["available", "unavailable"] },
|
|
469
|
+
"required": true
|
|
470
|
+
}
|
|
471
|
+
],
|
|
472
|
+
"result": {
|
|
473
|
+
"name": "PresenceResult",
|
|
474
|
+
"schema": {
|
|
475
|
+
"type": "object",
|
|
476
|
+
"properties": {
|
|
477
|
+
"message": { "type": "string", "enum": ["Presence set"] }
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"name": "mark_read",
|
|
484
|
+
"summary": "Mark messages as read",
|
|
485
|
+
"params": [
|
|
486
|
+
{
|
|
487
|
+
"name": "message_ids",
|
|
488
|
+
"description": "Array of message IDs to mark as read",
|
|
489
|
+
"schema": { "type": "array", "items": { "type": "string" } },
|
|
490
|
+
"required": true
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"name": "chat_jid",
|
|
494
|
+
"description": "Chat JID where messages are from",
|
|
495
|
+
"schema": { "type": "string" },
|
|
496
|
+
"required": true
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"name": "sender_jid",
|
|
500
|
+
"description": "Sender JID (required for group messages)",
|
|
501
|
+
"schema": { "type": "string" },
|
|
502
|
+
"required": false
|
|
503
|
+
}
|
|
504
|
+
],
|
|
505
|
+
"result": {
|
|
506
|
+
"name": "MarkReadResult",
|
|
507
|
+
"schema": {
|
|
508
|
+
"type": "object",
|
|
509
|
+
"properties": {
|
|
510
|
+
"message": { "type": "string", "enum": ["Messages marked as read"] }
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
"name": "group_participants_add",
|
|
517
|
+
"summary": "Add participants to a group",
|
|
518
|
+
"params": [
|
|
519
|
+
{
|
|
520
|
+
"name": "group_id",
|
|
521
|
+
"description": "Group JID (e.g., 123456789@g.us)",
|
|
522
|
+
"schema": { "type": "string" },
|
|
523
|
+
"required": true
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"name": "participants",
|
|
527
|
+
"description": "Array of phone numbers or JIDs to add",
|
|
528
|
+
"schema": { "type": "array", "items": { "type": "string" } },
|
|
529
|
+
"required": true
|
|
530
|
+
}
|
|
531
|
+
],
|
|
532
|
+
"result": {
|
|
533
|
+
"name": "GroupParticipantsAddResult",
|
|
534
|
+
"schema": { "$ref": "#/components/schemas/GroupParticipantsResult" }
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"name": "group_participants_remove",
|
|
539
|
+
"summary": "Remove participants from a group",
|
|
540
|
+
"params": [
|
|
541
|
+
{
|
|
542
|
+
"name": "group_id",
|
|
543
|
+
"description": "Group JID (e.g., 123456789@g.us)",
|
|
544
|
+
"schema": { "type": "string" },
|
|
545
|
+
"required": true
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"name": "participants",
|
|
549
|
+
"description": "Array of phone numbers or JIDs to remove",
|
|
550
|
+
"schema": { "type": "array", "items": { "type": "string" } },
|
|
551
|
+
"required": true
|
|
552
|
+
}
|
|
553
|
+
],
|
|
554
|
+
"result": {
|
|
555
|
+
"name": "GroupParticipantsRemoveResult",
|
|
556
|
+
"schema": { "$ref": "#/components/schemas/GroupParticipantsResult" }
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"name": "group_invite_link",
|
|
561
|
+
"summary": "Get group invite link",
|
|
562
|
+
"params": [
|
|
563
|
+
{
|
|
564
|
+
"name": "group_id",
|
|
565
|
+
"description": "Group JID",
|
|
566
|
+
"schema": { "type": "string" },
|
|
567
|
+
"required": true
|
|
568
|
+
}
|
|
569
|
+
],
|
|
570
|
+
"result": {
|
|
571
|
+
"name": "GroupInviteLinkResult",
|
|
572
|
+
"schema": { "$ref": "#/components/schemas/GroupInviteLinkResult" }
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"name": "group_revoke_invite",
|
|
577
|
+
"summary": "Revoke and regenerate group invite link",
|
|
578
|
+
"params": [
|
|
579
|
+
{
|
|
580
|
+
"name": "group_id",
|
|
581
|
+
"description": "Group JID",
|
|
582
|
+
"schema": { "type": "string" },
|
|
583
|
+
"required": true
|
|
584
|
+
}
|
|
585
|
+
],
|
|
586
|
+
"result": {
|
|
587
|
+
"name": "GroupRevokeInviteResult",
|
|
588
|
+
"schema": { "$ref": "#/components/schemas/GroupInviteLinkResult" }
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"name": "rate_limit_get",
|
|
593
|
+
"summary": "Get rate limit configuration and statistics",
|
|
594
|
+
"params": [],
|
|
595
|
+
"result": {
|
|
596
|
+
"name": "RateLimitGetResult",
|
|
597
|
+
"schema": {
|
|
598
|
+
"type": "object",
|
|
599
|
+
"properties": {
|
|
600
|
+
"config": { "$ref": "#/components/schemas/RateLimitConfig" },
|
|
601
|
+
"stats": { "$ref": "#/components/schemas/RateLimitStats" }
|
|
602
|
+
},
|
|
603
|
+
"required": ["config", "stats"]
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"name": "rate_limit_set",
|
|
609
|
+
"summary": "Update rate limit configuration",
|
|
610
|
+
"params": [
|
|
611
|
+
{
|
|
612
|
+
"name": "enabled",
|
|
613
|
+
"description": "Enable/disable rate limiting",
|
|
614
|
+
"schema": { "type": "boolean" },
|
|
615
|
+
"required": false
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "min_delay_ms",
|
|
619
|
+
"description": "Minimum delay between messages (milliseconds)",
|
|
620
|
+
"schema": { "type": "integer" },
|
|
621
|
+
"required": false
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"name": "max_delay_ms",
|
|
625
|
+
"description": "Maximum delay for randomization (milliseconds)",
|
|
626
|
+
"schema": { "type": "integer" },
|
|
627
|
+
"required": false
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"name": "typing_delay_ms",
|
|
631
|
+
"description": "Typing indicator duration (milliseconds)",
|
|
632
|
+
"schema": { "type": "integer" },
|
|
633
|
+
"required": false
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"name": "link_extra_delay_ms",
|
|
637
|
+
"description": "Extra delay for messages with links (milliseconds)",
|
|
638
|
+
"schema": { "type": "integer" },
|
|
639
|
+
"required": false
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"name": "max_messages_per_minute",
|
|
643
|
+
"description": "Maximum messages per minute",
|
|
644
|
+
"schema": { "type": "integer" },
|
|
645
|
+
"required": false
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"name": "max_messages_per_hour",
|
|
649
|
+
"description": "Maximum messages per hour",
|
|
650
|
+
"schema": { "type": "integer" },
|
|
651
|
+
"required": false
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"name": "max_new_contacts_per_day",
|
|
655
|
+
"description": "Maximum new contacts per day",
|
|
656
|
+
"schema": { "type": "integer" },
|
|
657
|
+
"required": false
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"name": "simulate_typing",
|
|
661
|
+
"description": "Send typing indicator before messages",
|
|
662
|
+
"schema": { "type": "boolean" },
|
|
663
|
+
"required": false
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"name": "randomize_delays",
|
|
667
|
+
"description": "Add random variance to delays",
|
|
668
|
+
"schema": { "type": "boolean" },
|
|
669
|
+
"required": false
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"name": "pause_on_low_response",
|
|
673
|
+
"description": "Auto-pause if response rate drops",
|
|
674
|
+
"schema": { "type": "boolean" },
|
|
675
|
+
"required": false
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"name": "response_rate_threshold",
|
|
679
|
+
"description": "Minimum response rate threshold (0.0-1.0)",
|
|
680
|
+
"schema": { "type": "number" },
|
|
681
|
+
"required": false
|
|
682
|
+
}
|
|
683
|
+
],
|
|
684
|
+
"result": {
|
|
685
|
+
"name": "RateLimitSetResult",
|
|
686
|
+
"schema": {
|
|
687
|
+
"type": "object",
|
|
688
|
+
"properties": {
|
|
689
|
+
"message": { "type": "string" },
|
|
690
|
+
"config": { "$ref": "#/components/schemas/RateLimitConfig" }
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"name": "rate_limit_stats",
|
|
697
|
+
"summary": "Get current rate limiting statistics only",
|
|
698
|
+
"params": [],
|
|
699
|
+
"result": {
|
|
700
|
+
"name": "RateLimitStatsResult",
|
|
701
|
+
"schema": { "$ref": "#/components/schemas/RateLimitStats" }
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
"name": "rate_limit_unpause",
|
|
706
|
+
"summary": "Resume rate limiting after automatic pause",
|
|
707
|
+
"params": [],
|
|
708
|
+
"result": {
|
|
709
|
+
"name": "RateLimitUnpauseResult",
|
|
710
|
+
"schema": {
|
|
711
|
+
"type": "object",
|
|
712
|
+
"properties": {
|
|
713
|
+
"message": { "type": "string" },
|
|
714
|
+
"stats": { "$ref": "#/components/schemas/RateLimitStats" }
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"name": "chat_history",
|
|
721
|
+
"summary": "Get chat history from stored messages",
|
|
722
|
+
"description": "Retrieve messages from SQLite history store. Messages are synced on first WhatsApp login and stored for later retrieval. Supports filtering by chat type (individual/group), sender, and message type.",
|
|
723
|
+
"params": [
|
|
724
|
+
{
|
|
725
|
+
"name": "chat_id",
|
|
726
|
+
"description": "Chat JID (e.g., 1234567890@s.whatsapp.net for individual, 123456789@g.us for group)",
|
|
727
|
+
"schema": { "type": "string" },
|
|
728
|
+
"required": false
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
"name": "phone",
|
|
732
|
+
"description": "Phone number for individual chats (without +). Converted to JID automatically.",
|
|
733
|
+
"schema": { "type": "string" },
|
|
734
|
+
"required": false
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"name": "group_id",
|
|
738
|
+
"description": "Group JID (e.g., 123456789@g.us)",
|
|
739
|
+
"schema": { "type": "string" },
|
|
740
|
+
"required": false
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"name": "limit",
|
|
744
|
+
"description": "Maximum messages to return (default: 50, max: 500)",
|
|
745
|
+
"schema": { "type": "integer", "default": 50, "minimum": 1, "maximum": 500 },
|
|
746
|
+
"required": false
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
"name": "offset",
|
|
750
|
+
"description": "Number of messages to skip for pagination (default: 0)",
|
|
751
|
+
"schema": { "type": "integer", "default": 0 },
|
|
752
|
+
"required": false
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
"name": "sender_phone",
|
|
756
|
+
"description": "Filter group messages by sender phone number",
|
|
757
|
+
"schema": { "type": "string" },
|
|
758
|
+
"required": false
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"name": "text_only",
|
|
762
|
+
"description": "Only return text messages (default: false)",
|
|
763
|
+
"schema": { "type": "boolean", "default": false },
|
|
764
|
+
"required": false
|
|
765
|
+
}
|
|
766
|
+
],
|
|
767
|
+
"result": {
|
|
768
|
+
"name": "ChatHistoryResult",
|
|
769
|
+
"schema": { "$ref": "#/components/schemas/ChatHistoryResult" }
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
],
|
|
773
|
+
"components": {
|
|
774
|
+
"schemas": {
|
|
775
|
+
"ChatHistoryResult": {
|
|
776
|
+
"type": "object",
|
|
777
|
+
"description": "Chat history query result",
|
|
778
|
+
"properties": {
|
|
779
|
+
"messages": {
|
|
780
|
+
"type": "array",
|
|
781
|
+
"description": "Array of message records",
|
|
782
|
+
"items": { "$ref": "#/components/schemas/MessageRecord" }
|
|
783
|
+
},
|
|
784
|
+
"total": { "type": "integer", "description": "Total matching messages in database" },
|
|
785
|
+
"has_more": { "type": "boolean", "description": "Whether more messages exist beyond limit+offset" }
|
|
786
|
+
},
|
|
787
|
+
"required": ["messages", "total", "has_more"]
|
|
788
|
+
},
|
|
789
|
+
"MessageRecord": {
|
|
790
|
+
"type": "object",
|
|
791
|
+
"description": "Stored message record from history",
|
|
792
|
+
"properties": {
|
|
793
|
+
"message_id": { "type": "string", "description": "Unique message ID" },
|
|
794
|
+
"chat_id": { "type": "string", "description": "Chat JID (individual or group)" },
|
|
795
|
+
"sender": { "type": "string", "description": "Sender JID" },
|
|
796
|
+
"sender_phone": { "type": "string", "description": "Sender phone number" },
|
|
797
|
+
"message_type": {
|
|
798
|
+
"type": "string",
|
|
799
|
+
"enum": ["text", "image", "video", "audio", "document", "sticker", "location", "contact"],
|
|
800
|
+
"description": "Type of message"
|
|
801
|
+
},
|
|
802
|
+
"text": { "type": "string", "description": "Text content (or caption for media)" },
|
|
803
|
+
"timestamp": { "type": "string", "format": "date-time", "description": "Message timestamp" },
|
|
804
|
+
"is_group": { "type": "boolean", "description": "Whether message is from a group chat" },
|
|
805
|
+
"is_from_me": { "type": "boolean", "description": "Whether message was sent by the connected device" }
|
|
806
|
+
},
|
|
807
|
+
"required": ["message_id", "chat_id", "sender", "message_type", "timestamp", "is_group", "is_from_me"]
|
|
808
|
+
},
|
|
809
|
+
"MediaData": {
|
|
810
|
+
"type": "object",
|
|
811
|
+
"description": "Media content for sending",
|
|
812
|
+
"properties": {
|
|
813
|
+
"data": { "type": "string", "description": "Base64-encoded media data" },
|
|
814
|
+
"mime_type": { "type": "string", "description": "MIME type (e.g., image/jpeg, video/mp4)" },
|
|
815
|
+
"filename": { "type": "string", "description": "Optional filename for documents" },
|
|
816
|
+
"caption": { "type": "string", "description": "Optional caption for images/videos" },
|
|
817
|
+
"thumbnail": { "type": "string", "description": "Optional base64 thumbnail" }
|
|
818
|
+
},
|
|
819
|
+
"required": ["data", "mime_type"]
|
|
820
|
+
},
|
|
821
|
+
"LocationData": {
|
|
822
|
+
"type": "object",
|
|
823
|
+
"description": "Location information",
|
|
824
|
+
"properties": {
|
|
825
|
+
"latitude": { "type": "number" },
|
|
826
|
+
"longitude": { "type": "number" },
|
|
827
|
+
"name": { "type": "string", "description": "Location name" },
|
|
828
|
+
"address": { "type": "string", "description": "Address" }
|
|
829
|
+
},
|
|
830
|
+
"required": ["latitude", "longitude"]
|
|
831
|
+
},
|
|
832
|
+
"ContactCard": {
|
|
833
|
+
"type": "object",
|
|
834
|
+
"description": "Contact vCard",
|
|
835
|
+
"properties": {
|
|
836
|
+
"display_name": { "type": "string" },
|
|
837
|
+
"vcard": { "type": "string", "description": "vCard 3.0 format string" }
|
|
838
|
+
},
|
|
839
|
+
"required": ["display_name", "vcard"]
|
|
840
|
+
},
|
|
841
|
+
"ReplyData": {
|
|
842
|
+
"type": "object",
|
|
843
|
+
"description": "Reply context for quoting messages",
|
|
844
|
+
"properties": {
|
|
845
|
+
"message_id": { "type": "string", "description": "ID of message to reply to" },
|
|
846
|
+
"sender": { "type": "string", "description": "Sender JID of quoted message" },
|
|
847
|
+
"content": { "type": "string", "description": "Text preview of quoted message" }
|
|
848
|
+
},
|
|
849
|
+
"required": ["message_id", "sender", "content"]
|
|
850
|
+
},
|
|
851
|
+
"GroupInfo": {
|
|
852
|
+
"type": "object",
|
|
853
|
+
"description": "Group information",
|
|
854
|
+
"properties": {
|
|
855
|
+
"jid": { "type": "string", "description": "Group JID (e.g., 123456789@g.us)" },
|
|
856
|
+
"name": { "type": "string" },
|
|
857
|
+
"topic": { "type": "string", "description": "Group description" },
|
|
858
|
+
"owner": { "type": "string", "description": "Owner JID" },
|
|
859
|
+
"participants": {
|
|
860
|
+
"type": "array",
|
|
861
|
+
"items": { "$ref": "#/components/schemas/GroupParticipant" }
|
|
862
|
+
},
|
|
863
|
+
"created_at": { "type": "string", "format": "date-time" },
|
|
864
|
+
"size": { "type": "integer", "description": "Number of participants" },
|
|
865
|
+
"is_announce": { "type": "boolean", "description": "Only admins can send messages" },
|
|
866
|
+
"is_locked": { "type": "boolean", "description": "Only admins can edit group info" }
|
|
867
|
+
},
|
|
868
|
+
"required": ["jid", "name", "owner", "participants", "size"]
|
|
869
|
+
},
|
|
870
|
+
"GroupParticipant": {
|
|
871
|
+
"type": "object",
|
|
872
|
+
"description": "Group member with resolved phone number",
|
|
873
|
+
"properties": {
|
|
874
|
+
"jid": { "type": "string", "description": "Participant JID (may be LID format)" },
|
|
875
|
+
"phone": { "type": "string", "description": "Real phone number (resolved from LID if needed)" },
|
|
876
|
+
"name": { "type": "string" },
|
|
877
|
+
"is_admin": { "type": "boolean" },
|
|
878
|
+
"is_super_admin": { "type": "boolean", "description": "True for group owner" }
|
|
879
|
+
},
|
|
880
|
+
"required": ["jid", "phone", "is_admin", "is_super_admin"]
|
|
881
|
+
},
|
|
882
|
+
"GroupParticipantsResult": {
|
|
883
|
+
"type": "object",
|
|
884
|
+
"description": "Result of participant changes",
|
|
885
|
+
"properties": {
|
|
886
|
+
"group_id": { "type": "string", "description": "Group JID" },
|
|
887
|
+
"action": { "type": "string", "enum": ["add", "remove"], "description": "Action performed" },
|
|
888
|
+
"results": {
|
|
889
|
+
"type": "array",
|
|
890
|
+
"items": { "$ref": "#/components/schemas/GroupParticipantChangeResult" }
|
|
891
|
+
},
|
|
892
|
+
"added": { "type": "integer", "description": "Number of participants successfully added" },
|
|
893
|
+
"removed": { "type": "integer", "description": "Number of participants successfully removed" },
|
|
894
|
+
"failed": { "type": "integer", "description": "Number of failed operations" }
|
|
895
|
+
},
|
|
896
|
+
"required": ["group_id", "action", "results", "failed"]
|
|
897
|
+
},
|
|
898
|
+
"GroupParticipantChangeResult": {
|
|
899
|
+
"type": "object",
|
|
900
|
+
"description": "Result for a single participant change",
|
|
901
|
+
"properties": {
|
|
902
|
+
"jid": { "type": "string", "description": "Participant JID" },
|
|
903
|
+
"phone": { "type": "string", "description": "Phone number" },
|
|
904
|
+
"success": { "type": "boolean", "description": "Whether operation succeeded" },
|
|
905
|
+
"error": { "type": "string", "description": "Error message if failed" }
|
|
906
|
+
},
|
|
907
|
+
"required": ["jid", "success"]
|
|
908
|
+
},
|
|
909
|
+
"GroupInviteLinkResult": {
|
|
910
|
+
"type": "object",
|
|
911
|
+
"description": "Group invite link information",
|
|
912
|
+
"properties": {
|
|
913
|
+
"group_id": { "type": "string", "description": "Group JID" },
|
|
914
|
+
"invite_link": { "type": "string", "description": "Full invite link (https://chat.whatsapp.com/...)" },
|
|
915
|
+
"revoked": { "type": "boolean", "description": "Whether old link was revoked" }
|
|
916
|
+
},
|
|
917
|
+
"required": ["group_id", "invite_link"]
|
|
918
|
+
},
|
|
919
|
+
"RateLimitConfig": {
|
|
920
|
+
"type": "object",
|
|
921
|
+
"description": "Rate limiting configuration for anti-ban protection",
|
|
922
|
+
"properties": {
|
|
923
|
+
"enabled": { "type": "boolean", "default": true, "description": "Enable rate limiting" },
|
|
924
|
+
"min_delay_ms": { "type": "integer", "default": 3000, "description": "Minimum delay between messages (ms)" },
|
|
925
|
+
"max_delay_ms": { "type": "integer", "default": 8000, "description": "Maximum delay for randomization (ms)" },
|
|
926
|
+
"typing_delay_ms": { "type": "integer", "default": 2000, "description": "Typing indicator duration (ms)" },
|
|
927
|
+
"link_extra_delay_ms": { "type": "integer", "default": 5000, "description": "Extra delay for messages with links (ms)" },
|
|
928
|
+
"max_messages_per_minute": { "type": "integer", "default": 10, "description": "Per-minute message limit" },
|
|
929
|
+
"max_messages_per_hour": { "type": "integer", "default": 60, "description": "Per-hour message limit" },
|
|
930
|
+
"max_new_contacts_per_day": { "type": "integer", "default": 20, "description": "Daily new contacts limit" },
|
|
931
|
+
"simulate_typing": { "type": "boolean", "default": true, "description": "Send typing indicator before messages" },
|
|
932
|
+
"randomize_delays": { "type": "boolean", "default": true, "description": "Add random variance to delays" },
|
|
933
|
+
"pause_on_low_response": { "type": "boolean", "default": false, "description": "Auto-pause if response rate drops" },
|
|
934
|
+
"response_rate_threshold": { "type": "number", "default": 0.3, "description": "Minimum response rate (0.0-1.0)" }
|
|
935
|
+
}
|
|
936
|
+
},
|
|
937
|
+
"RateLimitStats": {
|
|
938
|
+
"type": "object",
|
|
939
|
+
"description": "Current rate limiting statistics",
|
|
940
|
+
"properties": {
|
|
941
|
+
"messages_sent_last_minute": { "type": "integer", "description": "Messages sent in last 60 seconds" },
|
|
942
|
+
"messages_sent_last_hour": { "type": "integer", "description": "Messages sent in last 60 minutes" },
|
|
943
|
+
"messages_sent_today": { "type": "integer", "description": "Total messages sent today" },
|
|
944
|
+
"new_contacts_today": { "type": "integer", "description": "New contacts messaged today" },
|
|
945
|
+
"responses_received": { "type": "integer", "description": "Responses received today" },
|
|
946
|
+
"response_rate": { "type": "number", "description": "Response rate (responses/sent)" },
|
|
947
|
+
"is_paused": { "type": "boolean", "description": "Whether rate limiting is paused" },
|
|
948
|
+
"pause_reason": { "type": "string", "description": "Reason for pause if paused" },
|
|
949
|
+
"last_message_time": { "type": "string", "format": "date-time", "description": "Time of last sent message" },
|
|
950
|
+
"next_allowed_time": { "type": "string", "format": "date-time", "description": "Earliest time next message allowed" }
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
"ReceivedMedia": {
|
|
954
|
+
"type": "object",
|
|
955
|
+
"description": "Received media (image/video) information",
|
|
956
|
+
"properties": {
|
|
957
|
+
"mime_type": { "type": "string" },
|
|
958
|
+
"file_sha256": { "type": "string" },
|
|
959
|
+
"file_length": { "type": "integer" },
|
|
960
|
+
"caption": { "type": "string" },
|
|
961
|
+
"url": { "type": "string" },
|
|
962
|
+
"seconds": { "type": "integer", "description": "Duration for video" }
|
|
963
|
+
}
|
|
964
|
+
},
|
|
965
|
+
"ReceivedAudio": {
|
|
966
|
+
"type": "object",
|
|
967
|
+
"description": "Received audio/voice message information",
|
|
968
|
+
"properties": {
|
|
969
|
+
"mime_type": { "type": "string" },
|
|
970
|
+
"file_sha256": { "type": "string" },
|
|
971
|
+
"file_length": { "type": "integer" },
|
|
972
|
+
"seconds": { "type": "integer" },
|
|
973
|
+
"ptt": { "type": "boolean", "description": "True for voice messages (push-to-talk)" },
|
|
974
|
+
"url": { "type": "string" }
|
|
975
|
+
}
|
|
976
|
+
},
|
|
977
|
+
"ReceivedDocument": {
|
|
978
|
+
"type": "object",
|
|
979
|
+
"description": "Received document information",
|
|
980
|
+
"properties": {
|
|
981
|
+
"mime_type": { "type": "string" },
|
|
982
|
+
"file_sha256": { "type": "string" },
|
|
983
|
+
"file_length": { "type": "integer" },
|
|
984
|
+
"file_name": { "type": "string" },
|
|
985
|
+
"title": { "type": "string" },
|
|
986
|
+
"caption": { "type": "string" },
|
|
987
|
+
"url": { "type": "string" }
|
|
988
|
+
}
|
|
989
|
+
},
|
|
990
|
+
"ReceivedContact": {
|
|
991
|
+
"type": "object",
|
|
992
|
+
"description": "Received contact vCard",
|
|
993
|
+
"properties": {
|
|
994
|
+
"display_name": { "type": "string" },
|
|
995
|
+
"vcard": { "type": "string" }
|
|
996
|
+
}
|
|
997
|
+
},
|
|
998
|
+
"ReceivedSticker": {
|
|
999
|
+
"type": "object",
|
|
1000
|
+
"description": "Received sticker information",
|
|
1001
|
+
"properties": {
|
|
1002
|
+
"mime_type": { "type": "string" },
|
|
1003
|
+
"file_sha256": { "type": "string" },
|
|
1004
|
+
"file_length": { "type": "integer" },
|
|
1005
|
+
"is_animated": { "type": "boolean", "description": "True for animated stickers" },
|
|
1006
|
+
"url": { "type": "string" }
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
},
|
|
1010
|
+
"events": {
|
|
1011
|
+
"description": "Server-sent notifications (JSON-RPC without id)",
|
|
1012
|
+
"types": {
|
|
1013
|
+
"event.status": {
|
|
1014
|
+
"description": "Initial status sent on WebSocket connection",
|
|
1015
|
+
"params": {
|
|
1016
|
+
"connected": { "type": "boolean" },
|
|
1017
|
+
"has_session": { "type": "boolean" },
|
|
1018
|
+
"running": { "type": "boolean" },
|
|
1019
|
+
"pairing": { "type": "boolean" },
|
|
1020
|
+
"device_id": { "type": "string" },
|
|
1021
|
+
"timestamp": { "type": "string", "format": "date-time" }
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
"event.connected": {
|
|
1025
|
+
"description": "WhatsApp connected successfully",
|
|
1026
|
+
"params": {
|
|
1027
|
+
"status": { "type": "string", "enum": ["connected"] },
|
|
1028
|
+
"device_id": { "type": "string" }
|
|
1029
|
+
}
|
|
1030
|
+
},
|
|
1031
|
+
"event.disconnected": {
|
|
1032
|
+
"description": "WhatsApp disconnected",
|
|
1033
|
+
"params": {
|
|
1034
|
+
"status": { "type": "string", "enum": ["disconnected"] },
|
|
1035
|
+
"reason": { "type": "string" }
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
"event.connection_failure": {
|
|
1039
|
+
"description": "Connection failed",
|
|
1040
|
+
"params": {
|
|
1041
|
+
"error": { "type": "string" },
|
|
1042
|
+
"reason": { "type": "string" }
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
"event.logged_out": {
|
|
1046
|
+
"description": "User logged out",
|
|
1047
|
+
"params": {
|
|
1048
|
+
"on_connect": { "type": "boolean" },
|
|
1049
|
+
"reason": { "type": "string" }
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
"event.temporary_ban": {
|
|
1053
|
+
"description": "Temporary ban received",
|
|
1054
|
+
"params": {
|
|
1055
|
+
"code": { "type": "string" },
|
|
1056
|
+
"reason": { "type": "string" }
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
"event.qr_code": {
|
|
1060
|
+
"description": "New QR code available for pairing",
|
|
1061
|
+
"params": {
|
|
1062
|
+
"code": { "type": "string", "description": "QR code content" },
|
|
1063
|
+
"filename": { "type": "string", "description": "PNG file path" },
|
|
1064
|
+
"image_data": { "type": "string", "description": "Base64-encoded PNG data" }
|
|
1065
|
+
}
|
|
1066
|
+
},
|
|
1067
|
+
"event.message_sent": {
|
|
1068
|
+
"description": "Message sent successfully",
|
|
1069
|
+
"params": {
|
|
1070
|
+
"message_id": { "type": "string" },
|
|
1071
|
+
"to": { "type": "string" },
|
|
1072
|
+
"type": { "type": "string" },
|
|
1073
|
+
"timestamp": { "type": "string", "format": "date-time" }
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
"event.message_received": {
|
|
1077
|
+
"description": "New message received",
|
|
1078
|
+
"params": {
|
|
1079
|
+
"message_id": { "type": "string" },
|
|
1080
|
+
"sender": { "type": "string", "description": "Sender JID" },
|
|
1081
|
+
"chat_id": { "type": "string", "description": "Chat JID (same as sender for DMs, group JID for groups)" },
|
|
1082
|
+
"timestamp": { "type": "string", "format": "date-time" },
|
|
1083
|
+
"is_from_me": { "type": "boolean" },
|
|
1084
|
+
"is_group": { "type": "boolean" },
|
|
1085
|
+
"is_forwarded": { "type": "boolean", "description": "Whether the message was forwarded" },
|
|
1086
|
+
"forwarding_score": { "type": "integer", "description": "Number of times forwarded (higher = forwarded many times)" },
|
|
1087
|
+
"message_type": {
|
|
1088
|
+
"type": "string",
|
|
1089
|
+
"enum": ["text", "image", "video", "audio", "document", "sticker", "location", "contact", "contacts"]
|
|
1090
|
+
},
|
|
1091
|
+
"content": { "type": "object", "description": "Message content (varies by type)" },
|
|
1092
|
+
"text": { "type": "string", "description": "Text content (for text messages)" },
|
|
1093
|
+
"image": { "$ref": "#/components/schemas/ReceivedMedia" },
|
|
1094
|
+
"video": { "$ref": "#/components/schemas/ReceivedMedia" },
|
|
1095
|
+
"audio": { "$ref": "#/components/schemas/ReceivedAudio" },
|
|
1096
|
+
"document": { "$ref": "#/components/schemas/ReceivedDocument" },
|
|
1097
|
+
"sticker": { "$ref": "#/components/schemas/ReceivedSticker" },
|
|
1098
|
+
"location": { "$ref": "#/components/schemas/LocationData" },
|
|
1099
|
+
"contact": { "$ref": "#/components/schemas/ReceivedContact" },
|
|
1100
|
+
"contacts": {
|
|
1101
|
+
"type": "array",
|
|
1102
|
+
"items": { "$ref": "#/components/schemas/ReceivedContact" }
|
|
1103
|
+
},
|
|
1104
|
+
"group_info": {
|
|
1105
|
+
"type": "object",
|
|
1106
|
+
"description": "Present for group messages",
|
|
1107
|
+
"properties": {
|
|
1108
|
+
"group_jid": { "type": "string" },
|
|
1109
|
+
"sender_jid": { "type": "string" },
|
|
1110
|
+
"sender_name": { "type": "string" }
|
|
1111
|
+
}
|
|
1112
|
+
},
|
|
1113
|
+
"is_reply": { "type": "boolean" },
|
|
1114
|
+
"quoted_message_id": { "type": "string" }
|
|
1115
|
+
}
|
|
1116
|
+
},
|
|
1117
|
+
"event.history_sync_complete": {
|
|
1118
|
+
"description": "History sync completed after first login",
|
|
1119
|
+
"params": {
|
|
1120
|
+
"conversations": { "type": "integer", "description": "Number of conversations synced" },
|
|
1121
|
+
"messages": { "type": "integer", "description": "Total messages stored" }
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
},
|
|
1127
|
+
"examples": {
|
|
1128
|
+
"request": {
|
|
1129
|
+
"description": "JSON-RPC 2.0 request format",
|
|
1130
|
+
"value": {
|
|
1131
|
+
"jsonrpc": "2.0",
|
|
1132
|
+
"id": 1,
|
|
1133
|
+
"method": "status",
|
|
1134
|
+
"params": {}
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
"response": {
|
|
1138
|
+
"description": "JSON-RPC 2.0 response format",
|
|
1139
|
+
"value": {
|
|
1140
|
+
"jsonrpc": "2.0",
|
|
1141
|
+
"id": 1,
|
|
1142
|
+
"result": {
|
|
1143
|
+
"connected": true,
|
|
1144
|
+
"has_session": true,
|
|
1145
|
+
"running": true,
|
|
1146
|
+
"pairing": false,
|
|
1147
|
+
"device_id": "1234567890@s.whatsapp.net",
|
|
1148
|
+
"timestamp": "2025-01-15T10:30:00Z"
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
"event": {
|
|
1153
|
+
"description": "JSON-RPC 2.0 notification (no id)",
|
|
1154
|
+
"value": {
|
|
1155
|
+
"jsonrpc": "2.0",
|
|
1156
|
+
"method": "event.message_received",
|
|
1157
|
+
"params": {
|
|
1158
|
+
"message_id": "ABC123",
|
|
1159
|
+
"sender": "1234567890@s.whatsapp.net",
|
|
1160
|
+
"chat_id": "1234567890@s.whatsapp.net",
|
|
1161
|
+
"timestamp": "2025-01-15T10:30:00Z",
|
|
1162
|
+
"is_from_me": false,
|
|
1163
|
+
"is_group": false,
|
|
1164
|
+
"message_type": "text",
|
|
1165
|
+
"text": "Hello world!",
|
|
1166
|
+
"content": "Hello world!"
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
},
|
|
1170
|
+
"send_text": {
|
|
1171
|
+
"description": "Send text message",
|
|
1172
|
+
"value": {
|
|
1173
|
+
"jsonrpc": "2.0",
|
|
1174
|
+
"id": 2,
|
|
1175
|
+
"method": "send",
|
|
1176
|
+
"params": {
|
|
1177
|
+
"phone": "1234567890",
|
|
1178
|
+
"type": "text",
|
|
1179
|
+
"message": "Hello from API!"
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
},
|
|
1183
|
+
"send_image": {
|
|
1184
|
+
"description": "Send image message",
|
|
1185
|
+
"value": {
|
|
1186
|
+
"jsonrpc": "2.0",
|
|
1187
|
+
"id": 3,
|
|
1188
|
+
"method": "send",
|
|
1189
|
+
"params": {
|
|
1190
|
+
"phone": "1234567890",
|
|
1191
|
+
"type": "image",
|
|
1192
|
+
"media_data": {
|
|
1193
|
+
"data": "base64_encoded_image_data",
|
|
1194
|
+
"mime_type": "image/jpeg",
|
|
1195
|
+
"caption": "Check this out!"
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
"send_to_group": {
|
|
1201
|
+
"description": "Send message to group",
|
|
1202
|
+
"value": {
|
|
1203
|
+
"jsonrpc": "2.0",
|
|
1204
|
+
"id": 4,
|
|
1205
|
+
"method": "send",
|
|
1206
|
+
"params": {
|
|
1207
|
+
"group_id": "123456789@g.us",
|
|
1208
|
+
"type": "text",
|
|
1209
|
+
"message": "Hello group!"
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
"send_location": {
|
|
1214
|
+
"description": "Send location message",
|
|
1215
|
+
"value": {
|
|
1216
|
+
"jsonrpc": "2.0",
|
|
1217
|
+
"id": 5,
|
|
1218
|
+
"method": "send",
|
|
1219
|
+
"params": {
|
|
1220
|
+
"phone": "1234567890",
|
|
1221
|
+
"type": "location",
|
|
1222
|
+
"location": {
|
|
1223
|
+
"latitude": 37.7749,
|
|
1224
|
+
"longitude": -122.4194,
|
|
1225
|
+
"name": "San Francisco",
|
|
1226
|
+
"address": "California, USA"
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1231
|
+
"download_media": {
|
|
1232
|
+
"description": "Download media from message",
|
|
1233
|
+
"value": {
|
|
1234
|
+
"jsonrpc": "2.0",
|
|
1235
|
+
"id": 6,
|
|
1236
|
+
"method": "media",
|
|
1237
|
+
"params": {
|
|
1238
|
+
"message_id": "ABC123DEF456"
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
"error_response": {
|
|
1243
|
+
"description": "Error response format",
|
|
1244
|
+
"value": {
|
|
1245
|
+
"jsonrpc": "2.0",
|
|
1246
|
+
"id": 1,
|
|
1247
|
+
"error": {
|
|
1248
|
+
"code": -32000,
|
|
1249
|
+
"message": "WhatsApp not connected"
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
"rate_limit_get": {
|
|
1254
|
+
"description": "Get rate limit config and stats",
|
|
1255
|
+
"value": {
|
|
1256
|
+
"jsonrpc": "2.0",
|
|
1257
|
+
"id": 7,
|
|
1258
|
+
"method": "rate_limit_get",
|
|
1259
|
+
"params": {}
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
"rate_limit_set": {
|
|
1263
|
+
"description": "Update rate limit configuration",
|
|
1264
|
+
"value": {
|
|
1265
|
+
"jsonrpc": "2.0",
|
|
1266
|
+
"id": 8,
|
|
1267
|
+
"method": "rate_limit_set",
|
|
1268
|
+
"params": {
|
|
1269
|
+
"enabled": true,
|
|
1270
|
+
"min_delay_ms": 5000,
|
|
1271
|
+
"max_messages_per_hour": 30,
|
|
1272
|
+
"simulate_typing": true
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
"rate_limit_unpause": {
|
|
1277
|
+
"description": "Resume after automatic pause",
|
|
1278
|
+
"value": {
|
|
1279
|
+
"jsonrpc": "2.0",
|
|
1280
|
+
"id": 9,
|
|
1281
|
+
"method": "rate_limit_unpause",
|
|
1282
|
+
"params": {}
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
"errorCodes": {
|
|
1287
|
+
"-32700": "Parse error - Invalid JSON",
|
|
1288
|
+
"-32600": "Invalid Request - Not a valid JSON-RPC 2.0 request",
|
|
1289
|
+
"-32601": "Method not found",
|
|
1290
|
+
"-32602": "Invalid params",
|
|
1291
|
+
"-32000": "Server error (WhatsApp operation failed)",
|
|
1292
|
+
"-32001": "No QR available"
|
|
1293
|
+
}
|
|
1294
|
+
}
|