Meta Ads Access Tokens: Types, Expiration & Renewal

Meta Ads and Graph API access-token types, expiration and revocation explained. Learn what each token is for, how to check validity, and how to reduce interruptions.

By Chris Pechau, Co-founder of AdAmigo.ai

·

For Meta Ads and the Graph API, there is no single universal “API key”: integrations use access tokens, and the right token depends on whether a request acts for a person, a Page, an app, or a business system user. This guide explains those token types, their lifetimes, and how to check whether a token is still valid. See Meta’s access-token documentation for the current definitions.

  • User Access Tokens: Short-lived (1–2 hours) and long-lived (about 60 days). These require regular refreshes.

  • Page Access Tokens: Obtained using a User Access Token. A long-lived Page token can have no expiration date, but may still be invalidated.

  • App Access Tokens: Used for app-level requests and generated server-side with your App Secret. Keep the secret out of client-side code.

  • System User Tokens: Used for automated actions on business assets. Meta lets you choose an expiration preference when generating one; it can still be invalidated.

Key risks: Tokens can expire on schedule or be invalidated early after certain security or authorization events. Monitor expiry and validity so you can respond to an API error before it interrupts an integration.

Solutions:

  • Manual renewal: Use Meta's tools for small-scale needs or follow a Meta Ads API key setup guide for manual configuration.

  • Automated scripts: Schedule token checks and renewals with cron jobs.

  • SaaS platforms: AdAmigo.ai supports multiple ad accounts in one workspace, account monitoring, and automated alerts; Meta's token-expiry and permission rules still apply.

Choose a token-management approach that fits your team, but do not assume every token can be renewed the same way. Track each token's type, expiry, and validity, and keep a route for reauthorization if Meta rejects a request.

Facebook Ads API - Preventing Your Access Token From Expiring

Meta API Key and Access Token Types




Meta API Token Types: Expiration Periods and Use Cases Comparison

Meta API Token Types: Expiration Periods and Use Cases Comparison

Meta provides a range of access tokens, each tailored for specific tasks and levels of permission. Knowing what each token does is essential for understanding their expiration rules and ensuring smooth functionality.

User Access Tokens

User Access Tokens are tied to individual Facebook or Instagram accounts, allowing apps to perform actions on behalf of a specific user. These tokens are created when a user logs in and grants permissions. They're great for tasks like retrieving ad performance data for third-party analysis or posting content in real time.

User tokens come in two forms: short-lived (lasting 1–2 hours) and long-lived (lasting about 60 days). To avoid disruptions, these tokens need to be refreshed regularly. While they can be transferred between client and server environments, Apple platforms limit their portability to servers. Keeping these tokens up to date is key to maintaining uninterrupted operations.

Page Access Tokens

Page Access Tokens are specifically designed for managing Facebook Pages. They enable actions like reading insights, publishing posts, and moderating comments. Each token is unique to a specific combination of Page, admin, and app, meaning you’ll need separate tokens for managing multiple Pages.

Meta documents a Page access token obtained from a long-lived User access token as having no expiration date, though it can still be invalidated under certain conditions. Do not assume that the originating User token's ordinary expiry automatically invalidates the Page token; check the Page token's own validity.

App Access Tokens and System User Tokens

App Access Tokens let you read or modify app settings. Generate them with your App ID and App Secret in a server-to-server call; never expose the App Secret or token in client-side code.

System User Tokens are used for automated actions on Ad objects or Pages without requiring input from an app user. As Meta explains:

A System User access token is used if your app performs programmatic, automated actions on your business clients' Ad objects or Pages without having to rely on input from an app user.

Meta’s token-generation flow asks you to choose an expiration preference. System User tokens can still be invalidated, so check their expiry and validity rather than treating them as permanent. Create them in Meta Business Manager.

Token Type

Lifespan

Primary Use Case

User Access Token

Short-lived or long-lived (as noted)

Real-time actions on behalf of a user

Page Access Token

Long-lived Page tokens have no expiry date; may still be invalidated

Managing Facebook Pages and insights

App Access Token

Check the token's expiry and validity

App settings and server-to-server calls

System User Token

Expiration preference chosen at generation; may be invalidated

Automated ad and Page management

How to Set Up a System User Access Token

Before you start, make sure you have admin access to your Meta Business Manager and a registered Meta app — you'll need both to create a system user and generate a token.

Here's the step-by-step process:

  1. Open Business Settings in your Meta Business Manager.

  2. Under Users, click System Users.

  3. Click + Add and give your system user a name.

  4. Assign a role — typically Admin or Employee, depending on the access level you need.

  5. Under Assign Assets, select the ad accounts, Pages, or other assets this system user should manage.

  6. Assign the app to the system user and grant Manage app permission. Reload Business Settings and confirm the system user has Full control of the app.

  7. Click Generate New Token, select your app, choose an expiration preference, and grant only the permissions (e.g., ads_management, ads_read) your integration needs.

  8. Copy the token immediately — Meta only shows it once.

A System User token lets your app automate actions without requiring input from an app user or repeated sign-in. Its expiration setting and permissions still matter, and Meta may invalidate it before any scheduled expiry.

Store the token somewhere secure right away: an environment variable, a secrets vault (like HashiCorp Vault or AWS Secrets Manager), or your platform's encrypted credential store. Never hard-code it in your scripts or commit it to version control.

When Meta API Keys Expire

Keeping track of when tokens expire - and what might cause them to be revoked early - is essential for smooth ad management. If you're not aware of your Meta API tokens' expiration timelines, you risk unexpected interruptions to campaigns, automation, and integrations. Each type of token has its own API key creation workflow and rules for expiration.

Standard Expiration Periods

  • Short-lived tokens: These expire quickly, usually within 1 to 2 hours of being generated.

  • Long-lived user access tokens: These generally last about 60 days. Meta's iOS, Android, and JavaScript SDKs can refresh tokens when the person has used the app within the previous 90 days; without requests, a long-lived token expires after about 60 days.

  • Page access tokens: Meta documents Page tokens obtained from long-lived User tokens as having no expiration date. They can still be invalidated under certain conditions, so check their validity instead of assuming they are permanent. See Meta's long-lived token guidance.

  • System user tokens: Meta's current generation flow asks you to choose an expiration preference. They support automated actions on Ad objects or Pages without input from an app user, but may still be invalidated; check each token's validity and expiry.

Even with these standard durations, tokens can sometimes expire earlier than expected. Several actions can trigger this, as outlined below.

What Triggers Expiration and Revocation

Tokens, regardless of their lifespan, can become invalid unexpectedly. Here's what you should watch out for:

  • Password changes or logout: Meta lists a password change or logout as a reason a User access token can become invalid. The person must log in again to get a valid token for requests on their behalf.

  • User de-authorization: When a person removes an app's permissions, the app can no longer use that person's authorization for the affected requests. The person may need to log in and grant the required permission again.

  • Security events: Meta warns that security-related events can invalidate access tokens before their expected expiration. Check the validity of each token rather than assuming an app-level change affects every token type in the same way.

  • Expiry and validity checks: Meta's token debugger reports whether a token is valid and includes expiry details. Track the returned expiry fields and handle API errors; when a User token is expired or invalid, the person may need to log in again. See Meta API integration best practices for a monitoring approach.

How to Manage Meta API Keys

Keeping your API keys in check is crucial for uninterrupted ad campaign performance. You can approach this through manual methods, automated scripts, or by using SaaS platforms. The right choice will depend on your resources and the scale of your operations.

Manual vs. Automated Renewal Methods

Manual renewal involves logging into Meta's API Explorer or app dashboard to generate and update tokens yourself. While this might work for small projects or testing, it becomes a headache as your needs grow. Timing mistakes and human errors in handling credentials are common with this method.

Automated monitoring can run on a schedule to check stored expiry data and token status. Meta documents a server-side exchange from a valid short-lived User token to a long-lived User token; an expired token must go through the login flow again. Do not assume one Graph API renewal request works for every token type. Log checks and supported exchanges, and handle API errors and request limits; see Meta's long-lived User token steps and Meta API rate limits.

SaaS platforms like AdAmigo.ai give teams a shared workspace for ad-account management. AdAmigo.ai supports multiple ad accounts in one workspace, account monitoring, and automated alerts. For token expiry and renewal, follow Meta's token-specific flows; account monitoring does not change Meta's expiry or revocation rules.

Feature

Manual Renewal

Automated Scripts (Cron)

SaaS Platforms (AdAmigo.ai)

Effort Level

Repeat checks and updates

Build and maintain code

Setup varies by account

Reliability

Depends on check frequency

Depends on monitoring and error handling

Monitoring and alerts available

Scalability

More accounts mean more manual checks

Adapt code to the workflow

Multiple accounts in one workspace

Security

Keep secrets out of shared files

Protect stored credentials

Review provider access controls

Rate Limit Mgmt

Follow Meta's current limits

Handle rate-limit errors in code

Check the service's documentation

Regardless of your method, regular monitoring is essential to avoid disruptions.

Monitoring Expiration Dates and Setting Up Alerts

Staying on top of token expiration is key to smooth operations. Set up a system to track token creation, type, and expiration dates. Logging each renewal and creating alerts for upcoming expirations or failures can save you from last-minute scrambles.

For scheduled checks, log token status and responses from supported exchanges, but never write raw token values to logs. You can use a workflow tool such as n8n to schedule monitoring; keep any token-exchange step specific to the token type and Meta's documented flow.

AdAmigo.ai supports ad-account monitoring and automated alerts. These features can surface account issues, but use Meta's token debugger and API responses to check a token's expiry and validity.

Using AdAmigo.ai for API Key Management




AdAmigo.ai

AdAmigo.ai is an AI media-buying platform for Meta and Google Ads. It supports multiple ad accounts in one workspace, with account monitoring and automated alerts.

AdAmigo.ai's monitoring and alerts can help teams keep track of connected ad accounts. They do not change Meta's token permissions or expiry rules: check token status in Meta's debugger and follow the appropriate login or reauthorization flow when a token becomes invalid.

AdAmigo.ai brings creative development, campaign building and launch, daily budget and targeting optimization, account monitoring, and automated alerts into a workspace that supports multiple ad accounts. Meta still controls token issuance and validity, so use token-specific checks for integration issues.

How to Renew Meta API Keys

Meta does not use one renewal procedure for every token. A valid short-lived User token can be exchanged server-side for a long-lived User token; if it has expired, the person must log in again. For Page and System User tokens, check their own expiry and validity, and follow the documented flow for that token type.

Converting Short-Lived Tokens to Long-Lived Tokens

Short-lived User access tokens expire in just 1 to 2 hours, which makes them unsuitable for ongoing operations. To avoid interruptions, you can convert these to long-lived tokens that last about 60 days.

  • Check the token: Use Meta's Access Token Debugger to inspect its status. To exchange a valid short-lived User token, use Meta's documented server-side flow; the debugger does not make an expired token usable again.

  • Programmatic Conversion: For a more automated approach, send a server-side GET request to Meta's Graph API. You'll need your App ID, App Secret, and the short-lived token. Make sure this request is server-side to keep your App Secret secure.

Here’s the format for the GET request:

GET https://graph.facebook.com/{graph-api-version}/oauth/access_token?
    grant_type=fb_exchange_token&
    client_id={app-id}&
    client_secret={app-secret}&
    fb_exchange_token={short-lived-token}

Meta will respond with a JSON object containing a new access_token and its expires_in value (in seconds). Important: If your token has already expired, you’ll need the user to log in again, as expired tokens cannot be converted.

