Graph API Version

Ad Account Adsets

If you are making and insights query for this object, be aware that there are specific parameters which apply to the insights field as nested query modifiers. This object contains nested fields and the syntax you should use is is different, for example you normally use this syntax:

https://developers.facebook.com/tools/explorer/<AD_SET_ID>/?session_id=<ID>
https://developers.facebook.com/tools/explorer/<AD_SET_ID>/?session_id=<ID>

To get insight results from a nested field:

<act_ID>/adsets?fields=insights.time_range({'until':'2018-01-01', 'since':'2017-12-12'}).time_increment(1)

Reading

The adsets of this ad account

Example

Graph API Explorer
GET /v5.0/{ad-account-id}/adsets 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(
    '/{ad-account-id}/adsets',
    '{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(
    "/{ad-account-id}/adsets",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-account-id}/adsets",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{ad-account-id}/adsets"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

ParameterDescription
ad_draft_id
ad_draft_id ID

If draft id is specified, adsets from the draft will be included

date_preset
enum {TODAY, YESTERDAY, THIS_MONTH, LAST_MONTH, THIS_QUARTER, LIFETIME, 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_status
list<enum{ACTIVE, PAUSED, DELETED, PENDING_REVIEW, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, CAMPAIGN_PAUSED, ARCHIVED, ADSET_PAUSED, IN_PROCESS, WITH_ISSUES}>

Effective status of adset

include_drafts
boolean

If true, adsets from active draft will be included.

is_completed
boolean
Default value: true

Filter adset by completed status

time_range
{'since':YYYY-MM-DD,'until':YYYY-MM-DD}

Date range used to aggregate insights metrics

since
datetime

A date in the format of "YYYY-MM-DD", which means from the beginning midnight of that day.

until
datetime

A date in the format of "YYYY-MM-DD", which means to the beginning midnight of the following day.

use_employee_draft
boolean

If set to true, employee draft will be used

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {}, "summary": {} }

data

A list of AdCampaign nodes.

paging

For more details about pagination, see the Graph API guide.

summary

Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=insights).

FieldDescription
insights

Analytics summary for all objects

total_count
unsigned int32

Total number of objects

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error
80004There 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.

Creating

You can make a POST request to adsets edge from the following paths:
When posting to this edge, an AdSet will be created.

Example

Graph API Explorer
POST /v5.0/act_<AD_ACCOUNT_ID>/adsets HTTP/1.1
Host: graph.facebook.com

name=My+First+AdSet&lifetime_budget=20000&start_time=2019-11-28T05%3A31%3A51-0800&end_time=2019-12-05T05%3A31%3A51-0800&campaign_id=%3CAD_CAMPAIGN_ID%3E&bid_amount=500&billing_event=IMPRESSIONS&optimization_goal=POST_ENGAGEMENT&targeting=%7B%22age_min%22%3A20%2C%22age_max%22%3A24%2C%22behaviors%22%3A%5B%7B%22id%22%3A6002714895372%2C%22name%22%3A%22All+travelers%22%7D%5D%2C%22genders%22%3A%5B1%5D%2C%22geo_locations%22%3A%7B%22countries%22%3A%5B%22US%22%5D%2C%22regions%22%3A%5B%7B%22key%22%3A%224081%22%7D%5D%2C%22cities%22%3A%5B%7B%22key%22%3A%22777934%22%2C%22radius%22%3A10%2C%22distance_unit%22%3A%22mile%22%7D%5D%7D%2C%22interests%22%3A%5B%7B%22id%22%3A%22%3CINTEREST_ID%3E%22%2C%22name%22%3A%22%3CINTEREST_NAME%3E%22%7D%5D%2C%22life_events%22%3A%5B%7B%22id%22%3A6002714398172%2C%22name%22%3A%22Newlywed+%281+year%29%22%7D%5D%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' => '2019-11-28T05:31:51-0800',
      'end_time' => '2019-12-05T05:31:51-0800',
      'campaign_id' => '<AD_CAMPAIGN_ID>',
      'bid_amount' => '500',
      'billing_event' => 'IMPRESSIONS',
      'optimization_goal' => 'POST_ENGAGEMENT',
      'targeting' => '{"age_min":20,"age_max":24,"behaviors":[{"id":6002714895372,"name":"All travelers"}],"genders":[1],"geo_locations":{"countries":["US"],"regions":[{"key":"4081"}],"cities":[{"key":"777934","radius":10,"distance_unit":"mile"}]},"interests":[{"id":"<INTEREST_ID>","name":"<INTEREST_NAME>"}],"life_events":[{"id":6002714398172,"name":"Newlywed (1 year)"}],"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": "2019-11-28T05:31:51-0800",
        "end_time": "2019-12-05T05:31:51-0800",
        "campaign_id": "<AD_CAMPAIGN_ID>",
        "bid_amount": "500",
        "billing_event": "IMPRESSIONS",
        "optimization_goal": "POST_ENGAGEMENT",
        "targeting": "{\"age_min\":20,\"age_max\":24,\"behaviors\":[{\"id\":6002714895372,\"name\":\"All travelers\"}],\"genders\":[1],\"geo_locations\":{\"countries\":[\"US\"],\"regions\":[{\"key\":\"4081\"}],\"cities\":[{\"key\":\"777934\",\"radius\":10,\"distance_unit\":\"mile\"}]},\"interests\":[{\"id\":\"<INTEREST_ID>\",\"name\":\"<INTEREST_NAME>\"}],\"life_events\":[{\"id\":6002714398172,\"name\":\"Newlywed (1 year)\"}],\"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", "2019-11-28T05:31:51-0800");
