openclaw config set plugins.entries.openclaw-weixin.enabled true
3. QR code login
openclaw channels login --channel openclaw-weixin
A QR code will appear in the terminal. Scan it with your phone and confirm the authorization. Once confirmed, the login credentials will be saved locally automatically — no further action is needed.
4. Restart the gateway
openclaw gateway restart
Adding More WeChat Accounts
openclaw channels login --channel openclaw-weixin
Each QR code login creates a new account entry, supporting multiple WeChat accounts online simultaneously.
Multi-Account Context Isolation
By default, DMs can share one session bucket. For multiple logged-in WeChat accounts, isolate by account + channel + sender:
openclaw config set session.dmScope per-account-channel-peer
Backend API Protocol
This plugin communicates with the backend gateway via HTTP JSON API. Developers integrating with their own backend need to implement the following interfaces.
All endpoints use POST with JSON request and response bodies. Common request headers:
Header
Description
Content-Type
application/json
AuthorizationType
Fixed value ilink_bot_token
Authorization
Bearer <token> (obtained after login)
X-WECHAT-UIN
Base64-encoded random uint32
Endpoint List
Endpoint
Path
Description
getUpdates
getupdates
Long-poll for new messages
sendMessage
sendmessage
Send a message (text/image/video/file)
getUploadUrl
getuploadurl
Get CDN upload pre-signed URL
getConfig
getconfig
Get account config (typing ticket, etc.)
sendTyping
sendtyping
Send/cancel typing status indicator
getUpdates
Long-polling endpoint. The server responds when new messages arrive or on timeout.
Request body:
{
"get_updates_buf": ""
}
Field
Type
Description
get_updates_buf
string
Sync cursor from the previous response; empty string for the first request
WeChat
简体中文
OpenClaw’s WeChat channel plugin, supporting login authorization via QR code scanning.
Compatibility
latestlegacyPrerequisites
OpenClaw must be installed (the
openclawCLI needs to be available).Check your version:
openclaw --versionQuick Install
Manual Installation
If the quick install doesn’t work, follow these steps manually:
1. Install the plugin
2. Enable the plugin
3. QR code login
A QR code will appear in the terminal. Scan it with your phone and confirm the authorization. Once confirmed, the login credentials will be saved locally automatically — no further action is needed.
4. Restart the gateway
Adding More WeChat Accounts
Each QR code login creates a new account entry, supporting multiple WeChat accounts online simultaneously.
Multi-Account Context Isolation
By default, DMs can share one session bucket. For multiple logged-in WeChat accounts, isolate by account + channel + sender:
Backend API Protocol
This plugin communicates with the backend gateway via HTTP JSON API. Developers integrating with their own backend need to implement the following interfaces.
All endpoints use
POSTwith JSON request and response bodies. Common request headers:Content-Typeapplication/jsonAuthorizationTypeilink_bot_tokenAuthorizationBearer <token>(obtained after login)X-WECHAT-UINEndpoint List
getupdatessendmessagegetuploadurlgetconfigsendtypinggetUpdates
Long-polling endpoint. The server responds when new messages arrive or on timeout.
Request body:
get_updates_bufstringResponse body:
retnumber0= successerrcodenumber?-14= session timeout)errmsgstring?msgsWeixinMessage[]get_updates_bufstringlongpolling_timeout_msnumber?sendMessage
Send a message to a user.
Request body:
getUploadUrl
Get CDN upload pre-signed parameters. Call this endpoint before uploading a file to obtain
upload_paramandthumb_upload_param.Request body:
media_typenumber1= IMAGE,2= VIDEO,3= FILErawsizenumberrawfilemd5stringfilesizenumberthumb_rawsizenumber?thumb_rawfilemd5string?thumb_filesizenumber?Response body:
getConfig
Get account configuration, including the typing ticket.
Request body:
Response body:
sendTyping
Send or cancel the typing status indicator.
Request body:
statusnumber1= typing,2= cancel typingMessage Structure
WeixinMessage
seqnumber?message_idnumber?from_user_idstring?to_user_idstring?create_time_msnumber?session_idstring?message_typenumber?1= USER,2= BOTmessage_statenumber?0= NEW,1= GENERATING,2= FINISHitem_listMessageItem[]?context_tokenstring?MessageItem
typenumber1TEXT,2IMAGE,3VOICE,4FILE,5VIDEOtext_item{ text: string }?image_itemImageItem?voice_itemVoiceItem?file_itemFileItem?video_itemVideoItem?ref_msgRefMessage?CDN Media Reference (CDNMedia)
All media types (image/voice/file/video) are transferred via CDN using AES-128-ECB encryption:
encrypt_query_paramstring?aes_keystring?CDN Upload Flow
getUploadUrlto getupload_param(andthumb_upload_param)encrypt_query_paramto construct aCDNMediareference, include it in theMessageItem, and sendUninstall
Troubleshooting
“requires OpenClaw >=2026.3.22” error
Your OpenClaw version is too old for this plugin version. Check with:
Install the legacy plugin line instead:
Channel shows “OK” but doesn’t connect
Ensure
plugins.entries.openclaw-weixin.enabledistruein~/.openclaw/openclaw.json: