Adding your System User to shared WhatsApp Business Accounts allows you to programmatically manage the accounts. On this guide, we go over actions BSPs may need to perform to manage their system users.
You can cache the System User IDs for future use.
curl -i -X GET "https://graph.facebook.com/v19.0
/{business-id}/system_users
?access_token={system-user-access-token}"
{ "data": [ { "id": "1972555232742222", "name": "My System User", "role": "EMPLOYEE" } ] }
For this API call, you need to use the access token of a System User with admin permissions.
In the following example, use the ID for the assigned WABA.
curl -i -X POST "https://graph.facebook.com/v19.0
/{waba-id}/assigned_users
?user={assigned-user-id}
&tasks=['{your-permissions or tasks}']
&access_token={admin-system-user-access-token}"
For the assigned-user-id
, use the system user ID returned from your /{business-id}/system_users
call.
Name | Description |
---|---|
| Provides admin access. |
| Provides developer access. |
{ "success": true }
You can fetch the assigned users of the WhatsApp Business Account to verify that the user was added. This is not a required step but helps with validation.
In the following example, use the ID for the assigned WABA.
curl -i -X GET "https://graph.facebook.com/v19.0
/{waba-id}/assigned_users
?business={business-id}
&access_token={system-user-access-token}"
{ "data": [ { "id": "1972385232742142", "name": "Anna Flex", "tasks": [ "MANAGE" ] }, { "id": "1972385232752545", "name": "Jasper Brown", "tasks": [ "DEVELOP" ] } ] }