params.putString("end_time", "2019-12-05T05:31:51-0800");
params.putString("campaign_id", "<AD_CAMPAIGN_ID>");
params.putString("bid_amount", "500");
params.putString("billing_event", "IMPRESSIONS");
params.putString("optimization_goal", "POST_ENGAGEMENT");
params.putString("targeting", "{\"age_min\":20,\"age_max\":24,\"behaviors\":[{\"id\":6002714895372,\"name\":\"All travelers\"}],\"genders\":[1],\"geo_locations\":{\"countries\":[\"US\"],\"regions\":[{\"key\":\"4081\"}],\"cities\":[{\"key\":\"777934\",\"radius\":10,\"distance_unit\":\"mile\"}]},\"interests\":[{\"id\":\"<INTEREST_ID>\",\"name\":\"<INTEREST_NAME>\"}],\"life_events\":[{\"id\":6002714398172,\"name\":\"Newlywed (1 year)\"}],\"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();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
  @"name": @"My First AdSet",
  @"lifetime_budget": @"20000",
  @"start_time": @"2019-11-28T05:31:51-0800",
  @"end_time": @"2019-12-05T05:31:51-0800",
  @"campaign_id": @"<AD_CAMPAIGN_ID>",
  @"bid_amount": @"500",
  @"billing_event": @"IMPRESSIONS",
  @"optimization_goal": @"POST_ENGAGEMENT",
  @"targeting": @"{\"age_min\":20,\"age_max\":24,\"behaviors\":[{\"id\":6002714895372,\"name\":\"All travelers\"}],\"genders\":[1],\"geo_locations\":{\"countries\":[\"US\"],\"regions\":[{\"key\":\"4081\"}],\"cities\":[{\"key\":\"777934\",\"radius\":10,\"distance_unit\":\"mile\"}]},\"interests\":[{\"id\":\"<INTEREST_ID>\",\"name\":\"<INTEREST_NAME>\"}],\"life_events\":[{\"id\":6002714398172,\"name\":\"Newlywed (1 year)\"}],\"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="2019-11-28T05:31:51-0800"' \
  -F 'end_time="2019-12-05T05:31:51-0800"' \
  -F 'campaign_id="<AD_CAMPAIGN_ID>"' \
  -F 'bid_amount=500' \
  -F 'billing_event="IMPRESSIONS"' \
  -F 'optimization_goal="POST_ENGAGEMENT"' \
  -F 'targeting={
       "age_min": 20,
       "age_max": 24,
       "behaviors": [
         {
           "id": 6002714895372,
           "name": "All travelers"
         }
       ],
       "genders": [
         1
       ],
       "geo_locations": {
         "countries": [
           "US"
         ],
         "regions": [
           {
             "key": "4081"
           }
         ],
         "cities": [
           {
             "key": "777934",
             "radius": 10,
             "distance_unit": "mile"
           }
         ]
       },
       "interests": [
         {
           "id": "<INTEREST_ID>",
           "name": "<INTEREST_NAME>"
         }
       ],
       "life_events": [
         {
           "id": 6002714398172,
           "name": "Newlywed (1 year)"
         }
       ],
       "publisher_platforms": [
         "facebook",
         "audience_network"
       ]
     }' \
  -F 'status="PAUSED"' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v5.0/act_<AD_ACCOUNT_ID>/adsets
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

ParameterDescription
adlabels
list<Object>

Specifies list of labels to be associated with this object. This field is optional

adset_schedule
list<Object>

Ad set schedule, representing a delivery schedule for a single day

start_minute
int64

A 0 based minute of the day representing when the schedule starts

Required
end_minute
int64

A 0 based minute of the day representing when the schedule ends

Required
days
list<int64>

Array of ints representing which days the schedule is active. Valid values are 0-6 with 0 representing Sunday, 1 representing Monday, ... and 6 representing Saturday.

Required
timezone_type
enum {USER, ADVERTISER}
Default value: USER

attribution_spec
list<JSON object>

Conversion attribution spec used for attributing conversions for optimization. Supported window lengths differ by optimization goal and campaign objective. See Validation, Attribution Spec.

event_type
enum {CLICK_THROUGH, VIEW_THROUGH}

Required
window_days
int64

Required
bid_amount
integer

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 optimization_goal. The target cost used in a target cost bid strategy lets Facebook bid to meet your target on average and keep costs stable as you spend. If an ad level bid_amount is specified, updating this value will overwrite the previous ad level bid. Either bid_amount or is_autobid is required unless you are using Reach and Frequency buying for your ad sets. The bid amount's unit is cents for currencies like USD, EUR, and the basic unit for currencies like JPY, KRW. The bid amount for ads with IMPRESSION or REACH as billing_event is per 1,000 occurrences, and has to be at least 2 US cents or more. For ads with other billing_events, the bid amount is for each occurrence, and has a minimum value 1 US cents. The minimum bid amounts of other currencies are of similar value to the US Dollar values provided.

bid_strategy
enum{LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, TARGET_COST}

Choose bid strategy for this ad set to suit your specific business goals. Each strategy has tradeoffs and may be available for certain optimization_goals:
LOWEST_COST_WITHOUT_CAP: Designed to get the most results for your budget based on your ad set optimization_goal without limiting your bid amount. This is the best strategy if you care most about cost efficiency. However with this strategy it may be harder to get stable average costs as you spend. This strategy is also known as automatic bidding. Learn more in Ads Help Center, About bid strategies: Lowest cost.
LOWEST_COST_WITH_BID_CAP: Designed to get the most results for your budget based on your ad set optimization_goal while limiting actual bid to your specified amount. With a bid cap you have more control over your cost per actual optimization event. However if you set a limit which is too low you may get less ads delivery. If you select this, you must provide a bid cap with the bid_amount field. Note: during creation this bid strategy is set if you provide bid_amount only. This strategy is also known as manual maximum-cost bidding. Learn more in Ads Help Center, About bid strategies: Lowest cost.
TARGET_COST: Maintains a stable average cost based on your optimization_goal as you raise your ad set budget. Select this strategy if you care most about maintaining stable average costs for your ads. However, note that this strategy may be less cost-efficient than the lowest cost strategy. If you select this, you must provide a target cost with the bid_amount field. Target cost bid strategy is also known as manual average-cost bidding. Learn more in Ads Help Center, About bid strategies: Target cost.
Note: If you enable campaign budget optimization, you should set bid_strategy at the parent campaign level.

billing_event
enum{APP_INSTALLS, CLICKS, IMPRESSIONS, LINK_CLICKS, NONE, OFFER_CLAIMS, PAGE_LIKES, POST_ENGAGEMENT, VIDEO_VIEWS, THRUPLAY}

The billing event that this ad set is using:
APP_INSTALLS: Pay when people install your app.
CLICKS: Deprecated.
IMPRESSIONS: Pay when the ads are shown to people.
LINK_CLICKS: Pay when people click on the link of the ad.
OFFER_CLAIMS: Pay when people claim the offer.
PAGE_LIKES: Pay when people like your page.
POST_ENGAGEMENT: Pay when people engage with your post.
VIDEO_VIEWS: Pay when people watch your video ads for at least 10 seconds.
THRUPLAY: Pay for ads that are played to completion, or played for at least 15 seconds.

