Skip to content

X Ads

Your agent promotes the X post that already earned replies to people who follow the accounts your buyers follow, signed in as you.

Connect
Sign in once, 1 grant
Runs through
A browser agent
First run
Find which of your posts earned the most replies, about 0.03¢
Sites
X
Campaign.create
You, to your agent

Promote my late-rent thread for $100 over 5 days to followers of the 8 accounts property managers follow.

curl -X POST "https://api.sb/leaseline.app/campaigns/create?mode=try" \
  -H "Authorization: Bearer $SB_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"venue":"x","objective":"engagement","promote":"posts/x-late-rent-thread","budget":{"amount":100,"currency":"USD","per":"test"},"audience":{"followersOf":8}}'
npx startup-builder do Campaign.create --try --data '{"venue":"x","objective":"engagement","promote":"posts/x-late-rent-thread","budget":{"amount":100,"currency":"USD","per":"test"},"audience":{"followersOf":8}}'
{
  "name": "do",
  "arguments": {
    "mode": "try",
    "code": "return await $.Campaign.create({ venue: 'x', objective: 'engagement', promote: 'posts/x-late-rent-thread', budget: { amount: 100, currency: 'USD', per: 'test' }, audience: { followersOf: 8 } })"
  }
}
import { $ } from 'startup-builder'

const result = await $.try.Campaign.create({ venue: 'x', objective: 'engagement', promote: 'posts/x-late-rent-thread', budget: { amount: 100, currency: 'USD', per: 'test' }, audience: { followersOf: 8 } })
Response
{
  "$type": "Campaign",
  "mode": "try",
  "stored": false,
  "venue": "x",
  "promoting": "posts/x-late-rent-thread",
  "organic": {
    "replies": 14,
    "impressions": 3200
  },
  "budget": {
    "amount": 100,
    "currency": "USD",
    "days": 5
  },
  "readAt": "5,000 impressions",
  "runsBy": "browser",
  "steps": 14
}
Try mode reads, stores nothing and spends nothingAPI referenceIts Nouns

Connect once

  1. Call Integration.connect with system: 'ads' and venue: 'x'; a browser window opens on X Ads.
  2. Sign in with the X account you post from; the session is saved to your browser profile.
  3. Set the spend on your standing approval with Mandate.authorize; X bills your ad account, never the platform.
GrantWhat it unlocksScope
Your saved X Ads sessionPromoting a post, its audience, budget and results, in X’s own screensbrowser session: ads.x.com
ToDo this
PauseIntegration.pause holds every run that needs your X Ads session; the session stays saved.
ReconnectIntegration.reconnect opens a browser window where you sign in to X Ads once more; the saved session replaces the old one.
DisconnectIntegration.revoke deletes the saved X Ads session; every Post and reply it made stays in your records.

What your agents do

AskVerbRuns throughPrice
Promote that post for $100 to followers of these 8 accounts, signed in as me.Campaign.createA browser agentAbout 1.6¢ a step
Stop the promotion, signed in as me.Campaign.updateA browser agentAbout 1.6¢ a step
Show me impressions, replies and link clicks on the promoted post, signed in as me.Metric.queryA browser agentAbout 1.6¢ a step

Calls on your own account are free; X bills your spend directly.

Reading this site’s public data needs no account: Keyword.search is a Data call (the three ways a call runs).

What it holds

NounThe account’s objectWhenWhich side leads
Campaigncampaign and ad groupYour agent promotes a postYour records
Adpromoted postYour agent promotes it; X’s review sets its statusYour records
MessagereplySomeone repliesThe account

Events and webhooks

DirectionEvent
EmitsCampaign.created, Campaign.updated, Entry.posted, Message.created

Any Event can wake a Workflow, and a Watch delivers it to your endpoint, signed (Events and webhooks).

Limits

WhatLimitCall
Ad reviewX reviews every promoted post; a rejection comes back as venue-rejected with the reasonCampaign.create
What gets promotedA post already on your account, as it is; the agent never writes a post only for the adCampaign.create
SpendYour standing approval holds the cap; a change past it waits with over-mandateCampaign.update
Post length280 weighted characters on a standard account, a link counting as 23 wherever it pointsCampaign.create

Start here

MoveThe rule
StructureOne campaign promoting one post that earned replies on its own, aimed at followers of 5 to 10 accounts your buyers follow.
Budget$100 for the first test over 5 days, and only on a post that already started conversations.
CreativeThe post as it earned its replies; if it carries no link, your agent adds the link in the first reply, not in an edit.
Kill ruleAt 5,000 impressions, stop if the promoted post earns fewer replies per 1,000 impressions than it did on its own.
BenchmarkSource
Promote only a post with 3 or more replies from buyersOur planning number
Judge at 5,000 impressionsOur planning number
A link counts as 23 of the 280 charactersX developer docs

Field map

Our fieldX Ads’s fieldNotesCalls
Campaign.objectivecampaign objectivePicked in X Ads: traffic is website traffic; engagement is post engagementCampaign.create, Campaign.update
Campaign.targetingfollower look-alikesOf the accounts you nameCampaign.create
Campaign.budgetcampaign total and daily budgetNone.Campaign.create, Campaign.update
Campaign.startsAtad group start timeNone.Campaign.create
Campaign.endsAtad group end timeNone.Campaign.create, Campaign.update
Campaign.statecampaign statuslive is active, paused pausedCampaign.update
Campaign.bidad group bid strategylowest-cost is autobid; a costPer cap is a target costCampaign.create, Campaign.update
Campaign.keywordskeyword targetingReaches people who searched or posted the words lately, beside the follower look-alikesCampaign.create
Ad.landingUrlwebsite card URLAdded in the first reply when the post carries no linkCampaign.create

What try does here

Returns the promotion as X Ads will hold it, with the steps the browser agent would take; no session opens and nothing is promoted.

How long a connection lasts

A connection lasts as long as the site keeps your saved session signed in; the platform checks the session before every run.

The platform asks you to reconnect 7 days before it runs out; until you do, a call that needs it refuses with needs-reauth.

Formats

SiteFormatSizeLimits
XStandard postNone.280 weighted characters; a link counts as 23 and an emoji as 2
XPromoted postNone.A post already on your account, promoted as it is

Plays and strategies

KindWhere
PlaysPaid social, Promote winners
StrategiesPaid

Used by

No Workflow, agent task or Service acts through it yet: your agents call it directly.

Reference

3 calls, each with its path and price
CallPathPrice
Campaign.createPOST /campaigns/createAbout 1.6¢ a step
Campaign.updatePOST /campaigns/updateAbout 1.6¢ a step
Metric.queryPOST /metrics/queryAbout 1.6¢ a step

Contents