Refresh OpenWA patches and apply a licence while the API stays running
Reload the WhatsApp runtime from the SDK or dashboard without restarting the Node process, and follow the refresh operation through its progress states.
OpenWA 5.5 adds refresh controls to a running session. Use Refresh patches or Apply license in the dashboard, or call the SDK's refresh() method. The Node process, API host and client objects stay alive while the WhatsApp page reloads and its runtime is prepared again.
Choose SDK or Easy API
Use the tabs below to choose an embedded Node.js SDK or an HTTP client. SDK examples assume a ready client. For Easy API, start the server, scan its QR, and use the printed address. Set these variables in the shell that runs your examples:
export OPENWA_API_URL='http://127.0.0.1:8080'export WA_API_KEY='REPLACE_WITH_YOUR_API_KEY'npx @open-wa/wa-automate@5.5.1 \ --host 127.0.0.1 --port 8080 --api-key "$WA_API_KEY"Python examples use requests: install it with python -m pip install requests. JavaScript examples use Node.js 22.21.1 or later and its built-in fetch. Keep the API key on your application server. Method responses contain { success: true, data }; the examples read data. The API explorer at /api-docs/ lists your server's routes and inputs.
const result = await client.refresh();console.log(result);Unlike ordinary method routes, POST /api/session/refresh returns HTTP 202 with { operationId } directly, and its GET returns the status directly. Acceptance means the refresh has started. Follow phase, running, runtimeUsable and error until it completes or needs QR authentication.
For an operation your UI follows asynchronously, requestRefresh(options?) returns an operation ID and getRefreshStatus() returns its current snapshot. The authenticated API exposes the same progress. Licence application uses the configured licence flow and updates the session's available features; it doesn't require rebuilding your application.
Keep the interruption visible
Refreshing keeps the host alive but interrupts the browser session. Messages may be missed while the page is unavailable, and operations interrupted during refresh aren't replayed automatically. An API process that still answers HTTP requests isn't proof that its WhatsApp page is ready to send.
Use the progress state to explain what's happening in your UI, then continue work once the current session is ready. Inspect uncertain sends rather than replaying them merely because refresh completed. Calling media attachments and other browser-owned resources belong to their runtime generation and need fresh attachment after recovery.
The dashboard presents this progress alongside the session's licence menu, so an operator can apply a key and see enabled or disabled features without restarting the API host. Applications can read client.getLicenseFeatures() for their own display; individual calling actions handle availability themselves.
See session refresh for the options and lifecycle, and calls for media cleanup during recovery.