FACEBOOK and INSTAGRAM.
Each operation calls the matching REST ads endpoint and returns its response unchanged. Authentication and limits are the same as REST. A failed call returns a GraphQL error: extensions.status carries the REST status, and extensions.code the Ayrshare error code when the REST error has one. See Errors. Ads operations need the Ads add-on. Without it, every call returns an error with extensions.status 403 and extensions.code 399.
Operations
Every operation also takes an optional
profileKey to act on a User Profile. All of them return the REST response as JSON, so they take no field selection.
List ad accounts
Start here. Use theaccountId values in the response wherever an operation asks for accountId.
Search targeting options
kind picks the search: INTERESTS for audience targeting, REGIONS or CITIES for locations. Each kind takes only its own arguments. For example, countryCode and regionId work only with CITIES, and INTERESTS needs search.
List ads
Pass at least one ofcampaignId, accountId, adId, postId or socialPostId. socialPostId is the network’s own post id, for posts not published through Ayrshare.
See what an ad has cost
Pause or resume an ad
updateAd changes real ad spend. PAUSED stops spending, ACTIVE resumes it, and DELETED or ARCHIVED retires the ad. The same status is also set on the ad’s ad set and campaign, so any other ads in that ad set or campaign change with it. A campaign or ad set the boost was attached to with attachTo keeps its own status, and the ad runs only while the campaign and ad set above it are active.
Boost a post
boostPost spends real money from the ad account. It turns a published post into an ad.
- Pass
postId(the Ayrshare post id) orsocialPostId(the network’s own post id). - Get
accountIdfromadAccounts. budget.amountis in the ad account’s currency. Leavebudgetout only whenattachTo.adSetIdadds the ad to an ad set you already run, which keeps its own budget. Leavetargetingout then too: the ad set keeps its own. See Boost into an Existing Campaign or Ad Set.schedule,targeting,callToAction,attachToandstatusare optional. If you leave outstatusandschedule, the ad is active, starts now and has no end date, so it keeps spending until you pause it. Setstatus: PAUSEDorschedule.endto limit it.- Put settings that only one platform has under
platformOptions, keyed by platform. On Facebook and Instagram,adNameandbidAmountare required there, for exampleplatformOptions: { facebook: { adName: "Autumn sale", bidAmount: 2 } }. Without them the boost returns a missing-fields error. WithattachTo.adSetId, leavebidAmountout: the ad set keeps its own bid. - On Facebook and Instagram, Meta refuses the ad until the ad account has a payment method attached and, in the EU, EEA and Switzerland, personalized ads are turned on for the account linked to the Page. See Boost Post.
JSON type:
accountIdtakes a string or a number.- The
scheduledates take an ISO 8601 date or date-time, such as"2026-10-10T09:00:00Z". Use that form rather than a number.schedule.endalso takes0for no end date. - Location keys take one value or a list.
targeting.intereststakes ids as strings or numbers.platformOptionstakes an object.
updateAd with status: PAUSED. boostFacebookPost and instagramBoostPost still work.
The per-platform operations, such as facebookAdAccounts and instagramAds, still work and are unchanged.