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.
-
Create the token:
Terminal window wx tokens create my-script --accounts ACCOUNT_ID --scopes read --scopes sendThe token is printed once, in the
tokenfield of the response. Store it then. -
List tokens to find the ID. The list never shows secret values:
Terminal window wx tokens list -
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
| Scope | Allows |
|---|---|
read | Chats, messages, contacts, groups, events |
media | Downloading attachments |
send | Sending and recalling messages |
read-state | Marking chats read |
login | Logging in, connecting and disconnecting |
admin | Changing 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. |
calls | Reading 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:
wx tokens create my-calls --accounts ACCOUNT_ID --scopes callswx 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.