
Access tokens guide
Facebook API Access Token: User, Page, App and System User Tokens Explained
How to get each token, extend it to about 60 days, check it with debug_token and handle error 190, and how a SaaS app can skip the token pipeline.
GET
graph.facebook.com/debug_token?input_token={USER_ACCESS_TOKEN} applicationYour Appis_validtrueexpires_atin 60 dayslong-lived user tokendata_access_expires_atin 90 daysrenewed when the user is activescopes
TOKEN
No refresh token: re-check, then re-login
Table of Contents
The basics
Short answer
A Facebook API access token is the string every Graph API call needs. You get a user token through Facebook Login (or the Graph API Explorer for tests), exchange it on your server for a long-lived token of about 60 days, then call /me/accounts for Page tokens. There is no API key and no refresh token: watch tokens with debug_token and handle error 190.
For a SaaS serving many customers, there is a second model: users connect their Facebook accounts through Unipile, and your app never holds a Meta token.
With Unipile
No Meta token to get, extend or debug
- 1
Connect the account
Your user links their Facebook account or Page once through Hosted Auth. No Meta app, no App Review.
- 2
Call with your API key
Send
X-API-KEYwith the user'saccount_id:GET /v2/{ACCOUNT_ID}/chats. - 3
Watch one status
Check
products_connection_status; if needed, the user reconnects through Hosted Auth.
Definition
What Is a Facebook API Access Token?
Meta defines an access token as "an opaque string that identifies a user, app, or Facebook Page". Every Graph API request carries one, and its type decides on whose behalf you act.
| Token | Acts for | How you get it | Lifetime and use |
|---|---|---|---|
| User | A logged-in person | Facebook Login or Graph API Explorer | 1 to 2 hours, or about 60 days |
| Page | A Facebook Page | /me/accounts with an admin's user token | Follows its user token |
| App | Your Meta app | client_credentials call, or {APP_ID}|{APP_SECRET} | Server-to-server calls only |
| System user | Your business | Business Settings | No expiry, or 60 days |
| Client | Your app, in client code | App Dashboard | Not a secret |
User token
Acts forA logged-in person
How you get itFacebook Login or Graph API Explorer
Lifetime and use1 to 2 hours, or about 60 days
Page token
Acts forA Facebook Page
How you get it
/me/accounts with an admin's user tokenLifetime and useFollows its user token
App token
Acts forYour Meta app
How you get it
client_credentials call, or {APP_ID}|{APP_SECRET}Lifetime and useServer-to-server calls only
System user token
Acts forYour business
How you get itBusiness Settings
Lifetime and useNo expiry, or 60 days
Client token
Acts forYour app, in client code
How you get itApp Dashboard
Lifetime and useNot a secret
Instagram has its own flow: see our Instagram API token.
Source: Meta's Access Tokens guide. Last verified: November 17, 2026.
Get a token
How to Get a Facebook API Access Token
There is no Facebook API key: every call uses an access token. For tests, generate one for your own account in the Graph API Explorer. In production, users log in to your Meta app with Facebook Login (for Business when you need their Pages), and your server exchanges the returned code for a user access token.
Test, in 4 steps
Graph API Explorer
- Open
developers.facebook.com/tools/explorer - Pick your Meta app and "User Token"
- Add the permissions you need
- Click Generate Access Token and approve
Production, in 4 steps
Facebook Login in your Meta app
- Create a Meta app (App ID, App Secret)
- Send users to
/dialog/oauthwithclient_id,redirect_uri,state - They grant permissions; you receive a
code - Your server calls
/oauth/access_tokenwith thecodeand App Secret
The response holds access_token, token_type and expires_in. Other people can only grant permissions once App Review gives your app Advanced Access. The full access path is in our Facebook API overview, and the Page side of it in our Facebook Page API guide.
Source: Meta's Manually Build a Login Flow guide (Graph API v27.0). Last verified: November 17, 2026.
Long-lived token
How to Get a Long-Lived Access Token
Send the short-lived user token to GET /oauth/access_token with grant_type=fb_exchange_token, your App ID and your App Secret. The response holds a long-lived token and its expires_in, about 60 days. Meta is explicit: "Make this call from your server, not a client."
- Exchange before expiry. "You can not use an expired token to request a long-lived token": once the short token is dead, the user has to log in again.
- Store the expiry as a date next to the token.
- Testing only? The Access Token Debugger has an Extend Access Token button that does the same for a token of your own.
The token lifecycle in code
Tabs 1 to 3 use Meta's Graph API; tab 4 is Unipile, without a Meta token.
# Server side only: this call carries your App Secret
curl -G "https://graph.facebook.com/oauth/access_token" \
-d "grant_type=fb_exchange_token" \
-d "client_id={APP_ID}" \
-d "client_secret={APP_SECRET}" \
-d "fb_exchange_token={USER_ACCESS_TOKEN}"
# Response (abridged)
{ "access_token": "{LONG_LIVED_USER_TOKEN}", "expires_in": 5183944 }
# App access token, for server-to-server calls such as debug_token
curl -G "https://graph.facebook.com/oauth/access_token" \
-d "client_id={APP_ID}" \
-d "client_secret={APP_SECRET}" \
-d "grant_type=client_credentials"
# Or pass it directly, without the call
access_token={APP_ID}|{APP_SECRET}
# Check any token with your app token
curl -G "https://graph.facebook.com/debug_token" \
-d "input_token={LONG_LIVED_USER_TOKEN}" \
-d "access_token={APP_ID}|{APP_SECRET}"
# Response (abridged)
{ "data": {
"app_id": "{APP_ID}",
"is_valid": true,
"expires_at": 1800057600,
"data_access_expires_at": 1802649600,
"scopes": ["public_profile", "pages_show_list"]
} }
# No Meta token: your API key and the user's account_id
curl --request GET \
--url "https://api.unipile.com/v2/{ACCOUNT_ID}/inboxes" \
--header "X-API-KEY: {API_KEY}"
# List the chats of the connected account
curl --request GET \
--url "https://api.unipile.com/v2/{ACCOUNT_ID}/chats" \
--header "X-API-KEY: {API_KEY}"
200 OK · long-lived user token, about 60 days
200 OK · never in client code or app binaries
200 OK · is_valid, expires_at, data_access_expires_at
200 OK · one account_id, no token to exchange
Requests from Meta's Long-Lived Access Tokens and Access Tokens guides. Unipile: Facebook Pages documentation.
Page tokens, in short
With a Page admin's long-lived user token, GET /me/accounts returns each Page with its own token, which "do not have an expiration date and only expire or are invalidated under certain conditions". Details in our Facebook Page API guide; to post with one, see how to publish to a Page with its token.
Lifetime
How Long Does a Facebook Access Token Last?
Per Meta, a short-lived user token lasts about one to two hours and a long-lived one about 60 days. Page tokens taken from a long-lived token and some system user tokens have no expiration date. Separately, your access to a user's data stops after 90 days of inactivity.
Short-lived user token1 to 2 hours
Long-lived user tokenAbout 60 days
Page token, from a long-lived user tokenNo expiration date
System user tokenNever, or 60 days
Access to the user's data90 days after last activity
Token expiry is not data access expiry
Meta states that "the expiration period for data access is 90 days, based on when the user was last active." The user stays logged in, but your app cannot read their data until they re-authorize it.
No token is permanent: a "never expiring" token still dies when the user removes your app, changes their password or loses their role. Meta warns: "Do not depend on these lifetimes remaining the same."
Sources: Meta's Access Tokens, Long-Lived Access Tokens, Authorization vs. data access and system user tokens. Last verified: November 17, 2026.
System user
System User Access Tokens for Server-to-Server Jobs
A system user access token belongs to a system user of your Business Manager, not to a person. Meta says it lets "your app perform programmatic, automated actions on Ad objects or Pages". You generate it in Business Settings.
Option 1
Never expires
No renewal, for cases where a leaked token is an acceptable risk.
Option 2, recommended
Expires in 60 days
Set set_token_expires_in_60_days=true and renew with fb_exchange_token before day 60.
- Same business only. The system user and the app belong to the same Business Manager, and "if the user lacks access, the request is rejected."
- Marketing API access first: standard access or more.
Sources: Meta's Install apps and generate tokens and Access Tokens. Last verified: November 17, 2026.
Debug
How to Check a Facebook Access Token with debug_token
Call GET /debug_token?input_token={TOKEN} with an app access token (or the user token of a developer of the app). It returns validity, expiry, data access expiry and granted permissions. Without code, paste the token into the Access Token Debugger (developers.facebook.com/tools/debug/accesstoken).
is_validWhether the token still works.
expires_atToken expiry, as a Unix timestamp;
0 means no expiration date.data_access_expires_atWhen data access ends, even with a valid token.
scopesGranted permissions;
granular_scopes adds target IDs.app_id, user_idWho the token was issued for.
profile_idThe Page ID, for a Page token.
To check if a Facebook access token is valid in production, run the request in tab 3 of the code block above on your server, on a schedule, and store both dates with each token. A missing permission in scopes explains most "works for me, fails for them" bugs.
Source: Meta's debug_token reference (Graph API v27.0). Last verified: November 17, 2026.
Errors
Facebook Access Token Errors: Code 190 and Its Subcodes
Error 190 means the Facebook access token has expired or is invalid. It comes back as an OAuthException, and its error_subcode tells you what to ask the user. Retrying with the same token never fixes it.
{ "error": { "type": "OAuthException", "code": 190, "error_subcode": 460, "fbtrace_id": "EJplcsCHuLu" } }
190
Read error_subcode, keep fbtrace_id for Meta support
| Subcode | Meaning | What to do |
|---|---|---|
| 458 | App not installed | Log the user in again |
| 459 | User checkpointed | User logs in on facebook.com |
| 460 | Password changed | Log the user in again |
| 463 | Token expired | Log in, then re-exchange |
| 464 | Unconfirmed user | User logs in on facebook.com |
| 467 | Invalid token | Reconnect the user |
| 492 | No suitable role on the Page | New token from a current admin |
Subcode 458
MeaningApp not installed
What to doLog the user in again
Subcode 459
MeaningUser checkpointed
What to doUser logs in on facebook.com
Subcode 460
MeaningPassword changed
What to doLog the user in again
Subcode 463
MeaningToken expired
What to doLog in, then re-exchange
Subcode 464
MeaningUnconfirmed user
What to doUser logs in on facebook.com
Subcode 467
MeaningInvalid token
What to doReconnect the user
Subcode 492
MeaningNo suitable role on the Page
What to doNew token from a current admin
In a multi-customer SaaS, 492 is the classic: the admin who connected a Page leaves. Other codes are in our Facebook API errors table.
Source: Meta's Graph API error handling guide. Last verified: November 17, 2026.
Security
Storing and Securing Facebook Access Tokens
Treat every Facebook access token like a password for the account behind it: keep the App Secret and app tokens on your server, encrypt user and Page tokens at rest, sign server calls with appsecret_proof, and delete tokens as soon as a customer disconnects.
- Server side only for secrets. Meta: "Never hard-code app access tokens into client-side code or app binaries" and "Only use app access tokens in server-to-server calls."
- Client tokens are public. Meta notes they "are not secret", so never use one to authorize anything sensitive.
- Sign calls with
appsecret_proof. Meta defines it as "a sha256 hash of your access token, using your app secret as the key"; turn on Require App Secret in the App Dashboard. - Encrypt at rest, HTTPS in transit. Keep tokens out of logs and URLs.
- One record per token. Store the user, Page, app and
expires_at. - Purge on disconnect. Delete the token when a user leaves.
Sources: Meta's Access Tokens and Securing Requests guides. Last verified: November 17, 2026.
With Unipile
Skip Token Management: Connect Your Users' Facebook Accounts
With Unipile, each user connects their Facebook account once, through Hosted Auth. The Pages they manage arrive on the same account_id, and you call the API with your own key (X-API-KEY). No Meta token, no Meta app and no App Review on your side.
| Question | Meta access tokens | Unipile connected account |
|---|---|---|
| What you store | One token per user, plus one per Page, admin and app | An account_id per user and one API key |
| What you watch | expires_at and data_access_expires_at for every token | A status per Page in metadata.products_connection_status |
| What you renew | Long-lived exchange or login before day 60 | No Meta token to exchange |
| On error 190 | Parse the subcode, then ask the user to log in again | The user reconnects through Hosted Auth if needed |
What you store
Meta tokensOne token per user, plus one per Page, admin and app
UnipileAn
account_id per user and one API keyWhat you watch
Meta tokens
expires_at and data_access_expires_at for every tokenUnipileA status per Page in
metadata.products_connection_statusWhat you renew
Meta tokensLong-lived exchange or login before day 60
UnipileNo Meta token to exchange
On error 190
Meta tokensParse the subcode, then ask the user to log in again
UnipileThe user reconnects through Hosted Auth if needed
A connected account covers messages, Page inboxes, posts, comments and reactions. A Page can answer its conversations and publish posts, but cannot start a conversation. See tab 4 above and our Facebook Messenger API page.
Compliance
Each user connects their own account
Unipile is an independent company, not an official Meta app and not a Meta Partner. It acts on behalf of each authenticated user, and every user remains bound by Meta's terms.
Build on Facebook without a token pipeline
Each user links their Facebook account once; you use one API for Facebook, LinkedIn, WhatsApp and email. 7-day free trial.
EU Regulated
Digital Markets Act (DMA)
Each user connects their own account, with no profile storage. Unipile is not a Meta Partner. Learn more
All Facebook API endpoints in one place
Once the account is connected, see every Facebook endpoint available with Unipile, or read the complete Facebook API guide for permissions, limits and errors.
Facebook API Access Token FAQ
Quick answers on token lifetime, refresh, validity checks, storage and error 190.
Not truly. A long-lived user token lasts about 60 days. Page tokens derived from it and some system user tokens have no expiration date, but still die when the user removes your app, changes their password or loses their role. Plan a reconnect flow.
Not in the OAuth sense: Meta documents no refresh_token grant for Facebook Login. You exchange a valid short-lived token with fb_exchange_token; once a token expires, the user logs in again. In native mobile apps, Meta refreshes long-lived tokens once a day when the person uses your app.
Because 60 days is a ceiling, not a promise. A token dies early when the user changes their password, removes your app, hits a security checkpoint or loses their Page role, and Meta warns that lifetimes "may change without warning or expire early". Read the error 190 error_subcode to know which case you hit.
Call GET /debug_token?input_token={TOKEN} with your app access token and read is_valid, expires_at, data_access_expires_at and scopes. For a one-off check, paste the token into Meta's Access Token Debugger.
Yes, if you treat them like passwords: encrypt them at rest, keep them out of logs and client code, and only use the App Secret and app tokens in server-to-server calls. Sign server calls with appsecret_proof.
Error 190 with subcode 492 means an invalid session: the user behind a Page access token no longer has a suitable role on the Page. Get a new Page token from a current admin.
No. Unipile is an independent company: it is not a Meta Partner, not an official Meta app, and it is not endorsed, sponsored or approved by Meta. Facebook is a trademark of Meta Platforms, Inc.
No. You call Unipile with your API key and the account_id of each connected user. Users link their Facebook account and the Pages they manage through Unipile's hosted authentication: no Meta app, App Secret or App Review on your side.
It is designed in line with the Digital Markets Act: each user connects their own account, and Unipile acts on their behalf without storing user profiles. More on our Digital Markets Act page.
Yes. Every connected account remains bound by Meta's Terms of Service. Use the API for legitimate scenarios such as customer support, CRM and direct conversations; spam and unauthorized automation can get accounts restricted.
Still have questions? Our team is here to help.
Talk to an expert
