Due to the iOS 14.5 launch, changes have been made to this endpoint.
POST /{ad-account-id}/adsets endpoint for iOS 14.5 SKAdNetwork campaigns.The adsets of this ad account
GET /v24.0/act_<AD_ACCOUNT_ID>/adsets?fields=name%2Cid%2Cstatus HTTP/1.1
Host: graph.facebook.com/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/act_<AD_ACCOUNT_ID>/adsets?fields=name%2Cid%2Cstatus',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result *//* make the API call */
FB.api(
"/act_<AD_ACCOUNT_ID>/adsets",
{
"fields": "name,id,status"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);Bundle params = new Bundle();
params.putString("fields", "name,id,status");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/act_<AD_ACCOUNT_ID>/adsets",
params,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();NSDictionary *params = @{
@"fields": @"name,id,status",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/act_<AD_ACCOUNT_ID>/adsets"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];curl -X GET -G \
-d 'fields="name,id,status"' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v24.0/act_<AD_ACCOUNT_ID>/adsets| Parameter | Beschreibung |
|---|---|
date_presetenum {TODAY, YESTERDAY, THIS_MONTH, LAST_MONTH, THIS_QUARTER, MAXIMUM, DATA_MAXIMUM, LAST_3D, LAST_7D, LAST_14D, LAST_28D, LAST_30D, LAST_90D, LAST_WEEK_MON_SUN, LAST_WEEK_SUN_SAT, LAST_QUARTER, LAST_YEAR, THIS_WEEK_MON_TODAY, THIS_WEEK_SUN_TODAY, THIS_YEAR} | Predefine date range used to aggregate insights metrics |
effective_statuslist<enum{ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, CAMPAIGN_PAUSED, ARCHIVED, ADSET_PAUSED, IN_PROCESS, WITH_ISSUES}> | Effective status of adset |
is_completedboolean | Filter adset by completed status |
time_range{'since':YYYY-MM-DD,'until':YYYY-MM-DD} | Date range used to aggregate insights metrics |
updated_sinceinteger | Time since the Adset has been updated. |
Beim Lesen dieses Edge wird ein Ergebnis im JSON-Format ausgegeben:
{ "
data": [], "paging": {}, "summary": {} }
datapagingsummaryGesammelte Informationen zum Edge (z. B. Aufrufe). Gib im Parameter „summary“ an, welche Felder einbezogen werden sollen (z. B. summary=insights).
| Feld | Beschreibung |
|---|---|
insightsEdge<AdsInsights> | Analytics summary for all objects. Use nested parameters with this field.
|
total_countunsigned int32 | Total number of objects |
| Fehler | Beschreibung |
|---|---|
| 200 | Permissions error |
| 613 | Calls to this api have exceeded the rate limit. |
| 100 | Invalid parameter |
| 190 | Invalid OAuth 2.0 Access Token |
| 80004 | There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting#ads-management. |
| 368 | The action attempted has been deemed abusive or is otherwise disallowed |
| 3018 | The start date of the time range cannot be beyond 37 months from the current date |
| 2500 | Error parsing graph query |
Mobile App Install CPA Billing will no longer be supported. The billing event cannot be App Install if the Optimization goal is App Install.
adsets edge from the following paths: POST /v24.0/act_<AD_ACCOUNT_ID>/adsets HTTP/1.1
Host: graph.facebook.com
name=My+First+Adset&lifetime_budget=20000&start_time=2025-11-17T20%3A18%3A06-0800&end_time=2025-11-27T20%3A18%3A06-0800&campaign_id=%3CAD_CAMPAIGN_ID%3E&bid_amount=100&billing_event=LINK_CLICKS&optimization_goal=LINK_CLICKS&targeting=%7B%22facebook_positions%22%3A%5B%22feed%22%5D%2C%22geo_locations%22%3A%7B%22countries%22%3A%5B%22US%22%5D%7D%2C%22publisher_platforms%22%3A%5B%22facebook%22%2C%22audience_network%22%5D%7D&status=PAUSED/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/act_<AD_ACCOUNT_ID>/adsets',
array (
'name' => 'My First Adset',
'lifetime_budget' => '20000',
'start_time' => '2025-11-17T20:18:06-0800',
'end_time' => '2025-11-27T20:18:06-0800',
'campaign_id' => '<AD_CAMPAIGN_ID>',
'bid_amount' => '100',
'billing_event' => 'LINK_CLICKS',
'optimization_goal' => 'LINK_CLICKS',
'targeting' => '{"facebook_positions":["feed"],"geo_locations":{"countries":["US"]},"publisher_platforms":["facebook","audience_network"]}',
'status' => 'PAUSED',
),
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result *//* make the API call */
FB.api(
"/act_<AD_ACCOUNT_ID>/adsets",
"POST",
{
"name": "My First Adset",
"lifetime_budget": "20000",
"start_time": "2025-11-17T20:18:06-0800",
"end_time": "2025-11-27T20:18:06-0800",
"campaign_id": "<AD_CAMPAIGN_ID>",
"bid_amount": "100",
"billing_event": "LINK_CLICKS",
"optimization_goal": "LINK_CLICKS",
"targeting": "{\"facebook_positions\":[\"feed\"],\"geo_locations\":{\"countries\":[\"US\"]},\"publisher_platforms\":[\"facebook\",\"audience_network\"]}",
"status": "PAUSED"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);Bundle params = new Bundle();
params.putString("name", "My First Adset");
params.putString("lifetime_budget", "20000");
params.putString("start_time", "2025-11-17T20:18:06-0800");
params.putString("end_time", "2025-11-27T20:18:06-0800");
params.putString("campaign_id", "<AD_CAMPAIGN_ID>");
params.putString("bid_amount", "100");
params.putString("billing_event", "LINK_CLICKS");
params.putString("optimization_goal", "LINK_CLICKS");
params.putString("targeting", "{\"facebook_positions\":[\"feed\"],\"geo_locations\":{\"countries\":[\"US\"]},\"publisher_platforms\":[\"facebook\",\"audience_network\"]}");
params.putString("status", "PAUSED");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/act_<AD_ACCOUNT_ID>/adsets",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();NSDictionary *params = @{
@"name": @"My First Adset",
@"lifetime_budget": @"20000",
@"start_time": @"2025-11-17T20:18:06-0800",
@"end_time": @"2025-11-27T20:18:06-0800",
@"campaign_id": @"<AD_CAMPAIGN_ID>",
@"bid_amount": @"100",
@"billing_event": @"LINK_CLICKS",
@"optimization_goal": @"LINK_CLICKS",
@"targeting": @"{\"facebook_positions\":[\"feed\"],\"geo_locations\":{\"countries\":[\"US\"]},\"publisher_platforms\":[\"facebook\",\"audience_network\"]}",
@"status": @"PAUSED",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/act_<AD_ACCOUNT_ID>/adsets"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];curl -X POST \
-F 'name="My First Adset"' \
-F 'lifetime_budget=20000' \
-F 'start_time="2025-11-17T20:18:06-0800"' \
-F 'end_time="2025-11-27T20:18:06-0800"' \
-F 'campaign_id="<AD_CAMPAIGN_ID>"' \
-F 'bid_amount=100' \
-F 'billing_event="LINK_CLICKS"' \
-F 'optimization_goal="LINK_CLICKS"' \
-F 'targeting={
"facebook_positions": [
"feed"
],
"geo_locations": {
"countries": [
"US"
]
},
"publisher_platforms": [
"facebook",
"audience_network"
]
}' \
-F 'status="PAUSED"' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v24.0/act_<AD_ACCOUNT_ID>/adsets| Parameter | Beschreibung |
|---|---|
adlabelslist<Object> | Specifies list of labels to be associated with this object. This field is optional |
adset_schedulelist<Object> | Ad set schedule, representing a delivery schedule for a single day |
anchor_event_attribution_window_daysint64 | anchor_event_attribution_window_days |
attribution_speclist<JSON object> | Conversion attribution spec used for attributing conversions for optimization. Supported window lengths differ by optimization goal and campaign objective. |
automatic_manual_stateenum{UNSET, AUTOMATIC, MANUAL} | automatic_manual_state |
bid_amountinteger | Bid cap or target cost for this ad set. The bid cap used in a lowest cost bid strategy is defined as the maximum bid you want to pay for a result based on your |
enum{LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, COST_CAP, LOWEST_COST_WITH_MIN_ROAS} | Choose bid strategy for this ad set to suit your specific business goals.
Each strategy has tradeoffs and may be available for certain Notes:
|
billing_eventenum{APP_INSTALLS, CLICKS, IMPRESSIONS, LINK_CLICKS, NONE, OFFER_CLAIMS, PAGE_LIKES, POST_ENGAGEMENT, THRUPLAY, PURCHASE, LISTING_INTERACTION} | The billing event that this ad set is using: |
budget_schedule_specslist<JSON or object-like arrays> | Initial high demand periods to be created with the ad set. |
budget_sourceenum{NONE, RMN} | budget_source |
budget_split_set_idnumeric string or integer | budget_split_set_id |
campaign_attributionenum{} | campaign_attribution |
campaign_idnumeric string or integer | The ad campaign you wish to add this ad set to. |
campaign_specCampaign spec | Provide |
contextual_bundling_specObject | settings of Contextual Bundle to support ads serving in Facebook contextual surfaces |
creative_sequencelist<numeric string or integer> | Order of the adgroup sequence to be shown to users |
daily_budgetint64 | The daily budget defined in your account currency, allowed only for ad sets with a duration (difference between |
daily_impsint64 | Daily impressions. Available only for campaigns with |
daily_min_spend_targetint64 | Daily minimum spend target of the ad set defined in your account currency. To use this field, daily budget must be specified in the Campaign. This target is not a guarantee but our best effort. |
daily_spend_capint64 | Daily spend cap of the ad set defined in your account currency. To use this field, daily budget must be specified in the Campaign. Set the value to 922337203685478 to remove the spend cap. |
destination_typeenum{WEBSITE, APP, MESSENGER, APPLINKS_AUTOMATIC, WHATSAPP, INSTAGRAM_DIRECT, FACEBOOK, MESSAGING_MESSENGER_WHATSAPP, MESSAGING_INSTAGRAM_DIRECT_MESSENGER, MESSAGING_INSTAGRAM_DIRECT_MESSENGER_WHATSAPP, MESSAGING_INSTAGRAM_DIRECT_WHATSAPP, SHOP_AUTOMATIC, ON_AD, ON_POST, ON_EVENT, ON_VIDEO, ON_PAGE, INSTAGRAM_PROFILE, FACEBOOK_PAGE, INSTAGRAM_PROFILE_AND_FACEBOOK_PAGE, INSTAGRAM_LIVE, FACEBOOK_LIVE, IMAGINE} | Destination of ads in this Ad Set. Options include: Website, App, Messenger, |
dsa_beneficiarystring | dsa_beneficiary |
dsa_payorstring | dsa_payor |
end_timedatetime | End time, required when |
execution_optionslist<enum{validate_only, include_recommendations}> | Standardwert: SetAn execution setting |
existing_customer_budget_percentageint64 | existing_customer_budget_percentage |
frequency_control_specslist<Object> | An array of frequency control specs for this ad set. Writes to this field are only available in ad sets where |
boolean | Indicates the ad set must only be used for dynamic creatives. Dynamic creative ads can be created in this ad set. Defaults to |
is_sac_cfca_terms_certifiedboolean | is_sac_cfca_terms_certified |
lifetime_budgetint64 | Lifetime budget, defined in your account currency. If specified, you must also specify an |
lifetime_impsint64 | Lifetime impressions. Available only for campaigns with |
lifetime_min_spend_targetint64 | Lifetime minimum spend target of the ad set defined in your account currency. To use this field, lifetime budget must be specified in the Campaign. This target is not a guarantee but our best effort. |
lifetime_spend_capint64 | Lifetime spend cap of the ad set defined in your account currency. To use this field, lifetime budget must be specified in the Campaign. Set the value to 922337203685478 to remove the spend cap. |
max_budget_spend_percentageint64 | max_budget_spend_percentage |
min_budget_spend_percentageint64 | min_budget_spend_percentage |
multi_optimization_goal_weightenum{UNDEFINED, BALANCED, PREFER_INSTALL, PREFER_EVENT} | multi_optimization_goal_weight |
namestring | Ad set name, max length of 400 characters. erforderlichSupports Emoji |
optimization_goalenum{NONE, APP_INSTALLS, AD_RECALL_LIFT, ENGAGED_USERS, EVENT_RESPONSES, IMPRESSIONS, LEAD_GENERATION, QUALITY_LEAD, LINK_CLICKS, OFFSITE_CONVERSIONS, PAGE_LIKES, POST_ENGAGEMENT, QUALITY_CALL, REACH, LANDING_PAGE_VIEWS, VISIT_INSTAGRAM_PROFILE, VALUE, THRUPLAY, DERIVED_EVENTS, APP_INSTALLS_AND_OFFSITE_CONVERSIONS, CONVERSATIONS, IN_APP_VALUE, MESSAGING_PURCHASE_CONVERSION, SUBSCRIBERS, REMINDERS_SET, MEANINGFUL_CALL_ATTEMPT, PROFILE_VISIT, PROFILE_AND_PAGE_ENGAGEMENT, ADVERTISER_SILOED_VALUE, AUTOMATIC_OBJECTIVE, MESSAGING_APPOINTMENT_CONVERSION} | What the ad set is optimizing for. |
optimization_sub_eventenum{NONE, VIDEO_SOUND_ON, TRIP_CONSIDERATION, TRAVEL_INTENT, TRAVEL_INTENT_NO_DESTINATION_INTENT, TRAVEL_INTENT_BUCKET_01, TRAVEL_INTENT_BUCKET_02, TRAVEL_INTENT_BUCKET_03, TRAVEL_INTENT_BUCKET_04, TRAVEL_INTENT_BUCKET_05, POST_INTERACTION} | Optimization sub event for a specific optimization goal (ex: Sound-On event for Video-View-2s optimization goal) |
pacing_typelist<string> | Defines the pacing type, standard by default or using ad scheduling |
promoted_objectObject | The object this ad set is promoting across all its ads.
Required with certain campaign objectives.
optimization_goal is OFFSITE_CONVERSIONS
optimization_goal is LEAD_GENERATION, page_id needs to be passed as promoted_object.
Please refer to the Outcome-Driven Ads Experiences mapping table to find new objectives and their corresponding destination types, optimization goals and promoted objects. |
rf_prediction_idnumeric string or integer | Reach and frequency prediction ID |
source_adset_idnumeric string or integer | The source adset id that this ad is copied from (if applicable). |
start_timedatetime | The start time of the set, e.g. |
statusenum{ACTIVE, PAUSED, DELETED, ARCHIVED} | Only |
targetingTargeting object | An ad set's targeting structure. "countries" is required. See targeting. |
time_based_ad_rotation_id_blockslist<list<int64>> | Specify ad creative that displays at custom date ranges in a campaign
as an array. A list of Adgroup IDs. The list of ads to display for each
time range in a given schedule. For example display first ad in Adgroup
for first date range, second ad for second date range, and so on. You
can display more than one ad per date range by providing more than
one ad ID per array. For example set
|
time_based_ad_rotation_intervalslist<int64> | Date range when specific ad creative displays during a campaign.
Provide date ranges in an array of UNIX timestamps where each
timestamp represents the start time for each date range. For example a
3-day campaign from May 9 12am to May 11 11:59PM PST can have three
date ranges, the first date range starts from May 9 12:00AM to
May 9 11:59PM, second date range starts from May 10 12:00AM to
May 10 11:59PM and last starts from May 11 12:00AM to May 11 11:59PM.
The first timestamp should match the campaign start time. The last
timestamp should be at least 1 hour before the campaign end time. You
must provide at least two date ranges. All date ranges must cover the
whole campaign length, so any date range cannot exceed campaign length.
Use with |
time_startdatetime | Time start |
time_stopdatetime | Time stop |
tune_for_categoryenum{NONE, EMPLOYMENT, HOUSING, CREDIT, ISSUES_ELECTIONS_POLITICS, ONLINE_GAMBLING_AND_GAMING, FINANCIAL_PRODUCTS_SERVICES} | tune_for_category |
value_rule_set_idnumeric string or integer | Value Rule Set ID |
value_rules_appliedboolean | value_rules_applied |
id in the return type.id: numeric string, success: bool, | Fehler | Beschreibung |
|---|---|
| 100 | Invalid parameter |
| 200 | Permissions error |
| 2635 | You are calling a deprecated version of the Ads API. Please update to the latest version. |
| 368 | The action attempted has been deemed abusive or is otherwise disallowed |
| 2695 | The ad set creation reached its campaign group(ios14) limit. |
| 80004 | There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting#ads-management. |
| 2641 | Your ad includes or excludes locations that are currently restricted |
| 190 | Invalid OAuth 2.0 Access Token |
| 900 | No such application exists. |
This operation has been deprecated with Marketing API V8.