API Reference
Facebook LoginGETLogin dialog
Ad sets

Update an ad set

POST/v27.0/{adset_id}
Base URL: https://meta-ads.mimicr.dev · provider: https://graph.facebook.com

Updates an ad set or changes its status. The budget can change at most 4 times per hour per ad set (613/1487632); send it only when it changes. Switching between daily and lifetime budget returns 100/1487046, and start_time can't change after the start (100/1487101). Status rules: ARCHIVED can only go to DELETED; a DELETED object only accepts a new name. Pausing or archiving a parent makes its children inherit CAMPAIGN_PAUSED/ADSET_PAUSED/ARCHIVED/DELETED. Requires ads_management and a role on the ad account. Disabled or closed accounts (status 2, 101) answer (#200) The ad account is disabled.

Authorization

Bearer token in the Authorization: Bearer <token> header. See Authentication.

Path parameters

adset_idstringrequired

ID of the ad set.

Example: "120200539998049713"

Body

application/x-www-form-urlencoded
namestring

Name of the ad set, up to 400 characters. [sem-entrega] in the name keeps it from delivering (Mimicr trigger).

statusstring

ACTIVE, PAUSED, ARCHIVED or DELETED.

ACTIVEPAUSEDARCHIVEDDELETED
billing_eventstring

What you pay for. Click-to-WhatsApp requires IMPRESSIONS.

APP_INSTALLSCLICKSIMPRESSIONSLINK_CLICKSLISTING_INTERACTIONNONEOFFER_CLAIMSPAGE_LIKESPOST_ENGAGEMENTPURCHASETHRUPLAY
optimization_goalstring

What delivery optimizes for. Must fit the objective: ENGAGEMENT → CONVERSATIONS, LINK_CLICKS; TRAFFIC → LINK_CLICKS, LANDING_PAGE_VIEWS, REACH, …; LEADS → LEAD_GENERATION, QUALITY_LEAD, CONVERSATIONS; otherwise 100/2490408.

33 values
ADVERTISER_SILOED_VALUEAD_RECALL_LIFTAPP_INSTALLSAPP_INSTALLS_AND_OFFSITE_CONVERSIONSAUTOMATIC_OBJECTIVECONVERSATIONSDERIVED_EVENTSENGAGED_PAGE_VIEWSENGAGED_USERSEVENT_RESPONSESIMPRESSIONSIN_APP_VALUELANDING_PAGE_VIEWSLEAD_GENERATIONLINK_CLICKSMEANINGFUL_CALL_ATTEMPTMESSAGING_APPOINTMENT_CONVERSIONMESSAGING_DEEP_CONVERSATION_AND_FOLLOWMESSAGING_PURCHASE_CONVERSIONNONEOFFSITE_CONVERSIONSPAGE_LIKESPOST_ENGAGEMENTPROFILE_AND_PAGE_ENGAGEMENTPROFILE_VISITQUALITY_CALLQUALITY_LEADREACHREMINDERS_SETSUBSCRIBERSTHRUPLAYVALUEVISIT_INSTAGRAM_PROFILE
bid_strategystring

Bid strategy. LOWEST_COST_WITH_BID_CAP and COST_CAP need bid_amount.

COST_CAPLOWEST_COST_WITHOUT_CAPLOWEST_COST_WITH_BID_CAPLOWEST_COST_WITH_MIN_ROAS
bid_amountinteger

Bid in the minor unit.

daily_budgetinteger

Daily budget in the minor unit; only for ad sets that run more than 24 h. Below the minimum for the goal returns 100/1885272 (sandbox minimums: R$ 1.00 impressions/reach, R$ 2.50 clicks, R$ 5.00 conversations/leads).

lifetime_budgetinteger

Lifetime budget in the minor unit; requires end_time (100/1487171).

start_timestring<date-time>

New start time; only while the ad set hasn't started (100/1487101).

end_timestring<date-time>

End time; 0 for ongoing daily-budget ad sets. In the past returns 1487033.

destination_typestring

WHATSAPP for click-to-WhatsApp (needs promoted_object.page_id with a WhatsApp number, else 100/2446880), WEBSITE, ON_AD for lead forms, …

23 values
APPAPPLINKS_AUTOMATICFACEBOOKFACEBOOK_LIVEFACEBOOK_PAGEIMAGINEINSTAGRAM_DIRECTINSTAGRAM_LIVEINSTAGRAM_PROFILEINSTAGRAM_PROFILE_AND_FACEBOOK_PAGEMESSAGING_INSTAGRAM_DIRECT_MESSENGERMESSAGING_INSTAGRAM_DIRECT_MESSENGER_WHATSAPPMESSAGING_INSTAGRAM_DIRECT_WHATSAPPMESSAGING_MESSENGER_WHATSAPPMESSENGERON_ADON_EVENTON_PAGEON_POSTON_VIDEOSHOP_AUTOMATICWEBSITEWHATSAPP
promoted_objectobject

Promoted object: {page_id, whatsapp_phone_number} for WhatsApp, {page_id} for leads, {pixel_id, custom_event_type} for conversions.

Show child attributes
page_idstring

ID of the Page. Required for WhatsApp and lead generation ad sets.

whatsapp_phone_numberstring

