Menu

Referência da API · Media Planner

Automações

media_planner · automation · 5 operações

GET/v1/media-planner/automation

Get the workspace's media plan automations

media_planner.automation.get

LeituraIdempotenteDesde 2026-11-01

Returns the workspace's media plan automations, which run over the plans of all its accounts: auto_sync (sync the costs daily or weekly at hour in timezone; day_of_week 0 = Sunday for weekly) and auto_archive (archive the finished plans delay_days after they end: 1, 3, 7, 14 or 30). Everything is off until someone turns it on. Only in the workspace (an account gets 400 workspace_only). Requires view access to the Media Planner.

Escopo
media_planner:read
Permissão
Ver o módulo
Tool do MCP
media_planner_automation_getNa superfície completa; na compacta, mb_execute_operation com id: "media_planner.automation.get".

Custo declarado: até 1 leituras e 0 escritas por chamada (contam na cota diária).

Parâmetros

Sem parâmetros.

Resposta

settingsobject

The workspace's automations.

Erros

Exemplo

curl "https://api.mb-suite.com/v1/media-planner/automation" \
  -H "Authorization: Bearer $MB_API_KEY"

Testar com a sua API key de teste

Com uma API key de teste o pedido vai sempre para a sua organização de prática: dados de exemplo que você pode reiniciar.

curl "https://api.mb-suite.com/v1/media-planner/automation" \
  -H "Authorization: Bearer $MB_TEST_KEY"
PATCH/v1/media-planner/automation

Configure the workspace's media plan automations

media_planner.automation.update

EscritaIdempotenteDesde 2026-11-01

Turns on, off or reconfigures the workspace's automations: auto_sync { enabled, frequency daily|weekly, hour 0-23, day_of_week 0-6 (weekly), timezone (IANA) } and auto_archive { enabled, delay_days 1|3|7|14|30 }. Only the fields sent change; unknown fields are rejected. Turning auto_sync on makes MB Suite read every account's linked campaigns from the ad platforms on schedule. Only owners and admins of the workspace (an account gets 400 workspace_only). Returns the resulting settings and changed (false when nothing changed: no write, no audit). Requires full access to the Media Planner.

Escopo
media_planner:write
Permissão
Editar no módulo · Só owner, admin
Tool do MCP
media_planner_automation_updateNa superfície completa; na compacta, mb_execute_operation com id: "media_planner.automation.update".

Custo declarado: até 1 leituras e 1 escritas por chamada (contam na cota diária).

Parâmetros

auto_syncobjectcorpoopcional

The scheduled cost sync of every account's plans.

auto_archiveobjectcorpoopcional

The archiving of finished plans.

Resposta

settingsobject

The automations as they are now.

changedboolean

false when the settings sent were already the current ones: nothing was written nor audited.

Erros

Exemplo

curl -X PATCH "https://api.mb-suite.com/v1/media-planner/automation" \
  -H "Authorization: Bearer $MB_API_KEY"

Testar com a sua API key de teste

Com uma API key de teste o pedido vai sempre para a sua organização de prática: dados de exemplo que você pode reiniciar.

curl -X PATCH "https://api.mb-suite.com/v1/media-planner/automation" \
  -H "Authorization: Bearer $MB_TEST_KEY"
POST/v1/media-planner/automation/run

Run a media plan automation now

media_planner.automation.run

EscritaDesde 2026-11-01

Starts, right now, one run of an automation over the plans of all the workspace's accounts, outside its schedule: auto_sync (syncs the costs of every plan with linked campaigns, reading Google Ads, Meta, TikTok and LinkedIn) or auto_archive (archives the plans that ended more than delay_days ago). It runs in the background on MB Suite's automation service and takes minutes: follow it with media_planner.automation.runs.get (run_id), or see the latest runs with media_planner.automation.runs.list. A second run of the same type while one is in progress is rejected (409 automation_run_in_progress). Accounts blocked for billing are skipped. Only owners and admins of the workspace. Requires full access to the Media Planner.

Instruções para agentes

Tell the person the run started and that it takes a few minutes; offer to check its result with media_planner.automation.runs.get and its run_id.

Escopo
media_planner:write
Permissão
Editar no módulo · Só owner, admin
Tool do MCP
media_planner_automation_runNa superfície completa; na compacta, mb_execute_operation com id: "media_planner.automation.run".

Custo declarado: até 1 leituras e 2 escritas por chamada (contam na cota diária). Usa uma plataforma externa (cloud_run): conta na cota de operações externas.

Parâmetros

typeenumcorpoobrigatório

auto_sync: sync the costs of the accounts' plans now; auto_archive: archive the finished plans now (with the configured delay).

