Link a WhatsApp account
link_accountPair a wazap instance with a user's WhatsApp account when get_status reports not linked, logged out, session corrupt, or auth failure; returns a code to enter in WhatsApp.
Instructions
Pair this wazap with the user's WhatsApp when get_status says not_linked, logged_out,
session_corrupt or auth_failure. Ask the user for their phone number in international format,
call this, and show them the code it returns with these exact steps:
WhatsApp → Settings → Linked devices → Link a device → Link with phone number instead → enter the code.
Then call get_status every 10 seconds until it says connected (up to 3 minutes). The code expires;
call this again for a fresh one if get_status goes back to not_linked with an error.
The account must already exist (wazap account add). Pass account_id when
more than one is configured. An unknown id is ACCOUNT_NOT_FOUND.
Never call this when the account is already linked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| phone | Yes | International format, e.g. +15550100 | |
| account_id | No | Registry account id (default, work, …). Omit to resolve from chat_id or message_id, or the default account. |