ajarshem
ajarshem

Reputation: 11

Facebook Ads API Update AdSet Budget - Adset already exists, not looking to create adset via api

Facebook (as usual) has incredibly unhelpful documentation on their API. I am trying to do a simple task of updating an adset's budget. The adset already exists in my account so I am not looking to create an adset via the api - though that is apparently all facebook would like you to do.

I've done this successfully at the campaign level by making a simple request to the api with this (simplified) call

var headers = {
    'method': 'POST',
}

var url = `https://graph.facebook.com/v16.0/${campaignID}?daily_budget=${newBudget}&fields=daily_budget&transport=cors&access_token=${fbToken}`

Unfortunately, making the same request, but with an adset ID instead of a campaign ID, throws an error saying "Unsupported request - method type: post". I have attempted to run the request as a GET method, however that just seems to return the current budget (which makes perfect sense).

I have also found some documentation on facebook's website here: https://developers.facebook.com/docs/marketing-api/bidding/overview/budgets

Unfortunately, even if you provide an existing adset ID as a parameter in the payload, it still only allows you to create an adset at this endpoint. There does not appear to be a way to update the budget of an existing adset as far as I can tell.

UPDATE

There seems to be something wrong with the adset I am attempting to update. I successfully updated the budget of a different adset from an older campaign with no issue. Wondering if maybe there is a period of time before an adset becomes available as an edge on the graph api.

Upvotes: 1

Views: 816

Answers (1)

Santhosh Gandhe
Santhosh Gandhe

Reputation: 6960

I am able to update daily_budget of an adset with the below API invocation

curl --location 'https://graph.facebook.com/?access_token=__fb_token' --header 'Content-Type: application/json' --data 'batch=[ { "method": "POST","relative_url": "v16.0/{ad_set_id}", "body": "daily_budget=10200" }]' 

But it has many other constraints around, how you should update, and the impact of your update influenced by many other settings. Read below facebook documentation page for more details.

https://developers.facebook.com/docs/marketing-api/adset/budget-limits/v16.0

Upvotes: 1

Related Questions