This document explains how to migrate business phone numbers from On-Premises API to Cloud API.
Note that migrating a business phone number from one API to another is not the same as migrating a number from one WhatsApp Business Account (WABA) to another.
To migrate from Cloud API to On-Premises API, see Migrating from Cloud API to On-Premises API.
The migration process involves generating metadata about the business phone number, then using that data to register the number for use with Cloud API. This in turn deregisters the number from On-Premises API, since a number can only be registered for use with one API at a time.
Migration does NOT affect:
In order to support migration, however, you must be aware of any API differences and take appropriate action to address them before performing the migration steps described in this document.
You must have a Meta business app that is able to use Cloud API and Business Management API with onboarded customer data, and that is able to digest Cloud API and Business Management API webhooks. The app must also be associated with, or claimed by, your verified Meta Business Account.
If you do not have a Meta business app, or if you have one but have not configured the WhatsApp product on it, complete the steps in our Cloud API Get Started guide. Completing these steps will generate all of the assets needed to test Cloud API and Business Management API.
Your Meta app must undergo App Review and be approved (i.e. have advanced access) for the whatsapp_business_messaging and whatsapp_business_management permissions.
After making sure that your app can handle all API differences, we recommend that you first migrate a low-volume business phone number and verify that all functionality that you intend to offer with Cloud API works correctly. After verifying that everything is working properly, migrate additional numbers.
We also recommend that you perform migration when traffic to your On-Premises API deployment is low.
The following On-Premises API features are either unsupported or are treated differently by Cloud API. Make sure your app is able to handle these differences before starting the migration process.
Cloud API and Business Management API webhooks payload structures are different from On-Premises API payload structures. We recommend that you create a new webhook endpoint that can handle Cloud API and Business Management API exclusively.
Refer to the following documents to help you understand payload differences and how to configure webhooks on your app using the App Dashboard:
Note that after you migrate a business phone number to Cloud API, you must use the WhatsApp Business Account > Subscribed Apps endpoint to subscribe your Meta app to webhooks on the WABA associated with the business number:
curl -X POST 'https://graph.facebook.com/v17.0/<WABA_ID>/subscribed_apps' \ -H 'Authorization: Bearer EAAJB...'
Once migration to Cloud API is complete, the business phone number's On-Premises API webhooks will no longer be delivered and Cloud API webhooks delivery will begin.
Media IDs for any media uploaded to On-Premises API cannot be used when sending messages with Cloud API, so you must either reupload media using Cloud API to generate new media IDs, or use media URLs if the media is hosted on a public server. See Media Messages and Media-Based Message Templates.
Note that to ensure message integrity, some media hosting domains that are allowed by On-Premises API are not allowed by Cloud API. If you use a hosting service for your media, we recommend that you test media URLs in free-form messages and template messages prior to migration. If you believe your host is blocked in error, please contact support.
Cloud API and Business Management API error codes are different from On-Premises API error codes. See the following documents:
On-Premises identifies push-to-talk (PTT) messages in webhooks by setting messages.type
to voice
, but Cloud API identifies PTT messages by setting messages.audio.voice
to true
.
Cloud API does not support stickerpacks.
Downtime begins as soon as you perform the final migration step (registering the number for use with Cloud API) and should only last a few seconds. During this time, messages sent to the number from WhatsApp users will be silently dropped.
We highly encourage you to schedule migration during a time when the number experiences low activity, to minimize any downtime impact.
If the On-Premises business phone number has multi-connect running 2 or more shards, it will automatically be upgraded to high throughput on Cloud API.
If you are migrating a business phone number that has an Official Business Account (OBA) status, its status will be preserved if you include its metadata (generated in step 2) when registering the number (step 3). If you omit this data, the number will lose its OBA status.
If you know the business phone number's PIN, you can skip this step.
You will need the business phone number's PIN when performing step 3, so if you do not know the PIN, you must first disable two-step verification on the business phone number. If you do not own the business phone number, ask the owner to disable it for you.
Use the Backup and Restore API to generate metadata about your business phone number.
POST /v1/settings/backup { "password": "<PASSWORD>" }
The <PASSWORD>
can be any string. This value will be used to encode the metadata, so keep track of it as you will need it in the next step.
{ "settings": { "data": "<METADATA>" }, "meta": { "api_status": "<API_STATUS>", "version": "<API_VERSION>" } }
The API will return an encoded string assigned to the data
property that describes your business phone number and its settings. Capture this value as you will need it in the next step.
<METADATA>
— This is the encoded string that
describes your business phone number and its settings. Capture this
value as you will need it in the next step.<API_STATUS>
— The status of your On-Premises API deployment.<API_VERSION>
—The On-Premises API version number that you are running.curl 'https://localhost:9090/v1/settings/backup' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer EAAJB...' \ -d ' { "password": "tacocat" }'
{ "settings": { "data": "V0FCS..." }, "meta": { "api_status": "stable", "version": "2.49.3" } }
Use the Cloud API WhatsApp Business Phone Number > Register endpoint to register the number for use with Cloud API.
Include the encoded business phone number metadata value and the password from the previous step. Although you can register the number without this data, the business phone number's profile data will be lost if not included, which can affect the WhatsApp Business Account's status as an Official Business Account.
POST /<BUSINESS_PHONE_NUMBER_ID>/register
{ "messaging_product": "whatsapp", "pin": "<NEW_OR_EXISTING_PIN>", "backup": { "password": "<PASSWORD>", "data": "<METADATA>" } }
<NEW_OR_EXISTING_PIN
> — The existing PIN or the PIN you want to set on the business phone number.<PASSWORD
> — The password you used to generate your business phone number's metadata in the previous step.<METADATA
> — The encoded string that describes your business phone number and its settings, generated in the previous step.{ "success": <SUCCESS> }
The API will respond with success
set to true
if registration is successful, or false
if there was an error.
curl 'https://graph.facebook.com/v19.0
/110200345501442/register' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer EAAJB...' \ -d ' { "messaging_product": "whatsapp", "pin": "134568", "backup": { "password": "tacocat", "data": "V0FCS..." } }'
{ "success": true }
Request the health_status
field on the business phone number and verify that it can be used for messaging with Cloud API. See Messaging Health Status.