
Meta Ads API Key & Access Token Creation Workflow
Learn to generate Meta Ads API keys and access tokens: set up your developer app, configure API permissions, and create system user tokens for ad automation.
TL;DR
Meta doesn't issue permanent "API keys" — it issues access tokens that authenticate your app to the Marketing API. This guide walks through the complete workflow: setting up your Meta developer app, configuring permissions (including the May 2026 Marketing API Access Tier update), passing App Review, and generating the right token for your use case — whether you're testing with a short-lived user token or running production automation with a System User token.
The Truth About Meta Ads "API Keys"
If you've been searching for how to create a Meta Ads API key, here's the first thing to understand: Meta doesn't issue permanent API keys. What the platform provides are access tokens — time-bound credentials that grant your application permission to interact with the Meta Marketing API. The terms "API key" and "access token" are used interchangeably across the industry, and Google treats them as the same intent: this page ranks for both. But knowing the distinction matters when you're setting up a production integration, because access tokens behave differently from traditional API keys — they expire, they're tied to specific permissions, and the way you generate them depends on whether you're building a one-off script or an always-on automation platform.
With over 8 million active advertisers on Meta's platforms, programmatic access to the Marketing API is how agencies and brands scale ad operations beyond what any human media buyer can manage manually. Whether you're connecting a third-party analytics tool, building a custom dashboard, or integrating with an AI-powered platform like AdAmigo.ai, the workflow starts the same way: a properly configured developer app and the right access token for the job. If you haven't yet created your developer account, start with the Meta Ads API key setup guide for a foundation before diving into token generation.
Prerequisites Checklist
Before you touch a token, make sure you have these four things ready. Missing any one will block you mid-workflow — and App Review alone can take several days.
Meta Developer Account: Separate from your personal Facebook account. Create one at developers.facebook.com.
Active Meta Ad Account: Must be in good standing, with billing configured and at least one campaign that's spent budget. You need an ad account ID to test API calls.
Facebook Business Manager Account: Central hub for organizing ad accounts, Pages, and permissions. Your developer app must be associated with it for production use.
Admin Access: You need admin-level permissions on both the Business Manager and the ad account you're connecting to. Without it, you can't generate tokens or assign system users.
If you're planning to use Full Access permissions or programmatic ad account creation, business verification is also required. Budget at least 3–5 business days for that review.
Setting Up Your Meta Developer App
The developer app is your application's identity inside Meta's ecosystem — it determines which APIs you can call and what permissions you can request.
Log into your Meta Developer account and start the app creation process. During setup, you'll select a use case that describes how your app interacts with Meta's platform. Meta defines this as:
A use case is the primary way your app will interact with Meta and determines which APIs, features, permissions, and products are available to your app.
Choose the use case that matches your advertising and marketing goals. Once created, your app receives a unique App ID — this identifier is essential for every API call you'll make and for scaling your integration as your needs grow.
Critical step: Navigate to your app's product settings and explicitly enable the Marketing API product. Without this, none of the advertising endpoints work — regardless of what permissions you configure later. After your app is created, follow Meta API configuration best practices to keep your setup clean as you add more capabilities.
Configuring Permissions
Permissions define exactly what your app can do inside an ad account. For the Marketing API, three permissions matter most:
Permission | What It Grants |
|---|---|
| Read access to campaign data, performance metrics, and ad account details |
| Full control: create campaigns, edit ads, manage budgets, adjust targeting |
| Programmatic ad account creation, Business Manager-level operations |
For a basic integration that pulls reports, ads_read is enough. For automated campaign management, you need ads_management. For platforms that create and manage ad accounts programmatically — like AdAmigo.ai's agency workflows — business_management at Full Access is also required. See the API key permissions guide for a complete breakdown of every permission level.
The May 2026 Marketing API Access Tier Update
On May 4, 2026, Meta renamed "Ads Management Standard Access" (AMSA) to the Marketing API Access Tier and restructured it into two levels:
Limited Access: The entry-level tier. Your app can make Marketing API calls, but with stricter rate limits. This replaces the old "Standard Access" label. Requirements: a verified Business Manager and a live app with the Marketing API product enabled.
Full Access: The upper tier. Higher rate limits and access to more endpoints. To qualify, your app must have made at least 500 Marketing API calls in the past 15 days with an error rate below 15% across the last 500 calls. This was lowered from the previous 1,500-call threshold — a change that makes Full Access more attainable for smaller integrations.
This is a fresh change that most guides haven't incorporated yet. If you're reading about "Standard Access" and "Advanced Access" in the context of the Marketing API, those terms are now outdated as of May 2026. Apps with Full Access also receive long-lived tokens that do not expire based on time — though they can still be invalidated for other reasons, such as password changes or security reviews.
App Review and Business Verification
For Limited Access, your app needs to be in Live mode (not Development mode) and associated with a verified Business Manager. For Full Access — or any permission that requires Advanced-level capabilities — you'll need to pass App Review.
App Review is Meta's gate for production-grade API access. You'll submit:
A description of how your app uses each requested permission
A screen recording showing the permission in action within your app
Business verification documents (if not already verified)
As Sự Phạm Tiến explains on Stack Overflow:
You need to have Advanced Access to business_management permission. You can submit app review for advanced access, if it approved, you can call /bm-id/adaccount to create ad account with required parameter.
Plan for App Review to take 3–7 business days. Set your app to Live mode as soon as it's approved — Development mode restricts API access and breaks attribution tracking. Understanding Meta Ads attribution rules is essential for interpreting the data your API calls return.
How to Generate Your Meta Ads Access Token
With your app configured and permissions in place, you're ready to generate a token. The method depends on your use case. Meta's token lifecycle progresses through three stages — here's how to generate each.
User Access Tokens (via Graph API Explorer)
User access tokens are the quickest to generate and ideal for testing, development, and one-off API calls. To create one:
Open the Graph API Explorer.
Select your app and the API version you're targeting in the dropdown menus.
Click "Generate Access Token" — Meta prompts you to log in and grant permissions.
Select the permissions your integration needs: at minimum
ads_readfor reporting orads_managementfor campaign control. The token appears immediately after authentication.
Short-lived user tokens expire in about 1–2 hours. They're fine for exploring the API, but not for anything that needs to run unattended.
Long-Lived Tokens (Exchange Your Short-Term Token)
To extend a short-lived user token to a ~60-day lifespan, exchange it through Meta's OAuth endpoint:
The response returns a long-lived token valid for approximately 60 days. This is a solid choice for internal dashboards and scripts, but it's still tied to an individual user — if that user changes their password or leaves the organization, the token becomes invalid.
System User Tokens (for Production Automation)
For always-on, production-grade automation — the kind AdAmigo.ai and similar platforms depend on — System User tokens are the right credential. They're tied to your Business Manager, not an individual, so they survive personnel changes and don't expire based on time when your app has Full Access to the Marketing API.
To generate a System User access token:
In Business Manager, navigate to Users > System Users.
Create a new System User or select an existing one. Assign it the Admin role on the assets it needs: your app, ad accounts, Pages, catalogs, and Pixels.
Under the System User's settings, click "Generate Token".
Select your developer app and the permissions to include —
ads_readandads_managementat minimum.Copy the token immediately. It won't be displayed again.
System User tokens are what make multi-account ad automation viable. A single System User can hold tokens for multiple ad accounts, and platforms like AdAmigo.ai use them to manage campaigns, optimize budgets, and refresh creatives across client portfolios without interruption.
Token Type Comparison
Token Type | Lifespan | Best For | Generation Method |
|---|---|---|---|
Short-Lived User Token | ~1–2 hours | Testing, exploration, one-off scripts | Graph API Explorer |
Long-Lived User Token | ~60 days | Internal dashboards, personal scripts | OAuth exchange endpoint |
System User Token | Non-expiring (Full Access) | Production automation, agency platforms, always-on integrations | Business Manager > System Users |
Managing Token Storage, Rotation, and Security
Once you have a token, securing it is as important as generating it. A leaked access token with ads_management permission gives an attacker full control over your ad accounts.
Storage: Never hardcode tokens into your application source code or commit them to version control. Use environment variables for local development and a secrets manager — AWS Secrets Manager, Azure Key Vault, or HashiCorp Vault — for production. If you're using a platform like AdAmigo.ai, verify that it stores credentials with industry-standard encryption.
Rotation: Even long-lived tokens should be rotated on a schedule — every 60–90 days is a common cadence. If you suspect a token has been exposed, revoke it immediately through Business Manager. If you encounter issues during rotation, the Meta API key error fixes guide covers the most common failure points.
Monitoring: Set up alerts for token expiration — a System User token doesn't expire on a timer, but it can still be invalidated if Meta runs a security review or if associated assets change. For long-lived user tokens, schedule reminders at least a week before the 60-day mark, and use the token expiration policies as your reference to avoid surprises.
Principle of Least Privilege: Grant only the permissions your integration actually needs. If your tool only reads campaign data, ads_read is enough — don't add ads_management. Every additional permission expands the blast radius if a token is compromised.
Using Your Access Token with Automation Platforms
After securing your token, the real value of the Marketing API becomes clear: programmatic campaign management that works around the clock. The API, built on Meta's Graph API, accepts standard HTTP requests from any language with an HTTP library — Python, Node.js, PHP, or even cURL.
For most teams, building and maintaining a custom API integration isn't the best use of engineering time. Platforms like AdAmigo.ai connect to your ad account in about five minutes using the ads_management and ads_read permissions you've already configured. The platform then handles:
Creative generation: AI-designed ad creatives built from your brand identity, launched with one click
24/7 optimization: Continuous bid, budget, and audience adjustments based on real-time performance data
Anomaly detection: Automatic flagging of spend spikes, performance drops, and budget inefficiencies
Bulk operations: Launch dozens or hundreds of ads with tailored copy and targeting directly from Google Drive
For agencies, this changes the economics: one media buyer can manage 4–8× more clients when automation handles execution. The platform operates within the budget, pacing, and placement constraints you define — full automation or semi-automated with approval gates, depending on your preference.
The token you generated makes all of this possible. Without a properly configured System User token, no automation platform can access your ad accounts. With it, AI-driven campaign optimization becomes a practical reality rather than a future goal.
Steps for Success
Clarify the terminology: Meta issues access tokens, not permanent API keys. Understanding this distinction helps you pick the right token type from the start.
Complete the prerequisites first: Developer account, ad account, Business Manager, admin access. App Review takes days — start early.
Choose your token type deliberately: Short-lived for testing, long-lived for internal tools, System User for production automation.
Stay current with Meta's tier system: The May 2026 Marketing API Access Tier rename (Limited Access / Full Access) replaced the old Standard/Advanced Access terminology.
Secure every token: Environment variables for development, a secrets manager for production, rotation on a schedule, and monitoring for anomalies.
Let automation do the heavy lifting: Once your token is in place, platforms like AdAmigo.ai handle the repetitive work so you can focus on strategy and growth.
FAQs
What steps should I take to securely store and manage Meta Ads API keys?
Store tokens in environment variables or an encrypted secrets manager — never in source code or version control. Restrict access to only the people and systems that need it. Rotate tokens every 60–90 days and maintain an audit trail of who accessed what. Set up monitoring alerts for unusual API activity and tokens nearing expiration. If a token is compromised, revoke it immediately through Business Manager and issue a replacement.
What's the difference between long-term and short-term tokens, and when should you use each?
Short-lived tokens last about 1–2 hours and are ideal for testing and development. Long-lived tokens last approximately 60 days and work well for internal dashboards and scripts. For production automation that needs to run continuously without re-authentication, System User tokens are the right choice — they don't expire based on time when your app has Full Access to the Marketing API.
Do Meta Ads API tokens expire, and how do I handle renewal?
Yes, with nuances. Short-lived user tokens expire in 1–2 hours. Long-lived user tokens expire after ~60 days — exchange them through the OAuth endpoint before they lapse. System User tokens with Full Access don't expire on a timer, but they can be invalidated by password changes, security reviews, or permission revocations. Automate renewal where possible and set up monitoring alerts well before expiration dates.
What are the advantages of using automation tools like AdAmigo.ai with Meta Ads API access?
Automation platforms use your access token to handle time-consuming tasks — creative generation, audience targeting, bid optimization, and 24/7 performance monitoring — freeing marketers to focus on strategy. AI-powered platforms adapt in real time to performance data, delivering better ROAS than static rules-based systems. For agencies, this means one media buyer can manage significantly more clients without additional headcount.