Overview

What the Media Ops API and MCP server do, and how they relate to the web app.

🇧🇷 Ler em português

Media Ops is Infotráfego's Meta Ads campaign creator. Everything the team does in the web app — picking the client/Business Manager/ad account, looking up audiences, building and publishing campaigns, extending campaigns and ad sets, retrying failures, creating engagement audiences, managing targeting templates, clients, balances and users — can also be done through:

ChannelForAuthentication
REST API (/api/v1)Automations and systems (n8n, scripts, backends)API key or OAuth 2.1 token
MCP server (/api/mcp)AI assistants (Claude, ChatGPT, Cursor, Claude Code)OAuth 2.1 (or API key)
Web appMedia buyersLogin (session)

Restricted to the team

The documentation is public, but the API is not: every call needs the credentials of a user registered in Media Ops. Accounts are created by administrators only.

One rule set, three channels

Business rules live only on the server. The web app, the API and MCP call the same services, so:

  • campaign validation is the same everywhere (required fields, allowed conversion objectives, call-to-action buttons per objective, UTM confirmation, carousel limits, etc.);
  • the client/BM/ad account selection is always re-checked on the server: an archived client, an account from another BM, or an account that was disabled manually or is inactive on Meta is refused with 403;
  • the creation pipeline (campaign → ad sets → media → creatives → ads), the audience pre-flight, the automatic wait when Meta throttles the account and the smart retry are identical;
  • everything is created PAUSED. Activation still happens in Meta Ads Manager.

Endpoints

ItemURL
API base URLhttps://media.ops.infotrafego.com.br/api/v1
OpenAPI 3.1 specificationhttps://media.ops.infotrafego.com.br/api/v1/openapi.json?lang=en
MCP serverhttps://media.ops.infotrafego.com.br/api/mcp
API keys and authorized appsWeb app → Integrações (Integrations)

Asynchronous model

Creating a campaign takes from a few seconds to several minutes (video uploads, Meta rate limits). That is why:

  1. POST /campaigns answers 202 with a job_id;
  2. the server runs the creation in the background — closing the connection stops nothing;
  3. poll GET /executions/{job_id}/progress until the status is success, partial or error.

The same applies to POST /audiences/engagement and POST /executions/{job_id}/retry.

Conventions

  • JSON bodies and responses (UTF-8). Field names are in English; messages are in Brazilian Portuguese (user_message), ready to show to end users.
  • Budgets in Brazilian reais (50 = R$ 50.00).
  • Schedule dates in São Paulo time, format YYYY-MM-DDTHH:mm.
  • Meta IDs are numeric strings; ad_account_id is accepted with or without the act_ prefix.
  • Every response carries the x-request-id header — include it when reporting a problem.

Where to go next


Did this page help you?