WhatsApp number (digits) the ads open a chat with. Must be the Page's number.

whats_app_business_phone_number_idstring

Phone number ID of the WhatsApp Business account.

pixel_idstring

ID of the dataset (pixel) for conversion optimization.

custom_event_typestring

Conversion event to optimize for (PURCHASE, LEAD, …).

29 values
ACHIEVEMENT_UNLOCKEDADD_PAYMENT_INFOADD_TO_CARTADD_TO_WISHLISTAD_IMPRESSIONCOMPLETE_REGISTRATIONCONTACTCONTENT_VIEWCUSTOMIZE_PRODUCTD2_RETENTIOND7_RETENTIONDONATEFIND_LOCATIONINITIATED_CHECKOUTLEADLEVEL_ACHIEVEDLISTING_INTERACTIONMESSAGING_CONVERSATION_STARTED_7DOTHERPURCHASERATESCHEDULESEARCHSERVICE_BOOKING_REQUESTSPENT_CREDITSSTART_TRIALSUBMIT_APPLICATIONSUBSCRIBETUTORIAL_COMPLETION
application_idstring

ID of the app for app promotion.

targetingobject

Audience. geo_locations is required (100/1487079).

Show child attributes
geo_locationsobject

Locations to target. Required.

Show child attributes
countriesstring[]

ISO-2 country codes.

regionsobject[]

Regions as {key}.

citiesobject[]

Cities as {key, radius, distance_unit}; radius 10–50 mi or 17–80 km.

custom_locationsobject[]

Points with a radius: {latitude, longitude, radius, distance_unit} or {address_string, radius}; radius 1–80 km or 0.63–50 mi; up to 200 items.

Show child attributes
latitudenumber

Latitude of the point.

longitudenumber

Longitude of the point.

radiusnumber

Radius around the point.

distance_unitstring

kilometer or mile (default).

address_stringstring

Address, instead of coordinates.

location_typesstring[]

home and/or recent.

age_mininteger

Minimum age, 13 or more (default 18). With Advantage+ audience only 18 to 25.

age_maxinteger

Maximum age, up to 65.

gendersinteger[]

[1] men, [2] women. Omit for all.

targeting_automationobject

Advantage+ audience settings.

Show child attributes
advantage_audienceinteger

1 lets Meta expand the audience (Advantage+ audience), 0 keeps it. Must be set explicitly on create when the audience is constrained.

individual_settingobject

Per-dimension automation settings (age, gender, device).

publisher_platformsstring[]

Platforms: facebook, instagram, messenger, audience_network.

facebook_positionsstring[]

Facebook placements.

instagram_positionsstring[]

Instagram placements.

messenger_positionsstring[]

Messenger placements. story is dropped since v26.0.

device_platformsstring[]

mobile and/or desktop.

connected_tvdesktopmobile
flexible_specobject[]

Detailed targeting. In Mimicr it is stored, not resolved.

exclusionsobject

Excluded detailed targeting. Stored, not resolved.

custom_audiencesobject[]

Custom audiences. Custom audiences are not simulated (501).

interestsobject[]

Interests. Stored, not resolved.

pacing_typestring[]

["standard"] or ["day_parting"] with adset_schedule.

adset_scheduleobject[]

Day parting; lifetime budget only (100/1487201).

Show child attributes
start_minuteinteger

Start minute of the day (0–1439), on the hour.

end_minuteinteger

End minute of the day; 1440 is the end of the day.

daysinteger[]

Days of the week, 0 (Sunday) to 6.

timezone_typestring

USER or ADVERTISER.

is_adset_budget_sharing_enabledboolean

Stored.

daily_min_spend_targetinteger

Stored.

meta_moment_maker_specobject

Refused since v27.0 (version error).

execution_optionsstring[]

["validate_only"] runs every validation and returns {"success":true} without writing.

validate_only

Responses

200OK.
successbooleanrequired

true when the change was applied.

400Error in the Graph envelope: 613/1487632 budget changed more than 4 times in an hour, 100/1487101 start time of a started ad set, 100/1487056 deleted ad set.
errorobjectrequired
Show child attributes
messagestringrequired

Description of the error.

Example: "(#100) The parameter special_ad_categories is required"
typestringrequired

OAuthException for most codes (the Marketing API uses it for validation too), GraphMethodException for unknown objects, FacebookApiException for transient errors. In Mimicr, routes outside the integration core answer MimicrNotSimulated with HTTP 501.

Example: "OAuthException"
codeintegerrequired

Error code (100 invalid parameter, 190 invalid token, 200 permission, 2635 deprecated version, 613/17/80004 rate limits, …).

Example: 100
error_subcodeinteger

Error subcode with more detail (1885272 budget too low, 463 token expired, …).

Example: 1885272
is_transientboolean

Whether retrying the same request may succeed. Present on every Marketing API error; true for codes 1 and 2.

error_user_titlestring

Title of the error, to show to people.

error_user_msgstring

Message of the error, to show to people.

error_dataobject

Extra data. blame_field_specs lists the params that caused a validation error.

Show child attributes
blame_field_specsstring[][]
fbtrace_idstringrequired

Internal support identifier of the request.

Example: "AbCdEf12345"