Skip to content

REST API

The agent-wechat server exposes a REST API on port 6174. All requests require a Bearer token in the Authorization header.

Authentication

Authorization: Bearer <token>

Endpoints

Chats

MethodPathDescription
GET/api/chatsList chats (with unread counts)
GET/api/chats/:idGet a specific chat
POST/api/chats/:id/openOpen a chat in the WeChat UI

Messages

MethodPathDescription
GET/api/messages/:chatIdList messages in a chat
POST/api/messages/sendSend a message (text, image, or file)
GET/api/messages/:chatId/media/:localIdDownload a media attachment

Auth

MethodPathDescription
GET/api/auth/statusCheck login status
POST/api/auth/logoutLog out of WeChat
WS/api/ws/loginWebSocket for login flow (QR code events)

Contacts

MethodPathDescription
GET/api/contactsList all contacts

Sessions

MethodPathDescription
GET/api/sessionsList sessions
POST/api/sessionsCreate a session
POST/api/sessions/:id/startStart a session
POST/api/sessions/:id/stopStop a session
DELETE/api/sessions/:idDelete a session

Debug

MethodPathDescription
GET/api/screenshotTake a screenshot
GET/api/a11yDump the accessibility tree

VNC

PathDescription
/vnc/Browser-based VNC viewer (noVNC)