WhatsApp API Access Token: Temporary, System User and Keeping It Safe

Which WhatsApp API access token to use, how long each lasts, how to generate a system user token, fix error 190, rotate tokens and store them safely.

Illustration: a masked access token card with a key, a shield and a 60-day refresh timer next to a WhatsApp chat (sample data)

A WhatsApp API access token is the secret your server sends with every Cloud API call, and for anything beyond a first test it should be a system user token, not the temporary one from API Setup. The temporary token is a user access token that Meta says you must regenerate every few hours. A system user token is long-lived, has only the permissions you give it, and can be set to expire every 60 days so you rotate it.

Our Cloud API setup guide and test number guide cover where tokens fit in the setup. This post goes further: the three token types Meta lists, how long each lasts, the exact steps and permissions for a system user token, what error 190 and its relatives mean, how to rotate without downtime, and how to store a token so it never leaks.

Key takeaways

  • Meta lists three token types: user (short-lived, for tests), system user (for your own business) and business integration system user (for Tech Providers serving customers).
  • A system user token needs business_management, whatsapp_business_management and whatsapp_business_messaging, plus access to the right WhatsApp and Messaging accounts.
  • You choose never expires or 60 days when you generate it. Meta calls expiring tokens a security best practice; refresh one before day 60 or it’s lost.
  • Error 190 means the token has expired or was invalidated; error 200 can mean no token was sent or the system user lacks access to the account.
  • Rotate with Meta’s three steps: refresh, deploy, revoke. The old token keeps working until you revoke it.
  • Keep tokens on a server only, in a secrets store, never in an app, a browser, a screenshot or a Git repository.

The three kinds of WhatsApp API access token

Meta’s access tokens guide for the WhatsApp Business Platform names three token types. Which one you need depends on whose WhatsApp account you’re working with.

TokenWho it’s forHow long it lastsWhere it comes from
User access tokenAny developer, for first testsShort: Meta says to generate a new one every few hoursApp Dashboard › WhatsApp › API Setup, Graph API Explorer or Facebook Login
System user access tokenBusinesses calling the API for their own number (direct developers)Long-lived; you pick never-expiring or 60 daysBusiness settings › System users › Generate token
Business integration system user tokenTech Providers and Solution Partners acting for onboarded customersScoped to one customer; no re-login neededExchanging the code returned by Embedded Signup

The token you see in API Setup is a user access token. Meta notes that the panel makes a new one each time you visit it, tied to the person who is signed in. That’s why code that worked in the morning fails in the afternoon: nothing changed except the token’s age.

How to generate a system user access token, step by step

These are the steps in Meta’s access tokens guide. You need admin access to the business portfolio that owns the app and the WhatsApp account.

  1. Open Business settings and click System users.
  2. Click +Add. In Create system user, enter a name (for example “whatsapp-server”) and choose the Admin or Employee role.
  3. Click the new system user’s name, then Assign assets. Select your app, give it Manage app, and click Assign assets.
  4. Reload the System users panel and check that the user has Full control of the app. Meta says this can take a few minutes.
  5. Click Generate token. Select your app and choose the token expiration preference.
  6. Tick business_management, whatsapp_business_management and whatsapp_business_messaging. Typing “business” in the search box finds all three.
  7. Click Generate token and copy the token straight into your secrets store, not into a chat or a notes app.
  8. Give the system user access to your WhatsApp account and Messaging account (next section), or calls will fail even with a valid token.

Meta’s system user documentation also describes generating tokens through the API, with POST /<SYSTEM_USER_ID>/access_tokens and an appsecret_proof. For a single business the dashboard is simpler and less error-prone.

Permissions and account access: why a valid token still fails

A token carries permissions (what kind of thing it may do) but the system user also needs asset access (which accounts it may do it on). Meta treats these separately.

The three permissions Meta lists for a system user token are business_management, whatsapp_business_management and whatsapp_business_messaging. Leave one out and the token works for some calls and fails with a permission error on others. Asset access works like this:

  • Admin system users get full access to all WhatsApp accounts, Messaging accounts and their assets by default.
  • Employee system users need Partial or Full access to *both* the WhatsApp account and the Messaging account. Meta says access to the Messaging account alone is not enough.
  • In Meta Business Suite, access doesn’t cascade: add the system user to each account under Settings › Accounts › WhatsApp accounts (and Messaging accounts) › People › +Add people.
  • Partial access can be narrowed further, for example view-only access to templates for one team.

When the system user lacks access, Meta says the endpoints return error code 200 in the error body (not to be confused with HTTP 200). If you’re unsure which account ID to use, our guide to finding your WhatsApp Business Account ID shows each ID and where it lives.

Never-expiring or 60-day tokens

Meta’s system user documentation offers two expiry options. A non-expiring token never needs refreshing. An expiring token is valid for 60 days from when it was generated or last refreshed, and Meta recommends it: “Expiring tokens are a security best practice.”

OptionGood forWhat to plan
Never expiresA quick internal tool where you accept the riskRevoke and replace it by hand if anyone who saw it leaves, or if it may have leaked
Expires in 60 daysProduction systemsA scheduled job that refreshes it well before day 60, plus an alert if the refresh fails

To refresh an expiring token, your server calls GET https://graph.facebook.com/v27.0/oauth/access_token with grant_type=fb_exchange_token, your app ID as client_id, your app secret as client_secret, set_token_expires_in_60_days=true and the current token as fb_exchange_token. Meta is clear that a token not refreshed within 60 days is forfeited, and you then generate a new one in Business settings.

Error 190 and other token errors: what they mean and how to fix them

