POST
/
ads
/
facebook
/
boost
curl -X POST https://api.ayrshare.com/api/ads/facebook/boost \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "postId": "1234567890",
    "accountId": "1234567890",
    "adName": "My Ad",
    "status": "active",
    "goal": "engagement",
    "minAge": 18,
    "maxAge": 65,
    "location": "US",
    "budget": 100,
    "bidAmount": 1,
    "startDate": "2025-03-01T00:00:00Z",
    "endDate": "2025-03-07T23:59:59Z",
    "interests": [1234567890, 1234567891]
  }'
{
    "status": "success",
    "adId": "120217670757750410",
    "adName": "API Post - DE6gpw8kxlonHy2b7Lo - 2025-03-26T23:42:43",
    "adStatus": "active",
    "bidAmount": 10,
    "budget": 100,
    "endDate": "2026-03-28T22:30:00Z",
    "goal": {
        "title": "Get More Engagement",
        "description": "This goal seeks to increase engagement...",
        "type": "engagement"
    },
    "interests": [
        "6003195554098"
    ],
    "location": "US",
    "maxAge": 65,
    "minAge": 18,
    "postId": "DE6gpw8kxlonHy2b7Lo",
    "startDate": "2026-03-26T22:30:00Z"
}
Available on Premium, Business, Enterprise plans.

Boost an existing Facebook post to create an ad. This endpoint allows you to convert your organic posts into paid advertisements with custom targeting, budget, and scheduling parameters.

  • Budget and bid amounts must be specified in USD with up to two decimal places.
  • The ad must run for at least 30 hours to address the Facebook requirement.
  • You can use the interests endpoint to find interest IDs for targeting.

  • Facebook may take up to 24 hours to review and approve boosted posts.
  • If using fbPostId directly (instead of Ayrshare postId), ensure it’s a valid Facebook post ID.

Ad Goals

Each ad must have a goal. The goal determines how the ad will be optimized for display.

  • engagement: This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.

  • interactions: Designed to boost interactions, such as likes, comments, and shares, on the ad. Facebook prioritizes showing the ad to users most likely to engage with it.

  • awareness_views: Focuses on increasing brand awareness by maximizing the number of times the ad is displayed. It prioritizes showing the ad as many times as possible within the budget, regardless of unique reach.

  • awareness_audience: Aims to enhance brand awareness by maximizing the number of unique people who see the ad. It ensures that the ad reaches as many different users as possible and maximizes the unique audience size rather than showing it multiple times to the same audience.

Learn more about integrating the Facebook Marketing API with Ayrshare in our Facebook Marketing API Integration Guide.

Header Parameters

Authorization
string
required
API Key of the Primary Profile.

Format: Authorization: Bearer API_KEY
Profile-Key
string
Profile Key of a User Profile.

Format: Profile-Key: PROFILE_KEY

Body Parameters

accountId
string
required

The ID of the Facebook ad account to boost the post on. The account ID can be retrieved from the ad accounts endpoint.

adName
string
required

Name for your ad (appears in Facebook Ad Manager) with the format {adName} - {postId or fbPostId} - {current date}.

bidAmount
number
required

Maximum bid amount in USD. Minimum bid amount is $1.00.

budget
number
required

Total or daily budget in USD. Minimum budget is $10.00.

fbPostId
string
required

The Facebook social post ID of the post to boost, which allows you to create an ad from a post created directly on Facebook. This is the ID of the post on Facebook, not Ayrshare. Required if postId is not set.

goal
string
default:"engagement"
required

The goal of the ad. Values: engagement, interactions, awareness_views, and awareness_audience. See ad goals details above for more information.

locations
array
default:"US"
required

Target ad locations using country codes.

postId
string
required

The Ayrshare post ID of the post to boost. Required if fbPostId is not set.

status
string
default:"active"
required

The status of the ad. Values: active and paused.

You can later change the status of the ad using the update ad endpoint.

tracking
object

Track the ad using a Facebook Pixel.

urlTags
array

Add UTM tags to the ad URL.

{
  "urlTags": [
    "utm_source=ayrshare",
    "utm_medium=social",
    "utm_campaign=ayrshare-social"
  ]
}

For example if the linking URL is https://www.mysite.com/my-post and the URL tags added are:

utm_source=ayrshare, utm_medium=social, and utm_campaign=ayrshare-social.

The ad URL will be: https://www.mysite.com/my-post?utm_source=ayrshare&utm_medium=social&utm_campaign=ayrshare-social.

specialAdCategories
array

Meta requires advertisers in special ad categories to must self-identify their campaign category.

If your business is in one of these categories, you must select the appropriate category when boosting your post.

The following values are supported:

  • housing: Ads that promote or directly link to a housing opportunity or related service, including but not limited to listings for the sale or rental of a home or apartment, homeowners insurance, mortgage insurance, mortgage loans, housing repairs and home equity or appraisal services.

  • financial_product_services: Ads that promote or directly link to a financial products and services offer, including credit.

  • employment: Ads that promote or directly link to an employment opportunity, including but not limited to part- or full-time jobs, internships or professional certification programs. Related ads that fall within this category include promotions for job boards or fairs, aggregation services or ads detailing perks a company may provide, regardless of a specific job offer.

  • issues_elections_politics: Ads made by, on behalf of, or about a candidate for public office, a political figure, a political party or advocating for the outcome of an election to public office. This also includes ads about any election, referendum or ballot initiative, including “Go out and vote” election campaigns. Ads regulated as political advertising or about social issues in any place where the ad is being placed. If selecting issues, elections, or politics, you must select the country in which you want to run these ads. You are required to be authorized to run ads about social issues, elections, or politics in the specified country.

Meta requires advertisers who have self-identified their campaign category. Meta uses human reviewers and machine-learning to identify these kinds of ads. If you send us an incorrect specialAdCategory, there is a risk your ads will be paused until the campaign is adjusted.

endDate
string

End date and time in ISO 8601 format (must be at least 30 hours after start), for example 2025-03-01T00:00:00Z.

If not set, the ad will run indefinitely and have end date of ongoing.

excludeLocations
array

Exclude ad locations for targeting using country codes.

gender
string
default:"all"

The gender of the audience. Values: all, male, female.

interests
array

The target interests of the ad as an array of Facebook interest ids.

maxAge
number
default:65

Maximum age for targeting the ad (default: 65).

minAge
number
default:18

Minimum age for targeting the ad (default: 18).

startDate
string

Start date and time in ISO 8601 format, for example 2025-03-01T00:00:00Z.

If not set, the ad will start immediately.

curl -X POST https://api.ayrshare.com/api/ads/facebook/boost \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "postId": "1234567890",
    "accountId": "1234567890",
    "adName": "My Ad",
    "status": "active",
    "goal": "engagement",
    "minAge": 18,
    "maxAge": 65,
    "location": "US",
    "budget": 100,
    "bidAmount": 1,
    "startDate": "2025-03-01T00:00:00Z",
    "endDate": "2025-03-07T23:59:59Z",
    "interests": [1234567890, 1234567891]
  }'
{
    "status": "success",
    "adId": "120217670757750410",
    "adName": "API Post - DE6gpw8kxlonHy2b7Lo - 2025-03-26T23:42:43",
    "adStatus": "active",
    "bidAmount": 10,
    "budget": 100,
    "endDate": "2026-03-28T22:30:00Z",
    "goal": {
        "title": "Get More Engagement",
        "description": "This goal seeks to increase engagement...",
        "type": "engagement"
    },
    "interests": [
        "6003195554098"
    ],
    "location": "US",
    "maxAge": 65,
    "minAge": 18,
    "postId": "DE6gpw8kxlonHy2b7Lo",
    "startDate": "2026-03-26T22:30:00Z"
}