Channels

How to Connect OpenClaw to Zalo Personal

3 min read

Browse more in Channels.

All channels guides →

This guide walks you through connecting OpenClaw to Zalo using the Zalo Bot API so your agent can chat with users over Zalo. You will install or enable the bundled Zalo plugin, create a bot token on the Zalo Bot Platform, and wire it into your OpenClaw gateway.

By the end, your OpenClaw agent will respond to direct messages on Zalo with pairing-based access control.

Prerequisites

  • An existing OpenClaw gateway deployment where you can edit the config and restart the gateway.
  • Access to the Zalo Bot Platform at https://bot.zaloplatforms.com with permission to create a bot.
  • A Zalo Bot Creator / Marketplace bot (this guide follows the Marketplace-bot behavior described in the docs).

Steps

  1. 1

    Ensure the Zalo plugin is available in your OpenClaw install

    OpenClaw ships the Zalo channel as a bundled plugin in current releases, so most packaged builds already have it. If you run an older build or a custom install that excludes Zalo, install the plugin so the gateway can start the Zalo channel.

    bash
    openclaw plugins install @openclaw/zalo
  2. 2

    Install the Zalo plugin from a source checkout if needed

    If you work from a local source checkout instead of a packaged build, you can point the plugin installer at the local Zalo plugin path. This is useful when you vendor plugins alongside your gateway code.

    bash
    openclaw plugins install ./path/to/local/zalo-plugin
  3. 3

    Create a Zalo bot and obtain the bot token

    You need a bot token from the Zalo Bot Platform so OpenClaw can authenticate to the Zalo API. Create the bot, configure its settings, and copy the full token string, including both the numeric ID and secret.

    text
    1.   Go to https://bot.zaloplatforms.com and sign in.
    2.   Create a new bot and configure its settings.
    3.   Copy the full bot token (typically `numeric_id:secret`). For Marketplace bots, the usable runtime token may appear in the bot’s welcome message after creation.
  4. 4

    Configure the Zalo bot token in OpenClaw

    Wire the Zalo bot token into your gateway config so the Zalo channel can start. You can either set an environment variable for the default account or define the channel block in your configuration file with the token and DM policy.

    json
    {
      channels: {
        zalo: {
          enabled: true,
          accounts: {
            default: {
              botToken: "12345689:abc-xyz",
              dmPolicy: "pairing",
            },
          },
        },
      },
    }
    
    ZALO_BOT_TOKEN=...
  5. 5

    Restart the gateway and approve initial DM pairing

    After you add the token, restart your OpenClaw gateway so it can resolve the Zalo config and start the channel. Zalo DMs default to pairing, so when a user first messages the bot, approve their pairing code before messages are processed.

    bash
    openclaw pairing list zalo
    openclaw pairing approve zalo <CODE>
  6. 6

    Send a test message to your Zalo bot from the CLI

    Once the channel is running, you can verify outbound delivery by sending a message from the CLI to a specific Zalo chat ID. This confirms the bot token and routing are working end-to-end.

    bash
    openclaw message send --channel zalo --target 123456789 --message "hi"

Configuration

OptionDescriptionExample
ZALO_BOT_TOKENBot token from the Zalo Bot Platform for the default Zalo account.12345689:abc-xyz
channels.zalo.enabledEnables or disables startup of the Zalo channel in the gateway.true
channels.zalo.botTokenLegacy single-account shorthand for the Zalo bot token from Zalo Bot Platform.12345689:abc-xyz
channels.zalo.tokenFilePath to a regular file containing the Zalo bot token; symlinks are rejected./etc/openclaw/zalo-token.txt
channels.zalo.dmPolicyControls DM access policy for Zalo: `pairing | allowlist | open | disabled`.pairing
channels.zalo.allowFromDM allowlist of Zalo user IDs; set to "*" when using `open` DM policy.[123456789,987654321]
channels.zalo.groupPolicyGroup inbound handling policy: `open | allowlist | disabled` (present but not usable for Marketplace bots).allowlist
channels.zalo.groupAllowFromAllowlist of sender IDs allowed to trigger the bot in groups; falls back to `allowFrom` when unset.[123456789]
channels.zalo.mediaMaxMbMaximum size in megabytes for inbound and outbound media on Zalo.5
channels.zalo.webhookUrlHTTPS URL that enables webhook mode for receiving Zalo events instead of long-polling.https://gateway.example.com/zalo/webhook
channels.zalo.webhookSecretWebhook secret used to verify Zalo webhook requests; must be 8–256 characters.s3cr3tTok3n
channels.zalo.webhookPathHTTP path on the gateway server that handles Zalo webhook requests./zalo/webhook
channels.zalo.proxyProxy URL used for outbound Zalo API requests.http://proxy.internal:8080
channels.zalo.accounts.<id>.botTokenPer-account Zalo bot token when running multiple Zalo accounts.12345689:abc-xyz
channels.zalo.accounts.<id>.tokenFilePer-account token file path for the Zalo bot; must be a regular file./etc/openclaw/zalo-account-a.token
channels.zalo.accounts.<id>.nameDisplay name for a specific Zalo account in multi-account setups.support-bot-vn
channels.zalo.accounts.<id>.enabledEnables or disables a specific Zalo account.true
channels.zalo.accounts.<id>.dmPolicyPer-account DM policy for a specific Zalo account.pairing
channels.zalo.accounts.<id>.allowFromPer-account DM allowlist of Zalo user IDs.[123456789]
channels.zalo.accounts.<id>.groupPolicyPer-account group policy for Zalo groups (present but not usable for Marketplace bots).allowlist
channels.zalo.accounts.<id>.groupAllowFromPer-account group sender allowlist for Zalo groups.[123456789]
channels.zalo.accounts.<id>.webhookUrlPer-account webhook URL for receiving Zalo events.https://gateway.example.com/zalo/account-a/webhook
channels.zalo.accounts.<id>.webhookSecretPer-account webhook secret used to verify Zalo webhook requests.accountASecret1
channels.zalo.accounts.<id>.webhookPathPer-account webhook path on the gateway HTTP server./zalo/account-a/webhook
channels.zalo.accounts.<id>.proxyPer-account proxy URL for Zalo API requests.http://proxy.internal:8080

Troubleshooting

Bot doesn’t respond in Zalo DMs after you message it.

First verify that the Zalo bot token is valid and the channel is up by probing channel status, then confirm the sender is approved via pairing or `allowFrom`. Finally, tail the gateway logs to see if messages are reaching OpenClaw or being rejected.

bash
openclaw channels status --probe
openclaw logs --follow

Webhook not receiving events from Zalo.

Zalo only sends events to an HTTPS webhook with a valid secret of 8–256 characters, and polling must be disabled because getUpdates and webhooks are mutually exclusive. Check that your gateway HTTP endpoint is reachable on the configured path and that the webhook URL and secret match what you configured in Zalo.

Frequently asked questions

Powered by Mem0

Add persistent memory to OpenClaw

Official Mem0 plugin for OpenClaw keeps context across chats and tools. Smaller prompts, lower cost, better continuity for your agents.

More in Channels