Ads
Promote your posts by making them into ads using Ayrshare' API.
Take your posts to the next level by promoting them as ads using our Twitter promoted Tweets API. We currently only support Twitter Promoted Tweets. Additional social networks are coming soon.

Promoting Ads via an API

Promoting a Tweet turns a Tweet into an advertising campaign via the Promote a Tweet API. You can set a budget, target demographics, and more.
In the Twitter Ads Manager you'll create a campaign and ads groups. Tweets added to a group are "promoted" and will automatically run based on the settings of the campaign and group they are contained in.
You can create up to 100 ads groups in a campaign and 200 ads in an ads groups.
After you create the campaign and at least one ads group, you can use the API to promote Tweets. Any Tweet you posted to your account can be promoted, whether it came through Ayrshare or was manually posted.
After submitting the promoted Tweet, it might be in a "pending" state. This means that Twitter is reviewing the ad. Once approved the ad will run.

Activate Ads for Twitter

In the Ayrshare Dashboard, go to the Social Accounts page.
Click the "Activate Ads" to enable Twitter Promoted Ads.
Click to enable Promoted Tweets
Choose upgrade and your account will be enabled for promoting Tweets via the API.
Activated Promote Tweets
To deactivate ads, please contact us.

Set Up a Twitter Ads Campaign

The first step is to create a Twitter Ads campaign.
  • Log in to Twitter with the handle you want to manage ads.
  • In the upper left corner click "Create Campaign".
  • Choose your objective from the selections and click "Next."
Choose Objective
  • Complete the campaign settings, including setting a budget. The budget will be used to fund the ads. Click "Next".
Set up campaign
  • Create an Ads Group, including a target audience. Click "Next".
Set Up Ads Group
  • Once done, "Launch Campaign".

Promote Tweets API

There are three key pieces of information needed to promote a Twitter tweet via the API:
  • Campaign ID
  • Group ID
  • Tweets IDs
get
https://app.ayrshare.com/api
/ads/twitter/campaigns
/ads/twitter/campaigns
get
https://app.ayrshare.com/api
/ads/twitter/groups
/ads/twitter/groups
put
https://app.ayrshare.com/api
/ads/twitter/ids
/ads/twitter/ids
1
{
2
"campaign": "19ce59w5t0n",
3
"group": "jpe9q"
4
}
Copied!
post
https://app.ayrshare.com
/ads
/ads
ads body parameter format:
1
{
2
"ads": [
3
{
4
"platform": "twitter",
5
"ids": ["1286598420132356849", "4286998420132356848"],
6
"campaign": "18ce55allco",
7
"group": "6f1jas"
8
},
9
{
10
"platform": "twitter",
11
"ids": ["5286998420232356849"],
12
"campaign": "18ce55allco",
13
"group": "6f1jas"
14
}
15
]
16
}
Copied!
Tweets can be sent either as individual array elements or listed in the ids field.
  • platfrom: "twitter"
  • ids: List of Tweet IDs. These can be obtained from the /post response - note, this is the Tweet ID and not the top level post ID. The Tweet does not need to have been sent from Ayrshare. You can use any Tweet you posted to your handle by grabbing from end digits from the Tweet URL: https://twitter.com/AyrShare/status/1384566731180494855
  • campaign: CampaignID from /ads/twitter/campaigns
  • group: Group ID from /ads/twitter/groups
delete
https://app.ayrshare.com/api
/ads
/ads
Delete Twitter ads you posted by specifying the follow ads body parameter:
1
{
2
"ads": [
3
{
4
"platform": "twitter",
5
"ids": ["6s0jes"],
6
"campaign": "17ce35almao"
7
}
8
]
9
}
Copied!
Tweets can be deleted either as individual array elements or listed in the ids field.
  • platfrom: "twitter"
  • ids: List of Promoted Tweet IDs. These can be obtained from the POST /ads response.
  • campaign: CampaignID from /ads/twitter/campaigns
Last modified 30d ago