#WhatsApp Business Management API

Number of APIs: 33

This public collection contains common queries, sample responses, and links to supporting documentation for the Business Management API .

Requirements

To use this collection you must have a Meta business portfolio , a WhatsApp Business Account (WABA) , and a business phone number . If you complete the steps in the Cloud API Get Started guide, all of these will be created for you.

Environment

This collection has a corresponding Business Management API Qodex [environment] which you must select when using the collection. Set current values for the variables defined in this environment if you wish to perform the queries in the collection.

You can find most of these values in the WhatsApp Manager or the WhatsApp > Getting Started panel in the app dashboard , but if you have an access token and your business portfolio ID , you can use the collection to get the remaining values.

Access tokens

The API supports both user and system user access tokens. You can get a user access token by loading your app in the app dashboard and navigating to the WhatsApp > Getting Started panel. Alternatively you can use the Graph API Explorer to generate one.

Since user access tokens expire after 24 hours, you'll likely want to generate a system user access token, which lasts up to 60 days (or permanently, if you wish). See System Users to learn how to create a system user and system user access token.

Once you have your token, save it as a current value in the environment.

Business portfolio ID

You can get your business portfolio ID by signing into the Meta Business Suite . The ID appears in the URL as business_id . Once you save this as a current value in the environment, go to the WhatsApp Business Account (WABA) folder and run the Get all owned WABAs query. This will return your WABA ID, which you can save to your environment and then use to determine your business phone number ID.

Permissions

The API technically only relies on two permissions, but since you're likely going to be using the API to generate assets in order to send messages using our other APIs, we recommend that you grant your these three permissions:

  • business_management
  • whatsapp business management
  • whatsapp business messaging

Note that if you get a user access token from the app dashboard, it automatically grants your app all three of these permissions.

Access token debugger

You can paste your token into the access token debugger to see what type of token it is and what permission you have granted to your app.

Pagination

Endpoints that return lists/collections may paginate results (you'll see previous and next properties in the response). Use the URLs from these properties to get the previous or next set of results. Note that if you click one of these links in Qodex, it will open a new query in a new tab which you must save before running (otherwise it can't read your environment variables), so you may wish to cut and paste the URL and run the query in the same tab in which it was returned.

  1. Templates - Edit template POST https://graph.facebook.com/{{api-version}}/<TEMPLATE_ID>

  2. Webhooks - Get all apps subscribed to WABA's webhooks GET https://graph.facebook.com/{{api-version}}/{{waba-id}}/subscribed_apps

  3. Webhooks - Subscribe app to WABA's webhooks POST https://graph.facebook.com/{{api-version}}/{{waba-id}}/subscribed_apps

  4. Webhooks - Unsubscribe app from WABA's webhooks DELETE https://graph.facebook.com/{{api-version}}/{{waba-id}}/subscribed_apps

  5. WhatsApp Business Accounts (WABA) - Get WABA GET https://graph.facebook.com/{{api-version}}/{{waba-id}}

  6. WhatsApp Business Accounts (WABA) - Get all shared WABAs GET https://graph.facebook.com/{{api-version}}/{{business-account-id}}/client_whatsapp_business_accounts

  7. WhatsApp Business Accounts (WABA) - Get all owned WABAs GET https://graph.facebook.com/{{api-version}}/{{business-account-id}}/owned_whatsapp_business_accounts

  8. Business accounts - Get business account (specific fields) GET https://graph.facebook.com/{{api-version}}/{{business-account-id}}?fields=id,name,timezone_id

  9. Billing - Get credit lines GET https://graph.facebook.com/{{api-version}}/{{business-account-id}}/extendedcredits

  10. Commerce - Get commerce settings GET https://graph.facebook.com/{{api-version}}/{{business-phone-number-id}}/whatsapp_commerce_settings