Valores: auto_sync, auto_archive

Resposta

run_idstring

The run, to follow with media_planner.automation.runs.get.

statusenum

pending: queued; failed: it could not be started.

Valores: pending, failed

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/media-planner/automation/run" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "type": "auto_sync"
}'

Testar com a sua API key de teste

Com uma API key de teste o pedido vai sempre para a sua organização de prática: dados de exemplo que você pode reiniciar. Na prática esta operação não é simulada (usa outra plataforma): responde 409 sandbox_external_unavailable.

GET/v1/media-planner/automation/runs

List the runs of the media plan automations

media_planner.automation.runs.list

LeituraIdempotenteDesde 2026-11-01

Lists the workspace's automation runs, newest first, paginated by cursor (limit 50 by default, up to 200): type (auto_sync, auto_archive), trigger (cron or manual), status (pending, running, completed, failed), start, end and duration, who started a manual run (triggered_by and triggered_by_name), stats (accounts and plans processed, plans synced or archived, errors) and error_count. The per-plan results and the errors of one run are in media_planner.automation.runs.get. Only in the workspace. Requires view access to the Media Planner.

Escopo
media_planner:read
Permissão
Ver o módulo
Tool do MCP
media_planner_automation_runs_listNa superfície completa; na compacta, mb_execute_operation com id: "media_planner.automation.runs.list".

Custo declarado: até 202 leituras e 0 escritas por chamada (contam na cota diária).

Parâmetros

limitintegerqueryopcional

Runs per page (default 50, up to 200).

Padrão: 50

cursorstringqueryopcional

next_cursor of the previous page of this same list.

Resposta

dataarray<object>
has_moreboolean
next_cursorstring

Erros

Exemplo

curl "https://api.mb-suite.com/v1/media-planner/automation/runs" \
  -H "Authorization: Bearer $MB_API_KEY"

Testar com a sua API key de teste

Com uma API key de teste o pedido vai sempre para a sua organização de prática: dados de exemplo que você pode reiniciar.

curl "https://api.mb-suite.com/v1/media-planner/automation/runs" \
  -H "Authorization: Bearer $MB_TEST_KEY"
GET/v1/media-planner/automation/runs/{run_id}

Get one run of the media plan automations

media_planner.automation.runs.get

LeituraIdempotenteDesde 2026-11-01

Returns one automation run of the workspace (run_id from media_planner.automation.runs.list, or the one media_planner.automation.run returned) with what the list has (type, trigger, status, start, end, duration, who started it, stats, error_count) plus, per plan, the result (plan_results: account, plan, rows synced or rows that changed status, skipped when it had nothing to sync) and the errors by account and plan. While it is pending or running, plan_results and errors fill in as it goes. Not found: automation_run_not_found. Only in the workspace. Requires view access to the Media Planner. With Google Ads, LinkedIn or TikTok, their terms limit it through the API and the MCP: what they do not allow answers 403 platform_terms_restricted, and their records are left out of the response (the permissions guide lists what each platform allows).

Escopo
media_planner:read
Permissão
Ver o módulo
Tool do MCP
media_planner_automation_runs_getNa superfície completa; na compacta, mb_execute_operation com id: "media_planner.automation.runs.get".

Custo declarado: até 1 leituras e 0 escritas por chamada (contam na cota diária).

Parâmetros

run_idstringrotaobrigatório

Automation run id (from media_planner.automation.runs.list or the run_id of media_planner.automation.run).

Resposta

idstring

Run id (media_planner.automation.runs.get takes it).

typestring

auto_sync or auto_archive.

triggerstring

cron or manual.

statusstring

pending, running, completed or failed.

started_atnumber

Epoch ms.

error_countnumber

How many plans or accounts failed (the detail, in media_planner.automation.runs.get).

errorsarray<object>

What failed, by account and plan.

plan_resultsarray<object>

Every plan processed, also the ones that went well.

completed_atnumber

When it finished (epoch ms); absent while running.

durationnumber

How long it took (ms).

triggered_bystring

Manual runs: who started it (uid).

triggered_by_namestring | null

That person's name (null when MB Suite does not know it: a former member).

statsobject

Counts of the run.

Erros

Exemplo

curl "https://api.mb-suite.com/v1/media-planner/automation/runs/{run_id}" \
  -H "Authorization: Bearer $MB_API_KEY"

Testar com a sua API key de teste

Com uma API key de teste o pedido vai sempre para a sua organização de prática: dados de exemplo que você pode reiniciar.

curl "https://api.mb-suite.com/v1/media-planner/automation/runs/{run_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY"