canonical: https://jentic.com/apis/ads-api.twitter.com/ads-api-twitter

# Ads Api Twitter Twitter Ads API

Jentic publishes the only available OpenAPI specification for Twitter Ads API, keeping it validated and agent-ready. The Twitter Ads API manages paid advertising on Twitter/X: it covers ad accounts, campaigns, line items, promoted tweets, targeting criteria, custom audiences, cards, media, and performance stats, so advertisers can build and optimize campaigns programmatically.

## For AI agents

Create and manage advertising campaigns, line items, and promoted tweets under an ad account, define targeting, build custom audiences, and pull performance stats on Twitter/X.

## Scope

Does not post organic tweets, read the public timeline, or manage direct messages. Use for Twitter/X paid advertising only.

## Capabilities

- Create and manage advertising campaigns within an ad account
- Configure line items that control budgets, bidding, and flight dates
- Promote tweets and manage the creatives shown to audiences
- Define targeting criteria across locations, interests, platforms, and devices
- Build and update custom audiences for retargeting
- Pull performance stats for accounts, campaigns, and line items

## Use cases

### Agent-Driven Campaign Setup

An AI agent can take a campaign brief and build the full structure in an ad account: a campaign, its line items with budgets and bids, and the promoted tweets under them. It applies targeting from the brief so the campaign is ready to launch. Through Jentic the agent discovers each operation by intent and runs it with credentials injected at call time.

Example prompt: Create a campaign in account 18ce54abc123 with a line item targeting US mobile users

### Automated Performance Reporting

Reporting agents pull stats for accounts, campaigns, and line items over a chosen window and summarize spend and engagement. Because the metrics come back structured, the agent can flag underperforming line items without anyone opening the Ads dashboard. This turns daily reporting into a scheduled agent task.

Example prompt: Pull the last 7 days of impressions and spend for every active campaign and summarize it

### Audience Retargeting

An agent can build a custom audience from a list of user identifiers and attach it to a retargeting line item, keeping audiences fresh as new users qualify. This automates the audience-refresh loop that would otherwise be a manual upload. The agent touches only the account it is scoped to.

Example prompt: Build a custom audience from these user IDs and attach it to the retargeting line item

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/accounts` | List ad accounts |
| GET | `/accounts/{account_id}/campaigns` | List campaigns in an account |
| POST | `/accounts/{account_id}/campaigns` | Create a campaign |
| GET | `/accounts/{account_id}/line_items` | List line items |
| POST | `/accounts/{account_id}/promoted_tweets` | Promote a tweet |
| GET | `/stats/accounts/{account_id}` | Retrieve account performance stats |

## Key resources

- **Ad accounts** — The advertising accounts that own campaigns, funding, and audiences
- **Campaigns and line items** — Campaign structure with budgets, bidding, and flight dates
- **Targeting and audiences** — Targeting criteria and custom audiences used to reach users
- **Stats** — Impressions, spend, and engagement metrics by account, campaign, and line item

## Why Jentic

- **Setup:** Wiring the Twitter Ads API by hand means implementing OAuth 1.0a request signing, tracking account and campaign IDs across its 60 operations, and parsing the stats format yourself. Through Jentic you install once, import the API from the Directory, store the OAuth credentials once, and your agent calls it.
- **Permission scoping:** Campaigns, line items, and promoted tweets sit under an account ID in the URL path, so you can scope the agent to one ad account and choose whether it may edit budgets and creatives or only read stats. An agent can be limited to reporting on a single account.
- **Credential handling:** Your Twitter OAuth credentials are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create an ad campaign' or 'pull campaign stats', and Jentic returns the matching Twitter Ads API operation with its input schema so the agent calls the right endpoint without reading the reference docs.

## Related APIs

- **LinkedIn** — LinkedIn runs paid advertising on the professional network instead of Twitter/X.
- **Buffer** — Buffer schedules the organic posts that sit alongside paid Twitter/X campaigns.
- **adhook** — adhook coordinates multi-channel ad campaigns that can include Twitter/X promotions.

## FAQ

### Why is there no official OpenAPI spec for Twitter Ads API?

Twitter/X does not publish an OpenAPI specification for its Ads API. Jentic generates and maintains this spec so that AI agents and developers can call the Twitter Ads API via structured tooling. It is validated against the live API and kept up to date. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Is there a Twitter Ads API MCP server?

You don't need an MCP server to give your agent the Twitter Ads API. Jentic connects it directly from the API Directory: import it, store your OAuth credentials once, and your agent manages campaigns and pulls stats. No extra server sits in the agent's context.

### Can I limit what my agent is allowed to do with the Twitter Ads API?

Yes. Because campaigns, line items, and promoted tweets sit under an account ID in the URL path, you can scope the agent to a single ad account and, within it, allow only read operations such as listing campaigns and pulling stats. It can then report on performance without changing budgets or creatives. Every call is logged.

### What authentication does the Twitter Ads API use?

The Twitter Ads API uses OAuth 1.0a for authentication, per its OpenAPI spec. Through Jentic the OAuth credentials are stored encrypted by your own Jentic One instance and injected when the agent makes a call, so they never appear in the agent's prompt or logs.

### Can my agent pull campaign performance data with the Twitter Ads API?

Yes. The stats operations return impressions, spend, and engagement metrics for accounts, campaigns, and line items over a time range, so an agent can build performance reports without exporting from the Ads dashboard.

### What are the rate limits for the Twitter Ads API?

The OpenAPI spec does not specify rate limits; Twitter/X enforces per-endpoint limits that vary by resource. Check the Twitter Ads API documentation for the current limits before scaling an agent's usage.

### How does my agent create a campaign with the Twitter Ads API through Jentic?

Search Jentic for 'create an ad campaign' and it returns the Twitter Ads API create-campaign operation with its input schema. Store your OAuth credentials once, then the agent supplies the account, budget, and objective and the campaign is created.