campaign_id
numeric string or integer

The ad campaign you wish to add this ad set to.

campaign_spec
Campaign spec

Provide name, objective and buying_type for a campaign you want to create. Otherwise you need to provide campaign_id for an existing ad campaign. For example:
-F 'campaign_spec={
  "name": "Inline created campaign",
  "objective": "CONVERSIONS",
  "buying_type": "AUCTION"
}'

creative_sequence
list<numeric string or integer>

Order of the adgroup sequence to be shown to users

daily_budget
int64

The daily budget defined in your account currency, allowed only for ad sets with a duration (difference between end_time and start_time) longer than 24 hours.
Either daily_budget or lifetime_budget must be greater than 0.

daily_imps
int64

Daily impressions. Available only for campaigns with buying_type=FIXED_CPM

daily_min_spend_target
int64

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_cap
int64

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_type
enum{UNDEFINED, WEBSITE, APP, MESSENGER, APPLINKS_AUTOMATIC, FACEBOOK}

Destination of ads in this Ad Set (e.g. Website, App, Messenger)

end_time
datetime

End time, required when lifetime_budget is specified. e.g. 2015-03-12 23:59:59-07:00 or 2015-03-12 23:59:59 PDT. When creating a set with a daily budget, specify end_time=0 to set the set to be ongoing and have no end date. UTC UNIX timestamp

execution_options
list<enum{validate_only, include_recommendations}>
Default value: Set

An execution setting
validate_only: when this option is specified, the API call will not perform the mutation but will run through the validation rules against values of each field.
include_recommendations: this option cannot be used by itself. When this option is used, recommendations for ad object's configuration will be included. A separate section recommendations will be included in the response, but only if recommendations for this specification exist.
If the call passes validation or review, response will be {"success": true}. If the call does not pass, an error will be returned with more details. These options can be used to improve any UI to display errors to the user much sooner, e.g. as soon as a new value is typed into any field corresponding to this ad object, rather than at the upload/save stage, or after review.

frequency_control_specs
list<Object>

An array of frequency control specs for this ad set. As there is only one event type currently supported, this array has no more than one element. Writes to this field are only available in ad sets where REACH is the objective.

event
enum{IMPRESSIONS, VIDEO_VIEWS, VIDEO_VIEWS_2S, VIDEO_VIEWS_15S}

Event name, only IMPRESSIONS currently.

Required
interval_days
integer

Interval period in days, between 1 and 90 (inclusive)

Required
max_frequency
integer

The maximum frequency, between 1 and 90 (inclusive)

Required
is_dynamic_creative
boolean

Indicates the ad set must only be used for dynamic creatives. Dynamic creative ads can be created in this ad set. Defaults to false

lifetime_budget
int64

Lifetime budget, defined in your account currency. If specified, you must also specify an end_time.
Either daily_budget or lifetime_budget must be greater than 0.

lifetime_imps
int64

Lifetime impressions. Available only for campaigns with buying_type=FIXED_CPM

lifetime_min_spend_target
int64

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_cap
int64

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.

name
string

Ad set name, max length of 400 characters.

RequiredSupports Emoji
optimization_goal
enum{NONE, APP_INSTALLS, BRAND_AWARENESS, AD_RECALL_LIFT, CLICKS, ENGAGED_USERS, EVENT_RESPONSES, IMPRESSIONS, LEAD_GENERATION, LINK_CLICKS, OFFER_CLAIMS, OFFSITE_CONVERSIONS, PAGE_ENGAGEMENT, PAGE_LIKES, POST_ENGAGEMENT, REACH, SOCIAL_IMPRESSIONS, VIDEO_VIEWS, APP_DOWNLOADS, TWO_SECOND_CONTINUOUS_VIDEO_VIEWS, LANDING_PAGE_VIEWS, VALUE, THRUPLAY, REPLIES, DERIVED_EVENTS}

