Guides
Accounts and Pages
Business Manager, owned and client ad accounts, account status, creating accounts, and Pages with Page access tokens.
After login, the application discovers what the user can use: the Business Managers, the ad accounts and the Pages. Campaigns, creatives and Insights come from an ad account (act_{id}); ads are published on a Page, and lead forms live there.
User ─────┬── Business Manager ──┬── owned accounts (owned_ad_accounts)
│ ├── client accounts (client_ad_accounts)
│ └── Pages (owned_pages)
├── /me/adaccounts (accounts where the user has a role)
└── /me/accounts (Pages with a Page access token)Business Manager
curl --url 'https://meta-ads.mimicr.dev/v27.0/me/businesses?fields=id,name' \ --header 'Authorization: Bearer <token>'
{ "data": [{ "id": "842989790016191", "name": "BM Meta Ads QA" }], "paging": { "cursors": { "before": "MAZDZD", "after": "MAZDZD" } } }Requires business_management. The no_business persona gets data: [], and so does no_accounts.
Ad accounts
curl --url 'https://meta-ads.mimicr.dev/v27.0/me/adaccounts?fields=id,name,currency,timezone_name,account_status&limit=200' \ --header 'Authorization: Bearer <token>'
{
"data": [
{ "id": "act_100539998049706", "name": "Meta Ads QA (principal)", "currency": "BRL", "timezone_name": "America/Sao_Paulo", "account_status": 1 },
{ "id": "act_100539998049707", "name": "Meta Ads QA (desativada)", "currency": "BRL", "timezone_name": "America/Sao_Paulo", "account_status": 2 }
],
"paging": { "cursors": { "before": "MAZDZD", "after": "MQZDZD" } }
}Only the accounts the person left checked in the dialog come back. With a Business Manager, complete the list with owned_ad_accounts and client_ad_accounts and follow paging.next to the end.
account_status says whether the account can run ads:
| Value | Meaning | In Mimicr |
|---|---|---|
1 | ACTIVE | Normal delivery |
2 | DISABLED | Reads work; writes answer (#200) The ad account is disabled |
3 | UNSETTLED | Pending billing: ads in PENDING_BILLING_INFO, no delivery |
7, 8 | PENDING_RISK_REVIEW, PENDING_SETTLEMENT | |
9 | IN_GRACE_PERIOD | Normal delivery |
100, 101 | PENDING_CLOSURE, CLOSED | 101 blocks writes like 2 |
201, 202 | ANY_ACTIVE, ANY_CLOSED | Filter values |
Change the status with the account.set_status action, and simulate billing with account.billing_failure and account.billing_restore.
To read an account:
curl --url 'https://meta-ads.mimicr.dev/v27.0/act_100539998049706?fields=id,name,account_status,currency,timezone_id,timezone_name,amount_spent,spend_cap,business{id,name}' \
--header 'Authorization: Bearer <token>'amount_spent comes from the same delivery model as Insights. POST /act_{id} changes name and spend_cap (up to 10 cap changes per day, then 17/1885172).
Create an account
curl -s "https://meta-ads.mimicr.dev/v27.0/842989790016191/adaccount" \ -H 'Authorization: Bearer <token>' \ -F name='Loja Centro' -F currency=BRL -F timezone_id=25 \ -F end_advertiser=NONE -F media_agency=NONE -F partner=NONE
{ "id": "act_100539998049711", "account_id": "100539998049711", "business_id": "842989790016191", "end_advertiser_id": "NONE", "media_agency_id": "NONE", "partner_id": "NONE" }Requires business_management and ads_management. In Mimicr, the Business Manager accepts up to maxAdAccounts owned accounts (default 5, counting the two initial ones); after that, or with [limite-contas] in the name, the response is 3979. An invalid currency answers 2607. The new account already has a payment method, unless you turn on requirePaymentMethod.
Pages
curl --url 'https://meta-ads.mimicr.dev/v27.0/me/accounts?fields=id,name,picture{url},access_token,tasks&limit=100' \
--header 'Authorization: Bearer <token>'Each Page comes with a Page access_token. Store it: lead forms, test leads and installing the app on the Page (subscribed_apps) require the Page access token, and without it the response is (#210) A page access token is required. Page access tokens derived from a long-lived user token don't expire.
To find out whether a Page can have click-to-WhatsApp ads:
curl --url 'https://meta-ads.mimicr.dev/v27.0/100539998049709?fields=id,name,whatsapp_number,has_whatsapp_number' \ --header 'Authorization: Bearer <token>'
In Mimicr, the first Page gets the number of the linked WhatsApp sandbox (see Click-to-WhatsApp). The second never has WhatsApp, which is useful for testing error 2446880.