Skip to content

API tokens

The daemon creates an owner token on first start, in dataDir/api-token. The CLI on the same machine uses it automatically. Give every other client its own token, limited to the accounts and scopes it needs.

  1. Create the token:

    Terminal window
    wx tokens create my-script --accounts ACCOUNT_ID --scopes read --scopes send

    The token is printed once, in the token field of the response. Store it then.

  2. List tokens to find the ID. The list never shows secret values:

    Terminal window
    wx tokens list
  3. Revoke a token when a client no longer needs it:

    Terminal window
    wx tokens revoke TOKEN_ID

The same operations are available over HTTP. The owner token creates tokens with POST /v1/access-tokens and revokes them with DELETE /v1/access-tokens/{id}. See the tokens reference.

Scopes

ScopeAllows
readChats, messages, contacts, groups, events
mediaDownloading attachments
sendSending and recalling messages
read-stateMarking chats read
loginLogging in, connecting and disconnecting
adminChanging things: adding, renaming or removing accounts, editing groups (create, rename, members, leave), changing contacts, friend requests, and pinning or muting chats. Reads use read. Managing tokens is not included: only the owner token can do that.
callsReading call state and events, registering readiness, controlling calls and exchanging the owner’s call audio

OpenClaw needs read, media, send and login, plus read-state unless readPolicy is never. Calling also needs the calls scope.

For a token that only handles calls, grant calls for one account:

Terminal window
wx tokens create my-calls --accounts ACCOUNT_ID --scopes calls

wx calls status and wx calls monitor --json only observe, even with this token. They do not need chat history or account catalog access. Controlling a call’s audio still requires owning that call.