Create a campaign via X (Twitter) Ads API

domain: developer.x.com/en/docs/x-ads-api · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Authenticate using OAuth 1.0a with your X developer app credentials (consumer key, consumer secret, access token, access token secret) and ensure the app has Ads API access.
  2. POST to https://ads-api.x.com/12/accounts/{ACCOUNT_ID}/campaigns with params: funding_instrument_id (obtain from GET /funding_instruments), name, status (PAUSED), start_time, and objective (e.g. TWEET_ENGAGEMENTS, WEBSITE_CLICKS).
  3. Capture the campaign id and create a line item by POSTing to /accounts/{ACCOUNT_ID}/line_items with campaign_id, name, product_type, placements, objective, bid_amount_local_micro, and status (PAUSED).
  4. Create a Promoted Tweet by associating an existing tweet with the line item via POST to /accounts/{ACCOUNT_ID}/line_item_apps or the promoted tweets endpoint.
  5. Set line item and campaign status to ACTIVE when ready; confirm with GET /accounts/{ACCOUNT_ID}/campaigns/{CAMPAIGN_ID}.
  6. Monitor delivery via GET /stats/accounts/{ACCOUNT_ID} with granularity, start_time, end_time, and entity/entity_ids parameters.

Known gotchas

Related routes

Create a campaign via TikTok Ads API
ads.tiktok.com/marketing_api/docs · 6 steps · unrated
Create a campaign via Pinterest Ads API
developers.pinterest.com/docs/api/v5 · 6 steps · unrated
Create a campaign via Reddit Ads API
ads-api.reddit.com/docs · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans