Quickstart

Create an API key, confirm your access and list your clients in a few minutes.

🇧🇷 Ler em português

This guide takes you from an API key to your first query. You need an active Media Ops user.

1. Create an API key

  1. Sign in to Media Ops and open Integrações (Integrations).
  2. Click Gerar chave (Create key), give it a name (e.g. n8n production), tick only the permissions you need and pick an expiration.
  3. Copy the key (mops_…). It is shown only once.

Treat the key like a password

Keep it in a secrets vault (n8n credentials, an environment variable, a secrets manager). Never put it in code, spreadsheets or messages. If it leaks, revoke it in Integrações and create a new one.

2. Check who you are

Every call sends the key in the Authorization header:

export MEDIA_OPS_API_KEY="mops_..."
curl https://media.ops.infotrafego.com.br/api/v1/me \
  -H "Authorization: Bearer $MEDIA_OPS_API_KEY"
const res = await fetch("https://media.ops.infotrafego.com.br/api/v1/me", {
  headers: { Authorization: `Bearer ${process.env.MEDIA_OPS_API_KEY}` },
});
console.log(await res.json());
import os, requests

res = requests.get(
    "https://media.ops.infotrafego.com.br/api/v1/me",
    headers={"Authorization": f"Bearer {os.environ['MEDIA_OPS_API_KEY']}"},
)
print(res.json())

The response contains your user, role, the channel used (api_key) and the key's effective permissions. A 401 means the key is missing, revoked or expired.

3. List your clients

With the clients:read permission:

curl https://media.ops.infotrafego.com.br/api/v1/clients \
  -H "Authorization: Bearer $MEDIA_OPS_API_KEY"

Next, GET /clients/{id}/businesses returns the client's Business Managers with their ad accounts, pages, Instagram accounts and pixels — that is where the business_manager_id and ad_account_id used by every Meta operation come from.

4. Try it from the reference

Every endpoint in the API Reference has a Try It button: enter your key under Authorization and run it straight from the browser. Calls use your account, so prefer read endpoints and POST /campaigns/validate, which simulates a campaign without creating anything.

Next steps


Did this page help you?