Token problems come back straight away in the API response, not in a webhook. Meta’s WhatsApp error codes page says to build your error handling on the numeric code, not on HTTP status or subcodes.

CodeMeta’s meaningUsual causeFix
190Your access token has expiredThe API Setup token is a few hours old, a 60-day token wasn’t refreshed, or the token was revokedUse a system user token; refresh expiring tokens on a schedule
0Unable to authenticate the app userToken expired or invalidatedGet a new access token
200No access token was providedMissing or misspelled Authorization headerSend Authorization: Bearer <TOKEN>
200 (access)System user lacks accessEmployee system user not added to the WhatsApp or Messaging accountAssign the account to the system user
3, 10, 200–299Capability or permission issueA permission wasn’t ticked when the token was generatedCheck the token’s scopes, then generate a new one with the missing permission

You may see subcodes such as 463 (expired) and 467 (invalid token) in Meta’s general Graph API guide, but Meta’s WhatsApp changelog says error subcodes are no longer included in Cloud API responses from v16.0 on. So handle code 190 itself: the fix is the same, get a new token.

Check a token in two minutes

  1. Paste it into Meta’s Access Token Debugger (in the developer tools), or call GET /v27.0/debug_token?input_token=<TOKEN> with an app token or a developer’s token for the same app.
  2. Look at is_valid, expires_at, scopes and granular_scopes.
  3. Make sure the app ID matches the app your WhatsApp account is connected to.
  4. Make one harmless call, such as reading your phone numbers, before blaming the message payload.

For message errors that aren’t about tokens, such as 131047 outside the 24-hour window, see our full list of WhatsApp API error codes.

Rotating a token without downtime

Meta’s system user documentation describes a three-step rotation that keeps your service running:

  1. Refresh the token through the refresh call above. The old token keeps working until it expires or you revoke it.
  2. Deploy the new token to every server and job that sends messages.
  3. Revoke the old token with GET /oauth/revoke, passing client_id, client_secret, revoke_token (the old token) and access_token. Meta says revocation is immediate and the token can’t be used again.

Rotate on a schedule, and straight away when someone with access leaves, when a token appears in a log or chat, or when a laptop with your configuration is lost. If you suspect a system user itself is compromised, Meta’s advice is to revoke its tokens.

Storing and using the token safely

  • Server only. Anyone holding the token can message your customers as your business. Never put it in a mobile app, browser JavaScript or a no-code front end; our React Native guide shows the server pattern.
  • A secrets store or environment variable, not source code. Add the config file to .gitignore, and scan old commits if a token was ever committed.
  • Don’t parse it. Meta says tokens are opaque strings whose length and structure may change. Store them in a variable-length field with no fixed maximum.
  • Send it in a header: Authorization: Bearer <TOKEN>. Avoid putting it in URLs, which end up in server and proxy logs.
  • Turn on Require App Secret under App Settings › Advanced in the App Dashboard. Calls then need an appsecret_proof, an HMAC-SHA256 of the token keyed with your app secret, so a stolen token alone isn’t enough.
  • Mask it in logs and support tickets. Print only the last few characters when you need to tell tokens apart.
  • One token per system, so you can revoke one integration without breaking the others.

Do you need a token with Automate AI?

No. Automate AI connects your number through Meta’s Embedded Signup, which hands the connection to the app, so there’s no Meta token for you to create, copy, refresh or rotate. Your team works in the inbox, campaigns and chatbots without touching the Graph API. If your developers want to send from your own systems, Automate AI’s REST API (AI + Automation Plan and Series 4) uses its own API keys, not your Meta token.

When your own systems need to send order updates or add contacts, Automate AI’s REST API, SDKs and webhooks use Automate AI API keys. Your Meta token never sits in your CRM or website code, and the same rule applies to the key: keep it on a server.

Frequently asked questions

How long does a WhatsApp API access token last?

The temporary token from API Setup is a user access token that Meta says to regenerate every few hours. A system user token is long-lived: you choose never-expiring, or 60 days from when it was generated or last refreshed.

What is the difference between a temporary and a permanent WhatsApp token?

The temporary token is tied to the signed-in developer and expires within hours. The “permanent” one people mean is a system user token from Business settings, which belongs to the business, has only the permissions you pick and lasts until you revoke it (or 60 days if you choose expiring).

Which permissions does a WhatsApp Cloud API token need?

Meta’s guide lists business_management, whatsapp_business_management and whatsapp_business_messaging. The system user also needs access to your WhatsApp account and Messaging account.

How do I fix WhatsApp API error 190?

Error 190 means the access token has expired or is no longer valid. Generate a system user token, or refresh your 60-day token before it runs out, and check it in Meta’s access token debugger.

Can I put the WhatsApp access token in my app or website?

No. Anyone who reads it can send messages as your business. Keep it on your server and have your app call the server instead.

Is a WhatsApp API token the same as an API key?

Meta’s Cloud API uses access tokens, not API keys. Platforms built on it, such as Automate AI, may give you their own API keys for their own API, which is a separate secret.

Sources

  1. Meta: Access tokens (WhatsApp Business Platform)
  2. Meta: Install apps and generate system user tokens
  3. Meta: WhatsApp Cloud API error codes
  4. Meta: Graph API error handling
  5. Meta: Debug token reference
  6. Meta: Securing Graph API requests
  7. Meta: Graph API changelog

WhatsApp rules and prices change. We check these guides against Meta’s documentation, but always confirm current terms with Meta before you rely on them. Questions? Message us on WhatsApp at +91 836 977 8812.