Getting Long-Lived Page Access Tokens

Meta documents a Page access token obtained from a long-lived User access token as having no expiration date. It can still be invalidated under certain conditions, so treat it as long-lived rather than immune to revocation. To obtain one, start with a valid long-lived User token for someone who has a role on the Page.

Once you have the User token, use the following request to retrieve a page-specific token:

GET https://graph.facebook.com/{graph-api-version}/{user-id}/accounts?
    access_token={long-lived-user-access-token}

The response includes a Page access_token. Use Meta's token debugger guidance to inspect expires_at, data_access_expires_at, and is_valid. Meta notes that tokens can be invalidated before their expected expiration.

Automating Renewals with Scripts and Cron Jobs

A scheduled script can check token status and expiry fields, log API errors, and alert someone to reauthorize when needed. Use the server-side exchange only for a valid short-lived User token as Meta documents; do not assume that a Page, App, or System User token can be renewed through the same request.

To automate this, schedule your scripts with cron jobs. For instance, you could set a daily check at 8:00 AM using the following cron expression:

0 8 * * * /path/to/script.sh

When writing Bash scripts, tools like jq can parse API responses for status and expiry fields. Keep secret values out of logs and handle errors that require a user to log in again.

AdAmigo.ai offers ad-account monitoring and automated alerts. These can help surface account issues, but they do not replace Meta's token-expiry checks or reauthorization when a token is invalidated.

Conclusion

Meta API key expiration policies are more than just a technical formality - they directly impact the smooth operation of your ad campaigns. Overlooking token expirations can lead to failed integrations, stalled optimizations, and costly downtime.

To avoid these pitfalls, managing tokens effectively is a must. Fortunately, there are multiple ways to stay ahead of expirations. Whether you opt for manual token conversions using server-side API calls, programmatic exchanges via the Graph API, or automated scripts scheduled with cron jobs, the key is to monitor expiration dates closely and act before trouble strikes.

For teams managing multiple ad accounts, AdAmigo.ai supports several accounts in one workspace and automated alerts and account monitoring. If you use AdAmigo.ai or another platform alongside a Meta integration, monitoring can help surface account issues, but it does not change Meta’s token-expiration or revocation rules. Choose a token that matches the assets and permissions your app needs, set an appropriate expiration preference, and monitor validity; even a token with no time-based expiration can still be invalidated.

Effective API key management goes beyond just renewals. Automating these processes not only saves your team from repetitive tasks but also supports proactive compliance with Meta's policies. By avoiding Meta ad rejections by scanning campaigns for potential violations, you can reduce the risk of account bans or ad rejections - issues that could jeopardize your tokens and disrupt your advertising efforts.

FAQs

Which Meta token type should I use for production automation?

A system user access token can suit automation that acts on Ad objects or Pages without input from an app user. Choose the expiration preference and only the permissions your integration needs, then monitor validity because tokens can still be invalidated.

How can I check if a token was revoked before it expires?

Meta's token debugger guidance describes the debug_token endpoint and the is_valid, expires_at, and data_access_expires_at fields. Meta may not notify you when a token becomes invalid, so check status and handle API errors.

What’s the safest way to store and refresh Meta tokens on a server?

Keep tokens out of source code and client-side bundles. Environment variables can keep secrets out of source files, but they do not by themselves control who can access the host or process; restrict that access or use an access-controlled secrets manager. A valid short-lived User token can be exchanged server-side for a long-lived token. If a token is expired or invalid, the person may need to log in again rather than relying on a generic refresh request.

Related Blog Posts

Chris Pechau

Co-founder of AdAmigo.ai

Chris Pechau has run and overseen more than $300M in ad spend and trained over three dozen media buyers. As VP of Growth, he helped grow an ad tech company to a high eight-figure valuation. Today he is the co-founder of AdAmigo.ai, the AI ad agent that runs paid ads for brands and agencies.