WhatsApp Access Tokens: Temporary, System, Business
Three token types, which one fits a direct developer or a Tech Provider, the permissions each needs, and how to store and debug them safely.
A Cloud API request is only as good as the token behind it. The most common outage in a young integration is not a bug but a token that expired overnight, because the one pasted into the code came from a panel built for a first test. Meta documents three token types with different owners and lifetimes. This article explains each, says which one belongs in production, lists the permissions and shows how to keep tokens out of trouble.
The three token types and who uses them
Meta documents a user access token for first tests, a system user access token for direct developers, and a business integration system user access token for Tech Providers and partners acting for customers. Choosing the wrong one is the root of most token incidents.
| Token | Intended for | Lifetime and source |
|---|---|---|
| User access token | First test message from the App Dashboard | Expires quickly; regenerate every few hours. Comes from API Setup, Graph API Explorer or Facebook Login |
| System user access token | Direct developers and automated services | Long-lived; you choose an expiration preference when you generate it in Business Settings |
| Business integration system user token | Tech Providers and partners acting on onboarded customers | Obtained by exchanging the code returned by Embedded Signup; scoped to one customer |
Meta does not publish a fixed number of days for the system user token on its access token page, so do not hard-code a lifetime in your documentation. Read the expiration you chose at generation time and write it into your runbook.
Why the API Setup token is a trap
The token shown in the App Dashboard under WhatsApp, API Setup is a user access token that is scoped to your developer account and is regenerated each time the panel loads. It is designed to send the first test message, and it expires within hours, so an integration deployed with it will work in the demo and fail the next morning.
The failure is recognizable. Meta documents error 190 with the description that your access token has expired and the instruction to get a new one. If your logs show 190 on every request after a quiet period, the token type is the first suspect, before any network or template theory.
The system user token for direct developers
If you build for your own business, generate a system user token. In Business Settings open System Users, add a user with the Admin or Employee role, assign your app with the Manage app permission, then generate the token for that app and choose an expiration preference. Select these permissions: business_management, whatsapp_business_management and whatsapp_business_messaging.
The system user also needs business asset access to both the WhatsApp account and the Messaging account, with Partial or Full access; access to only one is insufficient. A common cause of confusing failures is a token with the right permissions but no access to one of the two accounts. The system user article in this series shows the steps in order.
The token goes in the Authorization header with the Bearer prefix, and it is a secret that belongs on the server, never in a browser or mobile bundle. How credentials work when you call the Hub's API is covered in the authentication guide.
POST https://graph.facebook.com/{API_VERSION}/{PHONE_NUMBER_ID}/messages
Authorization: Bearer {SYSTEM_USER_ACCESS_TOKEN}
Content-Type: application/jsonThe business integration token for partners
A Tech Provider or Solution Partner serving customers uses a business token that is scoped to one customer and obtained by exchanging the code returned by Embedded Signup. The JavaScript SDK returns the code at response.authResponse.code in the FB.login callback, and your server exchanges it in a server-to-server call.
Meta states that Tech Providers and Tech Partners use business tokens exclusively, and that Solution Partners use a system token only when sharing their credit line, with the Finance editor role on the system user. The practical effect is isolation: a leak affects one customer, and revoking one customer does not break the others.
The permissions a partner needs go through App Review. Meta explains that whatsapp_business_management covers account settings, Messaging accounts and templates, and whatsapp_business_messaging covers phone number settings and messaging. Accessing accounts your business does not own requires Advanced access, and without it calls return error code 200.
Storing and handling tokens
Treat a token as an opaque string and never assume its format or length. Meta says not to parse or decode tokens and to store them in a variable-length data type with no fixed maximum, because their length can change.
- Keep tokens in a secret manager, not in source control, images or client-side code.
- Give each environment its own system user, so a staging leak cannot send production traffic.
- Apply least privilege: Employee system users only see accounts you grant, Admin system users see everything by default.
- Plan rotation: write down the expiry you chose and set a reminder before it.
- Log the HTTP status and the Graph error code, never the token.
Error code 200 deserves a note. Meta explains that it is different from the HTTP 200 status and signals that the system user lacks the required access, so read the JSON error body and not only the status line.
When a request fails with a permission error, check the token before the code. Meta documents error 131005, permission either not granted or removed, and advises using the access token debugger to confirm that the app holds the permissions the endpoint requires. The debugger shows the permissions and the expiry of the token you are actually using, which is often not the one you believe is deployed.
A token that works in one environment and fails in another usually points to a different system user or different asset access, not to a different Meta behavior. Compare the two tokens in the debugger side by side before changing anything.
Example: why the staging bot died at midnight
A team builds a staging bot with the token from the API Setup panel because it is the fastest way to a working send. It works all afternoon and the demo goes well. The next morning every request returns error 190 and the team spends an hour checking templates and webhooks. The cause is the token type: a user access token that expired within hours.
The fix has three parts. They create a system user for staging, assign the app and both accounts, generate a token with the three permissions and store it in the staging secret manager. They add a startup check that calls a cheap read endpoint and fails loudly on 190. And they document the chosen expiration next to the secret's name. For the first call after that, the quickstart is the shortest path.
Frequently asked questions
Does a WhatsApp system user token expire?
You choose an expiration preference when you generate it in Business Settings. Meta's access token page does not state a fixed number of days, so record the value you chose and rotate before it.
Which permissions does a WhatsApp token need?
Meta lists business_management, whatsapp_business_management and whatsapp_business_messaging for a system user token. The system user also needs access to both the WhatsApp account and the Messaging account.
What does error 190 mean?
Meta documents it as an expired access token, with the solution to get a new one. If it appears after a quiet period, check whether you deployed a temporary token from API Setup.
Can a Tech Provider use a system user token?
Meta says Tech Providers and Tech Partners use business tokens exclusively. Solution Partners use a system token only when sharing their credit line.
Fontes
Documentação oficial da Meta, conferida em 31 de outubro de 2026.