When you set up WhatsApp Cloud API, the “Generate access token” option, by default, provides you with a temporary token. These temporary tokens typically expire in 23-24 hours, which is not practical for long-running systems or automations. For production API integrations, you need aĀ permanent (never-expiring) access token.
Below is a step-by-step guide to generate a permanent access token for WhatsApp Cloud API:
Step-by-Step Guide
1. Sign in to Meta Business Suite
Log in to your Facebook (Meta) Business account via business.facebook.com.
2. Access System Users Section
Navigate to:
Business Settings > Users > System Users.
3. Create a New System User (If Not Exists)
- Click theĀ AddĀ button to create a system user.
- Give it a clear name (e.g.,Ā
whatsapp_api_system_user). - Set theĀ RoleĀ as “Admin”.
- Note:Ā You may encounter a restriction that requires your admin user to be at least 7 days old before creating other admin system users. If so, you must waitāthis is a Meta security policy.
4. Assign App & Asset Permissions
- Go to the newly created system user.
- ClickĀ Add Assets, then select your WhatsApp App and assignĀ Full Control.
- Also, add your WhatsApp Business Account asset and give full permissions.
5. Generate Permanent Access Token
- With the system user selected, clickĀ Generate Token.
- In the popup, select your App, check the required permissions (
whatsapp_business_management,Āwhatsapp_business_messaging). - Set the expiration toĀ Never.
- Click “Generate”.
Important:Ā Copy and securely save this token. You will not be able to see it again.
6. Use This Token in Your Code
Replace the temporary access token with this permanent token in your application. Now, you won’t worry about your token expiring every day.Why is This Important?
- Stability:Ā Permanent tokens ensure stable, long-term API connections.
- Ease of Management:Ā No need to generate and update tokens frequently.
- Security:Ā System users are safer for production integrations as they are not tied to a personal Facebook account.
Common Problems & Solutions
Problem: “The admin system user must be at least seven days old before creating other admin system users.”
Solution: You must wait for the required period before creating a new admin system user. This is meant to prevent abuse of the platform.
Final Tips
- Always save your permanent token in a secure place.
- If your token stops working, check if it was revoked or if there are changes in your system user/app permissions.
- Regularly review user and app access from the Meta Business Suite for maximum security.



Leave a Reply