CAN_USE_REACH_AND_FREQUENCY parameter.stop_time must be within 180 days of a prediction.GET API call to https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>?fields=rf_spec.target_spec.user_os, such as iOS_ver_2.0_and_above.PacingType field.rf_spec for applicable limits:| Name | Description |
|---|---|
countries
array
| Supported countries for reservation |
min_campaign_duration
object
| Minimum campaign duration in days, per supported country |
max_campaign_duration
object
| Maximum campaign duration in days, per supported country |
max_days_to_finish
object
| Days in advance campaign can finish at time prediction made, per supported country |
min_reach_limits
object
| Minimum reach in number of Accounts Center accounts, per supported country |
{
"rf_spec": {
"min_reach_limits": {
"US": 1000000,
"CA": 1000000,
},
"countries": [
"US",
"CA",
],
"min_campaign_duration": {
"US": 3,
"CA": 3,
},
"max_campaign_duration": {
"US": 30,
"CA": 30,
},
"max_days_to_finish": {
"US": 56,
"CA": 56,
}
}
}
reachfrequencypredictions for an account, make a HTTP GET to https://graph.facebook.com/{API_VERSION}/act_{AD_ACCOUNT_ID}/reachfrequencypredictions?fields={COMMA_SEPARATED_FIELD_LIST}.reachfrequencypredictions based on a reachfrequencyprediction ID, make a HTTP GET with fields, you want: https://graph.facebook.com/{API_VERSION}/{RF_PREDICTION_ID}?fields={COMMA_SEPARATED_FIELD_LIST}.status results in reachfrequencyprediction. Initial limitations appear when applicable, however they may vary per ad account or by country in the future:| Code | Status | Description |
|---|---|---|
1 | SUCCESS | Prediction successful |
2 | PENDING | Prediction still being produced |
3 | FAIL | Unreachable audience. Too high reach or budget. |
4 | FAIL | Prediction settings invalid, for example, duration |
5 | FAIL | targeting_spec invalid |
6 | FAIL | Budget or bid for given reach too low |
7 | FAIL | Too short ad set length |
8 | FAIL | Too long ad set length |
9 | FAIL | Ad set end date too far in future |
10 | FAIL | Frequency cap not specified |
11 | FAIL | Ad placement not supported, such as mixed RHS and Feed |
12 | FAIL | Ad set dates issues (start time and/or end time): Start time in past, not midnight, or not full day. End time in past, exceeds 90 days of start time or doesn’t end after 6AM. |
13 | FAIL | Targeted country not yet supported |
14 | FAIL | Ad set dates include blackout days |
15 | FAIL | Insufficient inventory, unable to reserve. See Reserving a Prediction. |
16 | FAIL | Minimum reach required for account not achieved. See Getting Account Restrictions |
17 | FAIL | Actual reach available for this prediction is less than the minimum reach of the targeted country, usually 200,000 for most countries. |
18 | FAIL | Invalid day parting schedule provided. |
19 | FAIL | Target CPM unachievable. |
20 | FAIL | Frequency cap too low for blended delivery |
21 | FAIL | Ads inventory changed significantly enough for inaccurate prediction. |
23 | FAIL | Frequency cap interval not supported in target country. |
24 | FAIL | Holdout Lift Study ad set under account or campaign group not consistent with reservation prediction. |
25 | FAIL | Frequency cap can’t exceed the number of days your campaign runs. |
26 | FAILURE_EMPTY_AUDIENCE | Selected audience empty and unusable. |
27 | FAIL | No modification allowed on your running campaign. |
28 | FAIL | Cannot modify running campaign created with Insertion Order. |
29 | FAIL | Cannot modify running campaign due to time constraints. |
30 | FAIL | To edit a running reservation ad set, choose a budget higher than current spend. |
31 | FAIL | Lift Study for account or campaign group starts after campaign starts. |
32 | FAIL | Lift study for account or campaign group ends before campaign ends. |
35 | FAIL | Cannot set Reservation campaign start time to be in the past. |
36 | FAIL | Please make sure the duration of the Reservation ad set is longer than one day and the campaign start/end time is valid. |
37 | FAIL | The objective isn’t supported by Audience Network with the reservation buying type. |
39 | FAIL | Selected placements combination can’t be used when buying with reservation. |
40 | FAIL | Specific mobile OS versions can’t be targeted with the reservation buying type. |
41 | FAIL | Friends of connections can’t be targeted with the reservation buying type. |
42 | FAIL | Reservation campaigns are not able to run when Audience Network is selected as the only placement. Please select the Audience Network placement with either Facebook Feed or Instagram Feed as additional placements. |
44 | FAIL | Reservation doesn’t support Facebook Story. |
45 | FAIL | To use Facebook Stories as a placement, please also select either Facebook Feeds or Instagram Stories. |
50 | FAIL | Selected placements combination can’t be used when buying with Reservation. For Reservation IO buying, please ensure the objective is Video Views. Otherwise, to use Facebook In-Stream, please select the Facebook Feeds placement. |
53 | FAIL | The in-stream video placement is available only for audiences in the US, the UK, Australia, New Zealand, Ireland, Thailand, Mexico, Peru, France, Germany, Argentina, Colombia, Spain, Chile, Ecuador, Dominican Republic, Guatemala, Bolivia, Honduras, El Salvador, Norway, Sweden, the Netherlands, Belgium, Poland, Portugal, Denmark, India, Malaysia, the Philippines, Indonesia, and Vietnam. To continue, edit your audience to include only people in those countries. |
60 | FAIL | To use Facebook Marketplace, please select the Facebook Feeds placement. |
66 | FAIL | Facebook Right Column Placement Cannot Be Combined with Other Placements. |
69 | FAIL | If you would like your ad shown on the Explore section of Instagram, you will also need to select Instagram Feed as a placement. |
100+ | FATAL | System failure, no user fault. Retry. |
reachfrequencyprediction for a set time with reserve for action. You can use a single prediction ID to create multiple reservations. For example:curl \
-F 'action=reserve' \
-F 'rf_prediction_id=<RF_PREDICTION_ID>' \
-F 'access_token=<ACCESS_TOKEN>' \
'https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/reachfrequencypredictions'
// Response
{"id":9876543210"}
POST API call to https://graph.facebook.com/{API_VERSION}/act_{AD_ACCOUNT_ID}/reachfrequencypredictions.reach, budget, and impression, you can reserve a prediction at a specific point on curve_budget_reach rather than the original tuple of prediction reach/budget. Use these fields:| Name | Description |
|---|---|
rf_prediction_id
int
| Required. reachfrequencyprediction ID |
action
string
| Required for reservation and cancellation. Options are:
|
rf_prediction_id_to_release
int
| Optional. Reserved prediction or reservation ID. A new reservation releases a reserved audience and uses it for the new reservation. See Reusing Reserved Audiences |
rf_prediction_id_to_share
int
| Optional. ID of previously created prediction. New predictions use the audience from a given prediction.
Note: rf_prediction_id_to_share must be set to a valid prediction ID to use either the TRAFFIC objective or the POST_ENGAGEMENT and LINK_CLICKS optimizations. See the changelog for more information. |
reach
int
| Optional. If specified, provide budget and impression.Specify reach, budget, and impression for that point on curve_budget_reach. You can override this value. |
budget
int
| Optional. If specified, provide reach and impression.Specify reach, budget, and impression for that point on curve_budget_reach. You can override this value. |
impression
int
| Optional. If specified, provide reach and budget.You can override this value. To do so, specify the reach, budget, and impression for that point on curve_budget_reach. |
2 (PENDING). On completion, status is 1, SUCCESS, or 15, FAIL which means we lack inventory to complete this reservation.curl \
-F "rf_prediction_id=<RF_PREDICTION_ID>" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<AD_SET_ID>"
start_time - derived from predictionend_time - derived from predictiontargeting - derived from predictionbid_amountoptimization_goallifetime_budget or daily_budgetrf_prediction_id which attaches the prediction to the new ad set.buying_type is RESERVEDreachfrequencyprediction to ad sets to modify its prediction. Making a POST request to https://graph.facebook.com/{ad_set_id} with rf_prediction_id for the reachfrequencyprediction you want to use.facebook, instagram.feed, and rightcolumn.stream, story, explore, explore_home and reels. If placement includes instagram, you must use destination_ids, not destination_id. The destination_ids field should contain the Facebook Page ID used as destination_id, plus the Instagram account ID.promoted_object must match the prediction’s destination_id. For page posts, it must be the page ID specified and for app ads, it must match the app ID specified.HTTP POST request to the set and set rf_prediction_id to 0. You can only modify the name attribute on the ad set object.curl \
-F "rf_prediction_id=0" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<AD_SET_ID>"
namecreative_idcreative_specconversion_specstracking_specsview_tagsPOST to reachfrequencypredictions. See Create a Prediction and Reserve the Prediction. You should pass an existing_campaign_id for the active set to be reactivated in the request. After you create and reserve a new prediction, attach reachfrequencyprediction to the ad set with HTTP POST to: https://graph.facebook.com/{ad_set_id} specifying rf_prediction_id for the prediction you want to use.reachfrequencyprediction to the ad set by making a HTTP POST request to: https://graph.facebook.com/{ad_set_id} specifying rf_prediction_id as the id of the reachfrequencyprediction you want to use.rf_prediction_id_to_share when you create a reservation. This is the ID of a previous prediction. This invalidates the previous reservation, so you can use this inventory for your newly created reservation.rf_prediction_id_to_release which is the ID of the previous reservation.creative_sequence. Each individual ad in this ad set may not appear, appear once, or appear multiple times in the sequence.creative_sequence array length is zero, then you’re using no sequencing. If the length is not zero, we recommend you make it equal frequency_cap in rf_prediction_id. If the length is larger than frequency_cap, we truncate the last several ads from the array. If the length is less than frequency_cap, we recursively auto-fill the array by repeating the sequence from the beginning. To make results clear, set the length of creative_sequence to the same amount as frequency_cap.ACTIVE, PENDING_REVIEW, or CREDIT_CARD_NEEDED status. A particular ad in the sequence will only be delivered to a user if all the preceding ads in the sequence have been delivered. Ads not included in the creative_sequence will not be delivered.buying_type of its parent ad campaign is RESERVED, and this ad set has rf_prediction_id set.buying_type set to RESERVED.| Code | Description |
|---|---|
1487583 | An ad set with no ads cannot be assigned a reservation prediction |
1487055 | Ad set status invalid |
1487600 | Ad set is already assigned to a reservation. If you want to use another prediction, please first disconnect current from the set using null value and then assign a new prediction. |
1487578 | The specified reachandfrequencyprediction ID does not exist, or does not belong to the account given. |
1487581 | Reservation prediction cannot be modified on an active ad set |
1487594 | No ads in reservation ad set |
1487595 | Invalid Target Spec in reservation ad set |
1487614 | Ad set start time does not match with original prediction |
1487615 | Ad set stop time does not match with original prediction |
1487616 | Cannot associate ad set with invalid prediction |
1487671 | Direct transition from one prediction to another for an ad set is not allowed. |
1487244 | Ad set Update Failed - reason should be given in response |
1487672 | Failed to assign prediction to ad set. |
1487680 | You don’t have permission to use reservation ad sets. |
reachfrequencyprediction for an app destination_id:curl \
-F 'target_spec={"geo_locations": {"countries":["US"]}, "age_max":35, "age_min":26, "genders":[2], "publisher_platforms":["facebook"], "facebook_positions":["feed"]}' \
-F 'start_time=1388534400' \
-F 'end_time=1389312000' \
-F 'frequency_cap=4' \
-F 'reach=1000000' \
-F 'budget=3000000' \
-F 'destination_id=<APP_ID>' \
-F 'prediction_mode=1' \
-F "objective=MOBILE_APP_INSTALLS" \
-F 'access_token=<ACCESS_TOKEN>' \
'https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/reachfrequencypredictions'
{"id":"67890123456"}
reachfrequencyprediction for a page destination_id:curl \
-F 'target_spec={"geo_locations": {"countries":["US"]}, "age_max":35, "age_min":26, "genders":[2], "publisher_platforms":["facebook"], "facebook_positions":["feed"]}' \
-F 'start_time=1388534400' \
-F 'end_time=1389312000' \
-F 'frequency_cap=4' \
-F 'reach=1000000' \
-F 'budget=3000000' \
-F 'destination_id=<PAGE_ID>' \
-F 'prediction_mode=1' \
-F "objective=POST_ENGAGEMENT" \
-F 'access_token=<ACCESS_TOKEN>' \
'https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/reachfrequencypredictions'
{"id":"67890123456"}
reachfrequencyprediction for an app destination_id with Instagram placement:curl \
-F 'target_spec={"geo_locations": {"countries":["US"]}, "age_max":35, "age_min":26, "genders":[2], "publisher_platforms":["facebook","instagram"], "device_platforms":["mobile"]}' \
-F 'start_time=1388534400' \
-F 'end_time=1389312000' \
-F 'frequency_cap=4' \
-F 'reach=1000000' \
-F 'budget=3000000' \
-F 'destination_ids=[<APP_ID>,<INSTAGRAM_ACCOUNT_ID>]' \
-F 'prediction_mode=1' \
-F "objective=MOBILE_APP_INSTALLS" \
-F 'access_token=<ACCESS_TOKEN>' \
'https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/reachfrequencypredictions'
{"id":"67890123456"}
2:https://graph.facebook.com/67890123456?fields=status
1 (successful), then this can be attached to an ad set or reserved.curl \
-F 'action=reserve' \
-F 'rf_prediction_id=<RF_PREDICTION_ID>' \
-F 'access_token=<ACCESS_TOKEN>' \
'https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/reachfrequencypredictions'
{"id":"9876543210"}
2:https://graph.facebook.com/<API_VERSION>/<PREDICTION_ID>?fields=status
1 (successful), then this can be attached to an ad set. Let’s set up your campaign structure by creating a campaign, an ad set, a creative, an ad, and assigning the reservation to the ad set.curl \
-F "name=Test" \
-F "buying_type=RESERVED" \
-F "status=ACTIVE" \
-F "objective=POST_ENGAGEMENT" \
-F "access_token=<ACCESS_TOKEN>" \
https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/campaigns
{"id":"1122334455"}
curl \
-F "name=TestReachSet" \
-F "status=1" \
-F "campaign_id=<CAMPAIGN_ID>" \
-F "rf_prediction_id=<RF_PREDICTION_ID>" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adsets"
{"id":"09876543"}
curl \
-F "name=sample creative" \
-F "type=1" \
-F "title=hello world" \
-F "body=hi i'm an ad" \
-F "link_url="https://www.facebook.com/" \
-F "image_hash=4aca812b4eadb72818a2c4124abd121a" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adcreatives"
{"id":"1323123123123"}
// Create an ad
curl \
-F "name=my ad" \
-F "adset_id=<AD_SET_ID>" \
-F "creative={'creative_id':<CREATIVE_ID>}" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/ads"
{"id":"3213213123"}
curl \
-F "rf_prediction_id=<RF_PREDICTION_ID>" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<AD_SET_ID>"