TL;DR: For ads work you need a user access token with the
ads_readorads_managementpermission, or a system user token from your business portfolio. For a test, generate a user token in the Graph API Explorer: it lasts about 1 to 2 hours. Exchange it on your server, with your app ID and app secret, for a token of about 60 days. For software that runs on its own, create a system user in Meta Business Suite, assign it your ad account, then generate its token. A token stops working when it expires, when the person logs out or changes their password, or when someone revokes it. Meta then answers with error 190.
What you need: an app ID, an app secret and a token
People search for a Facebook API key, but Meta's guides for the Marketing API work with three other things. The app ID names your Meta app. The app secret shows in your App Dashboard, and Meta's login guide calls it the core of your app's security, so it stays on your server. The access token travels with every API call: Meta defines it as "an opaque string that identifies a user, app, or Facebook Page".
The five token types, and the two that fit ads work
Meta's access token guide names five types.
| Token type | What Meta says it does | For ads work? |
|---|---|---|
| User access token | Acting on a person's data on their behalf. It comes from a login dialog where the person grants your app permissions | Yes |
| System user access token | Automated actions on ad objects or Pages, with no app user present and no new login | Yes |
| Page access token | Reading and writing the data of a Facebook Page. You get it from a user token | Not for campaigns: it covers a Page |
| App access token | Reading and changing your app's settings. You make it from the app secret, server to server | No: it covers the app |
| Client token | Identifying your app inside native or desktop apps. Meta says client tokens are not secret, because they sit inside apps | No |
Whose ad accounts you work on decides between the first two. Meta's System Users page says system users represent "servers or software" that call the API on a business portfolio's assets. It adds that a system user token cannot tie an action to a real user of your software unless that person goes through Facebook Login.
- A script that runs your own business's ad accounts: a system user token.
- An app that works on ad accounts other people connect: a user token from Facebook Login.
Which permission the token needs
Meta's Marketing API authorization page names two permissions. ads_read reads ad reports. ads_management reads and manages ads, so creating a campaign needs it.
The same page sets a second condition: the access level your app has to these permissions. A business app gets standard access automatically, and that is enough if your app only manages your own ad account. If it manages other people's ad accounts, it needs advanced access, which Meta grants through App Review, one permission at a time.
Meta's page says these permission levels are not related to the Marketing API Access Tier, a feature with its own two tiers: Limited access and Full access. The Meta Ads API post covers that tier.
How to generate a token in the Graph API Explorer
You need a Meta app of your own first, because the Explorer asks you to pick one. The steps, from Meta's Graph API guides:
- Open the Graph API Explorer in Meta for Developers.
- In the Meta App dropdown, select your app.
- In the User or Page dropdown, choose Get User Access Token.
- In the right side panel, under Permissions, open Add a Permission and add
ads_readorads_management. - Click Generate Access Token and approve your app in the Facebook Login dialog.
- Click the information circle icon next to the token to see its details.
If you change the permissions afterwards, generate again: Meta's guide says a new scope needs a new token.
The Explorer token comes from a web login. Meta's access token guide says those tokens are short-lived, typically about 1 to 2 hours.
How to turn it into a 60-day token
Meta calls the result a long-lived token and says one "generally lasts about 60 days". The exchange is one call to the oauth/access_token endpoint with four values:
GET /oauth/access_token
?grant_type=fb_exchange_token
&client_id={app-id}
&client_secret={app-secret}
&fb_exchange_token={short-lived-token}
The answer holds the new token and expires_in, the number of seconds until it expires. Meta's sample shows 5183944 seconds, just under 60 days.
Make this call from your server. Meta's access token guide describes it as a server-side call with your app secret. Its login guide adds: "Your app secret should never end up in client code."
Do the exchange before the short-lived token expires. Meta's long-lived token page says you cannot use an expired token to request a long-lived one. Your app then has to send the person through the login flow again.
How to make a system user token
A system user is an account for software, owned by your business portfolio. The steps, as Meta numbers them in its Help Center article Add system users to your business portfolio:
- Go to Settings in Meta Business Suite.
- In the Users tab in the left sidebar, select System users.
- Click Add new system user.
- Give a name to the system user and click Create system user. Meta's developer guide says you also give it the Admin or Employee role in this window.
- Assign assets such as your Pages, ad accounts and catalogs. For ads work, assign the ad account the token has to reach.
- Click Generate new token.
- Select your app and your permissions, then click Generate token. Meta's developer guide says this window also asks you to choose when the token expires.
- Copy and save your token. Meta's reminder: "you can only share a token once".
The role decides what the token reaches. An Admin system user reaches every asset of the business portfolio by default, and Meta asks you to "carefully safeguard the admin system user token". An Employee system user reaches only the assets you assign to it in step 5. Meta says an Employee system user is enough when your app needs a few assets you own.
Does a system user token expire?
Meta's developer guide lists two kinds. A non-expiring token never expires. An expiring token stays valid for 60 days from the day you generate or refresh it.
Meta recommends the expiring kind and calls expiring tokens "a security best practice". Some businesses must use them. A refresh call returns a new token valid for another 60 days, and the old one keeps working until its own 60 days end.
How to check a token: the Access Token Debugger
Meta's Access Token Debugger shows detailed information for an access token. The debug_token endpoint returns the same data. In the sample answer on Meta's debugging page, four fields matter:
| Field | What it tells you |
|---|---|
type | The kind of token, such as USER |
expires_at | When the token expires |
is_valid | Whether the token works |
scopes | The permissions the token carries, such as ads_management |
A token without ads_management in its scopes cannot create a campaign.
Why a token stops working: error 190
Meta's error handling page gives code 190 the name "Access token has expired" and one fix: get a new access token. The subcode tells you why.
| Subcode | Meta's name | What happened | What to do |
|---|---|---|---|
| 458 | App Not Installed | The person has not logged into your app, or has not authorized it | Take them through login again |
| 460 | Password Changed | The person changed their password or logged out | They log in to your app again |
| 463 | Expired | The session or the token reached its end | Get a new token |
| 467 | Invalid Access Token | The token expired, someone revoked it, or another reason made it invalid | Get a new token |
With no subcode, Meta reads a 190 as a token that expired, that someone revoked, or that is otherwise invalid. Two expiries you can see coming: a long-lived user token at about 60 days, and an expiring system user token at 60 days without a refresh.
With Adsap there is no token to handle
Adsap connects to Meta with Facebook Login for Business. You log in at app.adsap.ai, open Settings, click Connect Meta, approve the permissions and pick your ad accounts. Adsap's server holds the token. When you work from Claude, ChatGPT or Perplexity through the Meta Ads MCP server, the assistant never sees it.
If Meta ends the connection, for example after you change your Facebook password or revoke the app's permissions, open Settings and click Reconnect. The steps are in the Meta Ads integration docs.
Frequently asked questions
For a test, open the Graph API Explorer, select your app, choose Get User Access Token, add the permissions you need and click Generate Access Token. For software that runs on its own, create a system user in Meta Business Suite under Settings, Users, System users, assign it your ad account, then generate its token.
Meta says short-lived tokens typically last about 1 to 2 hours and long-lived tokens about 60 days. An expiring system user token lasts 60 days from the day you generate or refresh it, and a non-expiring one never expires.
Only the expiring kind does. Meta offers non-expiring system user tokens and expiring ones valid for 60 days, and recommends the expiring kind as a security best practice.
Your access token no longer works. The subcode gives the reason: 458 for an app the person has not authorized, 460 for a changed password or a logout, 463 for an expired session and 467 for an invalid token. The fix is a new token.
Meta's guides use an app ID, an app secret and access tokens, and each API call carries an access token. If a tool asks for your Facebook API key, ask which of the three it means. The app secret stays on your server.
Sources
All Meta pages read on 30 November 2026.
- Meta for Developers, Access Tokens for Meta Technologies: the definition of an access token and the five token types. Also the 1 to 2 hours, the 60 days, web login tokens as short-lived and the server-side conversion. Also the Admin or Employee role in the Create system user window and what each role reaches. Also the expiry choice.
- Meta for Developers, Long-lived access tokens (Facebook Login): the 60 days, the
fb_exchange_tokencall with app ID and app secret, and the sampleexpires_in. Also the caveat on expired tokens and a new login. - Meta for Developers, Graph API Get Started: Generate Access Token, Add a Permission, the information icon and the new token after a change of scope.
- Meta for Developers, Facebook Login integration with Audience Network Reporting API V2: selecting the app and Get User Access Token in the Graph API Explorer.
- Meta for Developers, Graph API Explorer Guide: the User or Page dropdown.
- Meta for Developers, Marketing API Authorization:
ads_read,ads_management, standard access by default for business apps and advanced access through App Review. Also the note that these access levels are not related to the Marketing API Access Tier and its Limited and Full access. - Meta for Developers, System Users (Business Management APIs): what system users represent and the Facebook Login limit.
- Meta for Developers, Install Apps, Generate, Refresh, and Revoke Tokens: non-expiring and expiring system user tokens, the 60 days, the recommendation and the refresh.
- Meta Business Help Center, Add system users to your business portfolio: the 8 steps in Meta's order, including the asset step, and the one-time share of a token.
- Meta Business Help Center, About system users in Meta Business Suite: the advice to safeguard the admin system user token.
- Meta for Developers, Access Token Debugger: the tool shows detailed information for a token.
- Meta for Developers, Access Tokens: Debugging and Error Handling: the
debug_tokenfields and the sample errors for 458, 460 and 463. - Meta for Developers, Handle Errors (Graph API): code 190 and subcodes 458, 460, 463 and 467.
- Meta for Developers, Manually Build a Login Flow: the app secret as the core of your app's security, shown in the App Dashboard, and kept out of client code.
- Adsap: the Meta Ads MCP server page, the Meta Ads integration docs and the earlier post on the Meta Ads API.