What the ad set is optimizing for.
APP_INSTALLS: Will optimize for people more likely to install your app.
BRAND_AWARENESS: Optimize to reach the most users to spend at least a minimum amount of time on the image or video. You cannot set bid_amount, and is_autobid must be true if this goal is used.
ENGAGED_USERS: Will optimize for people more likely to take a particular action in your app.
EVENT_RESPONSES: Will optimize for people more likely to attend your event.
IMPRESSIONS: Will show the ads as many times as possible.
LEAD_GENERATION: Will optimize for people more likely to fill out a lead generation form.
LINK_CLICKS: Will optimize for people more likely to click in the link of the ad.
OFFER_CLAIMS: Will optimize for people more likely to claim the offer.
OFFSITE_CONVERSIONS: Will optimize for people more likely to make a conversion in the site
PAGE_ENGAGEMENT: Will optimize for people more likely to engage with your page.
PAGE_LIKES: Will optimize for people more likely to like your page.
POST_ENGAGEMENT: Will optimize for people more likely to engage with your post.
REACH: Optimize to reach the most unique users of each day or interval specified in frequency_control_specs.
SOCIAL_IMPRESSIONS: Increase the number of impressions with social context. I.e. with the names of one or more of the user's friends attached to the ad who have already liked the page or installed the app.
VIDEO_VIEWS: Will optimize delivery of your ads to people who are more likely to watch videos for at least 10 seconds.
VALUE: Will optimize for maximum total purchase value within the specified attribution window.
THRUPLAY: Will optimize delivery of your ads to people are more likely to play your ad to completion, or play it for at least 15 seconds.

optimization_sub_event
enum{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}

Optimization sub event for a specific optimization goal (ex: Sound-On event for Video-View-2s optimization goal)

pacing_type
list<string>

Defines the pacing type, standard by default or using ad scheduling

promoted_object
Object

The object this ad set is promoting across all its ads. Required with certain campaign objectives.
CONVERSIONS

  • pixel_id (Conversion pixel ID)
  • pixel_id (Facebook pixel ID) and custom_event_type
  • pixel_id (Facebook pixel ID) and pixel_rule and custom_event_type
  • event_id (Facebook event ID) and custom_event_type
  • application_id, object_store_url, and custom_event_type for mobile app events
  • offline_conversion_data_set_id (Offline dataset ID) and custom_event_type for offline conversions
PAGE_LIKES
page_id
OFFER_CLAIMS
page_id
LINK_CLICKS
application_id and object_store_url for mobile app or Canvas app engagement link clicks
APP_INSTALLS
application_id and object_store_url
or application_id, object_store_url, and custom_event_type if the optimization_goal is OFFSITE_CONVERSIONS
PRODUCT_CATALOG_SALES
product_set_id,
or product_set_id and custom_event_type

When optimization_goal is LEAD_GENERATION, page_id needs to be passed as promoted_object.

application_id
int

The ID of a Facebook Application. Usually related to mobile or canvas games being promoted on Facebook for installs or engagement

pixel_id
numeric string or integer

The ID of a Facebook conversion pixel. Used with offsite conversion campaigns.

custom_event_type
enum{RATE, TUTORIAL_COMPLETION, CONTACT, CUSTOMIZE_PRODUCT, DONATE, FIND_LOCATION, SCHEDULE, START_TRIAL, SUBMIT_APPLICATION, SUBSCRIBE, ADD_TO_CART, ADD_TO_WISHLIST, INITIATED_CHECKOUT, ADD_PAYMENT_INFO, PURCHASE, LEAD, COMPLETE_REGISTRATION, CONTENT_VIEW, SEARCH, SERVICE_BOOKING_REQUEST, MESSAGING_CONVERSATION_STARTED_7D, LEVEL_ACHIEVED, ACHIEVEMENT_UNLOCKED, SPENT_CREDITS, LISTING_INTERACTION, D2_RETENTION, D7_RETENTION, OTHER}

The event from an App Event of a mobile app, not in the standard event list.

object_store_url
URL

The uri of the mobile / digital store where an application can be bought / downloaded. This is platform specific. When combined with the "application_id" this uniquely specifies an object which can be the subject of a Facebook advertising campaign.

offer_id
numeric string or integer

The ID of an Offer from a Facebook Page.

page_id
Page ID

The ID of a Facebook Page

product_catalog_id
numeric string or integer

The ID of a Product Catalog. Used with Dynamic Product Ads.

product_item_id
numeric string or integer

The ID of the product item.

instagram_profile_id
numeric string or integer

The ID of the instagram profile id.

product_set_id
numeric string or integer

The ID of a Product Set within an Ad Set level Product Catalog. Used with Dynamic Product Ads.

event_id
numeric string or integer

The ID of a Facebook Event

offline_conversion_data_set_id
numeric string or integer

The ID of the offline dataset.

fundraiser_campaign_id
numeric string or integer

The ID of the fundraiser campaign.

custom_event_str
string

The event from an App Event of a mobile app, not in the standard event list.

omnichannel_object
Object

app
list<Object>

application_id
App ID

custom_event_type
enum {JOB_ALERT_SUBSCRIBE, JOB_APPLICATION_CREATE, JOB_APPLICATION_FORM_IMPRESSION, JOB_BROWSER_IMPRESSION, JOB_OPENING_DETAIL_VIEW_IMPRESSION, ACTIVATE_APP, COMPLETE_REGISTRATION, CONTENT_VIEW, ONSITE_APP_CONTENT_VIEW, ONSITE_WEB_CONTENT_VIEW, ONSITE_WEB_APP_CONTENT_VIEW, SEARCH, RATE, TUTORIAL_COMPLETION, CONTACT, CUSTOMIZE_PRODUCT, DONATE, FIND_LOCATION, SCHEDULE, START_TRIAL, SUBMIT_APPLICATION, SUBSCRIBE, RECURRING_SUBSCRIPTION_PAYMENT, CANCEL_SUBSCRIPTION, VISIT_LOCATION, AD_CLICK, AD_IMPRESSION, ADD_TO_CART, ONSITE_APP_ADD_TO_CART, ONSITE_WEB_ADD_TO_CART, ONSITE_WEB_APP_ADD_TO_CART, ADD_TO_WISHLIST, INITIATED_CHECKOUT, ADD_PAYMENT_INFO, PURCHASE, ONSITE_APP_PURCHASE, ONSITE_WEB_PURCHASE, ONSITE_WEB_APP_PURCHASE, MESSAGE_TO_BUY, LEAD, ONSITE_WEB_LEAD, LEVEL_ACHIEVED, ACHIEVEMENT_UNLOCKED, SPENT_CREDITS, FLOW_COMPLETE, SERVICE_BOOKING_REQUEST, MESSAGING_ACCEPT, MESSAGING_BLOCK, MESSAGING_DELETE_THREAD, MESSAGING_MARK_SPAM, MESSAGING_REPLY, MESSAGING_FIRST_REPLY, MESSAGING_OPEN_THREAD, MESSAGING_IGNORE_REQUEST, MESSAGING_PROMOTIONAL_OFF, MESSAGING_READ_RECEIPT, MESSAGING_DELIVERY_RECEIPT, MESSAGING_DELETE_MESSAGE, MESSAGING_CONVERSATION_STARTED_7D, MESSAGING_DEEP_CONVERSATION, MESSAGING_AUTOMATED_FLOW_COMPLETE, MESSAGING_AUTOMATED_FLOW_CANCELLED, MESSENGER_RECEIPT_TEMPLATE, REFERRAL_SENDER_INVITES_SENT, REFERRAL_SENDER_MESSAGE_SENT, REFERRAL_RECEIVER_IMPRESSION, REFERRAL_RECEIVER_CLICK, VIDEO_HOME_SELECTED, VIDEO_HOME_WATCHLIST, VIDEO_HOME_EXPLORE, VIDEO_HOME_PLAYER_START, VIDEO_HOME_90_SECOND_VIEW, FUNDRAISER_CREATE, MESSENGER_CONNECTED_CALL, MESSENGER_MISSED_CALL, D2_RETENTION, D7_RETENTION, MOVIE_SHOWTIME_CLICK, LISTING_INTERACTION, PDP_VIEW, CLICK_TO_CALL, CLICK_TO_WEBSITE, POST_SHARE, OTHER}

object_store_urls
list<string>

pixel
list<Object>

custom_event_type
enum {JOB_ALERT_SUBSCRIBE, JOB_APPLICATION_CREATE, JOB_APPLICATION_FORM_IMPRESSION, JOB_BROWSER_IMPRESSION, JOB_OPENING_DETAIL_VIEW_IMPRESSION, ACTIVATE_APP, COMPLETE_REGISTRATION, CONTENT_VIEW, ONSITE_APP_CONTENT_VIEW, ONSITE_WEB_CONTENT_VIEW, ONSITE_WEB_APP_CONTENT_VIEW, SEARCH, RATE, TUTORIAL_COMPLETION, CONTACT, CUSTOMIZE_PRODUCT, DONATE, FIND_LOCATION, SCHEDULE, START_TRIAL, SUBMIT_APPLICATION, SUBSCRIBE, RECURRING_SUBSCRIPTION_PAYMENT, CANCEL_SUBSCRIPTION, VISIT_LOCATION, AD_CLICK, AD_IMPRESSION, ADD_TO_CART, ONSITE_APP_ADD_TO_CART, ONSITE_WEB_ADD_TO_CART, ONSITE_WEB_APP_ADD_TO_CART, ADD_TO_WISHLIST, INITIATED_CHECKOUT, ADD_PAYMENT_INFO, PURCHASE, ONSITE_APP_PURCHASE, ONSITE_WEB_PURCHASE, ONSITE_WEB_APP_PURCHASE, MESSAGE_TO_BUY, LEAD, ONSITE_WEB_LEAD, LEVEL_ACHIEVED, ACHIEVEMENT_UNLOCKED, SPENT_CREDITS, FLOW_COMPLETE, SERVICE_BOOKING_REQUEST, MESSAGING_ACCEPT, MESSAGING_BLOCK, MESSAGING_DELETE_THREAD, MESSAGING_MARK_SPAM, MESSAGING_REPLY, MESSAGING_FIRST_REPLY, MESSAGING_OPEN_THREAD, MESSAGING_IGNORE_REQUEST, MESSAGING_PROMOTIONAL_OFF, MESSAGING_READ_RECEIPT, MESSAGING_DELIVERY_RECEIPT, MESSAGING_DELETE_MESSAGE, MESSAGING_CONVERSATION_STARTED_7D, MESSAGING_DEEP_CONVERSATION, MESSAGING_AUTOMATED_FLOW_COMPLETE, MESSAGING_AUTOMATED_FLOW_CANCELLED, MESSENGER_RECEIPT_TEMPLATE, REFERRAL_SENDER_INVITES_SENT, REFERRAL_SENDER_MESSAGE_SENT, REFERRAL_RECEIVER_IMPRESSION, REFERRAL_RECEIVER_CLICK, VIDEO_HOME_SELECTED, VIDEO_HOME_WATCHLIST, VIDEO_HOME_EXPLORE, VIDEO_HOME_PLAYER_START, VIDEO_HOME_90_SECOND_VIEW, FUNDRAISER_CREATE, MESSENGER_CONNECTED_CALL, MESSENGER_MISSED_CALL, D2_RETENTION, D7_RETENTION, MOVIE_SHOWTIME_CLICK, LISTING_INTERACTION, PDP_VIEW, CLICK_TO_CALL, CLICK_TO_WEBSITE, POST_SHARE, OTHER}

pixel_id
Ads Pixel ID

pixel_rule
string

rf_prediction_id
numeric string or integer

Reach and frequency prediction ID

source_adset_id
numeric string or integer

The source adset id that this ad is copied from (if applicable).

start_time
datetime

The start time of the set, e.g. 2015-03-12 23:59:59-07:00 or 2015-03-12 23:59:59 PDT. UTC UNIX timestamp

status
enum{ACTIVE, PAUSED, DELETED, ARCHIVED}

Only ACTIVE and PAUSED are valid for creation. The other statuses can be used for update. If it is set to PAUSED, all its active ads will be paused and have an effective status ADSET_PAUSED.

targeting
Targeting object

An ad set's targeting structure. "countries" is required. See targeting.

time_based_ad_rotation_id_blocks
list<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_id_blocks to [[1], [2, 3], [1, 4]]. On the first date range show ad 1, on the second date range show ad 2 and ad 3 and on the last date range show ad 1 and ad 4. Use with time_based_ad_rotation_intervals to specify date ranges.

time_based_ad_rotation_intervals
list<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_based_ad_rotation_id_blocks to specify ad creative for each date range.

time_start
datetime

Time start

time_stop
datetime

Time stop

tune_for_category
enum{NONE, EMPLOYMENT, HOUSING, CREDIT}

tune_for_category

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter
80004There 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.
200Permissions error
105The number of parameters exceeded the maximum for this operation
294Managing advertisements requires an access token with the extended permission for ads_management
2641By law, we cannot serve ads to the following countries
900No such application exists.
2625The request for a reach frequency campaign is invalid.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.