Skip to content

Integrations

WhatsApp Business

Connect WhatsApp Business to Alter Vault for secure API access

Use WhatsApp Business credentials to make authenticated API calls through Alter Vault without exposing API keys in code.

PropertyValue
Template IDwhatsapp-business
CategoryCommunication
Credential TypeBearer Token

Log in to Meta for Developers

Log in to Meta for Developers at developers.facebook.com/apps/.

Select the application

Select the application (or create one with WhatsApp product).

Go to WhatsApp → API Setup

Go to WhatsApp → API Setup in the left sidebar.

Generate an access token

Click Generate access token for a temporary token. For production, create a System User in Business Settings, assign it the app and WhatsApp Business account, then generate a token with whatsapp_business_messaging and whatsapp_business_management. Add business_management only if the integration queries the business portfolio.

Copy the access token

Copy the access token.

Open the Developer Portal

Go to portal.alterauth.com and navigate to the application.

Add WhatsApp Business

Go to Managed Secrets > Add Provider > WhatsApp Business.

Enter credentials

Paste the Access Token into the credential field.

Save

Click Save. You’ll receive a grant_id to use with the SDK.

from alter_sdk import PendingApproval
response = await alter_app.proxy_request(
HttpMethod.POST,
"https://graph.facebook.com/YOUR_API_VERSION/YOUR_PHONE_NUMBER_ID/messages",
grant_id="YOUR_GRANT_ID",
json={
"messaging_product": "whatsapp",
"to": "15551234567",
"type": "text",
"text": {"body": "Hello from Alter"},
},
)
if isinstance(response, PendingApproval):
for gate in response.gates:
print("Approval required:", gate.approval_url)
response = await alter_app.await_approval(response.approval_id)
  • Temporary tokens from API Setup expire after 24 hours. For production, create a System User token in Business Settings (Business settings → System users → Add → Assign assets → Generate token) with whatsapp_business_messaging and whatsapp_business_management. Add business_management only for business-portfolio queries.
  • See Meta’s WhatsApp Business Platform documentation for the Cloud API reference.

Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.

Operation IDFamiliesMethodProvider path
messages/sendsendPOST/{api_version}/{phone_number_id}/messages
media/uploadwritePOST/{api_version}/{phone_number_id}/media
media/deletedeleteDELETE/{api_version}/{media_id}
business_profile/getreadGET/{api_version}/{phone_number_id}/whatsapp_business_profile
business_profile/updatewritePOST/{api_version}/{phone_number_id}/whatsapp_business_profile
message_templates/createwritePOST/{api_version}/{waba_id}/message_templates
message_templates/listreadGET/{api_version}/{waba_id}/message_templates
message_templates/deletedeleteDELETE/{api_version}/{waba_id}/message_templates
phone_numbers/listreadGET/{api_version}/{waba_id}/phone_numbers
phone_numbers/registeradminPOST/{api_version}/{phone_number_id}/register
phone_numbers/deregisteradminPOST/{api_version}/{phone_number_id}/deregister
phone_numbers/request_codeadminPOST/{api_version}/{phone_number_id}/request_code
phone_numbers/verify_codeadminPOST/{api_version}/{phone_number_id}/verify_code
subscribed_apps/createadminPOST/{api_version}/{waba_id}/subscribed_apps
subscribed_apps/listreadGET/{api_version}/{waba_id}/subscribed_apps

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand how our website, product, and documentation are used.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

Advertising

Shares visits and sign-ups with Meta, Reddit, and X so we can measure which of our ads work.

You can change these choices at any time from Cookie settings.