Skip to content

X Ads

Create campaigns and promote tweets via Zernio API - OAuth 1.0a and approval handled for you

Included with the Usage plan. No X Ads API approval application needed. OAuth 1.0a request signing is handled server-side.

accountId accepts either shape. Pass the posting X/Twitter account ID or the X Ads credential account ID, Zernio resolves the sibling internally so either value works. If no X Ads credential is connected for the resolved profile, the API returns code: "ads_connection_required".

What's Supported

FeatureStatus
Standalone campaigns (Campaign > Line Item > Promoted Tweet)Yes
Promote existing tweetsYes
Location + language targetingYes
Real-time analytics (spend, CPE, CPM, link clicks)Yes
OAuth 1.0a signing handledYes
Keyword targetingRoadmap
Follower look-alike targetingRoadmap
Tailored AudiencesRoadmap

Promote an Existing Tweet

typescript
const ad = await zernio.ads.boostPost({ body: {
  postId: "POST_ID",
  accountId: "ACCOUNT_ID",
  adAccountId: "18ce54d4x5t",
  name: "Boost launch tweet",
  goal: "engagement",
  budget: { amount: 50, type: "daily" },
  schedule: { startDate: "2026-04-20", endDate: "2026-04-27" },
}});
python
ad = client.ads.boost_post(
    post_id="POST_ID",
    account_id="ACCOUNT_ID",
    ad_account_id="18ce54d4x5t",
    name="Boost launch tweet",
    goal="engagement",
    budget={"amount": 50, "type": "daily"},
    schedule={"startDate": "2026-04-20", "endDate": "2026-04-27"},
)
bash
curl -X POST "https://zernio.com/api/v1/ads/boost" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "postId": "POST_ID",
    "accountId": "ACCOUNT_ID",
    "adAccountId": "18ce54d4x5t",
    "name": "Boost launch tweet",
    "goal": "engagement",
    "budget": { "amount": 50, "type": "daily" },
    "schedule": { "startDate": "2026-04-20", "endDate": "2026-04-27" }
  }'

Create a Standalone Campaign

typescript
const ad = await zernio.ads.createStandaloneAd({ body: {
  accountId: "acc_xads_123",
  adAccountId: "18ce54d4x5t",
  name: "Q2 Product Awareness",
  goal: "awareness",
  budgetAmount: 75,
  budgetType: "daily",
  body: "Ship faster with platform engineering done right.",
  linkUrl: "https://example.com/platform",
  countries: ["US"],
}});
python
ad = client.ads.create_standalone_ad(
    account_id="acc_xads_123",
    ad_account_id="18ce54d4x5t",
    name="Q2 Product Awareness",
    goal="awareness",
    budget_amount=75,
    budget_type="daily",
    body="Ship faster with platform engineering done right.",
    link_url="https://example.com/platform",
    countries=["US"],
)
bash
curl -X POST "https://zernio.com/api/v1/ads/create" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "acc_xads_123",
    "adAccountId": "18ce54d4x5t",
    "name": "Q2 Product Awareness",
    "goal": "awareness",
    "budgetAmount": 75,
    "budgetType": "daily",
    "body": "Ship faster with platform engineering done right.",
    "linkUrl": "https://example.com/platform",
    "countries": ["US"]
  }'

For X, body is the tweet text (max 280 chars; X shortens linkUrl to ~24 chars against that limit). headline, imageUrl, and callToAction are ignored on X. Valid goal values: engagement, traffic, awareness, video_views, app_promotion.

OAuth 1.0a

The X Ads API uses OAuth 1.0a request signing (not OAuth 2.0 Bearer tokens). Zernio computes HMAC-SHA1 signatures server-side, so your integration uses a standard Bearer token like every other platform.

Media Requirements

TypeFormatMax SizeNotes
ImageJPEG, PNG, GIF, WebP5 MB1200x675 (16:9) recommended
VideoMP4, MOV1 GB0.5-140 sec, H.264+AAC
Tweet textUTF-8280 charsStandard limit
Website CardURL + text70 char titleLanding page card