WhatsApp DialWhatsAppCall returns invalid_argument after changing to a system-user token

Environment: Python 3.12, livekit-api 1.2.1, livekit-agents 1.8.7, LiveKit Cloud WhatsApp connector, WhatsApp Cloud API 26.0.

An outbound DialWhatsAppCall request raises ServerError(code=‘invalid_argument’) before returning a WhatsApp call ID. A connector participant briefly joins its room, then disconnects. The recipient confirms no ringing. We delete the room and do not retry. Earlier calls using a different Meta authorization succeeded.

With the new Employee system-user token, read-only checks confirm the sender belongs to the selected WABA, the app subscription exists, the recipient has permanent call permission, calling is enabled, and there are no calling restrictions reported. Token scopes are whatsapp_business_management and whatsapp_business_messaging. Asset access is app Develop/Test and WhatsApp Messages plus phone-number view.

Questions:

  1. Are those system-user asset tasks sufficient for business-initiated Calling API access, or is a more specific task required?
  2. Does the connector return an underlying numeric Meta error code through a documented SDK metadata field when DialWhatsAppCall returns invalid_argument?
  3. Is there a read-only way to retrieve the failed request’s error detail when no WhatsApp call ID was returned?

We are asking how to diagnose the existing failure without another dial or a paid plan. No project/account IDs, phone numbers, credentials, recordings, transcripts, SDP or private logs are included here.

@n Actually using system-user token is the right preferred way of authorizing to Meta and it should work. That’s what I use & it works fine and I’m able to do business-initiated calls with it.

Here are some recommendations I have for you;

  1. Check if this system token has the right permission/scopes in Meta. Refer to this Meta Access Token tool
  2. Check the call logs in Meta and analyze what its telling you. You can find it in WABA > Phone Numbers.

I’m curious, is this same system token working for inbound calls?

@Neucu_Capital_Partners Your system token should have these scopes;

whatsapp_business_management, whatsapp_business_messaging, whatsapp_business_manage_events, public_profile

I hope this helps.

Thanks for sharing your working setup. Inbound calling has not been tested with this token. We are keeping further diagnostic calls stopped.

Our token has whatsapp_business_management and whatsapp_business_messaging. Meta’s permissions reference describes whatsapp_business_manage_events as conversion-event logging for ads targeting, optimization and reporting: https://developers.facebook.com/docs/permissions/

Do you know whether manage_events is specifically required for business-initiated Calling API access, or is it simply included in your working token? A Calling API requirement or reference would help us identify the precise missing access.

We are also checking the available Meta call history. Is there a documented read-only way to retrieve the underlying Meta error when LiveKit returns invalid_argument before supplying a WhatsApp call ID, or a specific safe SDK metadata field to inspect? We are keeping account identifiers and private diagnostics out of this public topic.

Additional sanitized diagnostics: Meta debug_token confirms a valid SYSTEM_USER token for the expected app, with whatsapp_business_management and whatsapp_business_messaging. A read-only account ownership query matches the expected business, and assigned_users confirms the service user has the MESSAGING asset task. Calling settings remain enabled with no reported restriction.

One explicitly authorized incomplete validation POST directly to /PHONE_ID/calls, containing only {“messaging_product”:“whatsapp”}, returned HTTP 400 with numeric Meta error code 10. It contained no recipient, action or media, and was not repeated. We retained only sanitized numeric error fields, so the exact error message is unavailable; we are not treating this as proof of a specific missing task.

Does this help distinguish Meta asset authorization from connector request validation? Is MESSAGING the intended WABA task for business-initiated calls, or is another explicitly documented task required? We are keeping actual calls stopped while diagnosing. No identifiers, credentials or private logs are included.

Try testing with inbound calls and see how that goes. Once you have a working call with this token, then it’s easy to check why a specific scenario is not working.

What do you see on Meta call history. The error you provided “invalid_arguments” is not descriptive to understand the cause of your issue. If you can provide the full error, then that will help.

Meta error code 10 happens when Permission is either not granted or has been removed. Refer to this https://developers.facebook.com/documentation/business-messaging/whatsapp/support/error-codes. When you’re creating your system user token, make sure to provide it all access to the Meta app.

Generic things to check

From a meta side, ensure that your backend server is receiving call connect webhook from Meta.

  • For inbound calls: The call.session.sdp_type should be offer
  • For outbound calls: The call.session.sdp_type should be answer

I feel the issue you’re facing is not a LiveKit issue, but rather it’s because the token doesn’t have some permissions. Give this token every whatsapp related permissions and see if this fixes your issue.