md2wechat Agent API markAgent API Docs
md2wechat Agent API markAgent API Docs
Homepage

Start

Markdown to WeChat API DocsQuickstartAuth

APIs

Integrations

Operations

ErrorsPricingContact
X (Twitter)

Multi-Account Publishing

Run multiple WeChat official accounts with named credentials and explicit selection.

Multi-Account Publishing

Use case

Teams, client accounts, and account matrices publish to several official accounts from one machine. Named accounts keep credentials separated and make the target explicit on every side effect.

Config

wechat:
  default_account: main
  accounts:
    main:
      appid: wx1234567890abcdef
      secret: your_main_secret
    client-a:
      appid: wx0987654321fedcba
      secret: your_client_secret

Account names must match ^[a-z0-9][a-z0-9_-]{0,63}$.

Selection order

  1. --wechat-account <name> flag
  2. WECHAT_ACCOUNT environment variable
  3. wechat.default_account
  4. Direct wechat.appid / wechat.secret
  5. The single named account, if exactly one exists

Multiple named accounts without a default (and without an explicit selection) fail with:

WECHAT_ACCOUNT_AMBIGUOUS

Discovery, without secrets

md2wechat config wechat-accounts --json

Lists accounts[{name, appid, current}], current, and default_account. This command never outputs secrets, not even masked.

Per-command selection

md2wechat convert article.md --draft --cover cover.jpg --wechat-account client-a

--wechat-account is available on every WeChat side-effect command (draft creation, image upload, image posts).

API key boundary

  • Named accounts and fixed-egress proxy mode require a valid MD2WECHAT_API_KEY, validated via HEAD /api/auth/validate before any side effect.
  • The legacy single-account path (wechat.appid/wechat.secret directly) keeps working without an API key.

Related

  • Auth
  • Whitelist
  • Publishing API

Table of Contents

Multi-Account Publishing
Use case
Config
Selection order
Discovery, without secrets
Per-command selection
API key boundary
Related