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.
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).
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).
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.
Set line item and campaign status to ACTIVE when ready; confirm with GET /accounts/{ACCOUNT_ID}/campaigns/{CAMPAIGN_ID}.
Monitor delivery via GET /stats/accounts/{ACCOUNT_ID} with granularity, start_time, end_time, and entity/entity_ids parameters.
Known gotchas
The X Ads API uses OAuth 1.0a (not 2.0 bearer token) for most write operations — attempting to use a bearer token for campaign mutations results in an authorization error.
API version numbers in the URL path (e.g. /12/) change periodically; verify the current production version in X's developer documentation, as older versions may return deprecation warnings.
Funding instruments must be active and have sufficient funds; a campaign cannot be activated without a valid, funded funding instrument linked to the account.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp