Menu

API reference · Media Planner

Automations

media_planner · automation · 5 operations

GET/v1/media-planner/automation

Get the workspace's media plan automations

media_planner.automation.get

ReadIdempotentSince 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.

Scope
media_planner:read
Permission
View the module
MCP tool
media_planner_automation_getOn the full surface; on the compact one, mb_execute_operation with id: "media_planner.automation.get".

Declared cost: up to 1 reads and 0 writes per call (they count against the daily quota).

Parameters

No parameters.

Response

settingsobject

The workspace's automations.

Errors

Example

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

Try it with your test API key

With a test API key the request always goes to your practice organization: example data you can reset.

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

WriteIdempotentSince 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.

Scope
media_planner:write
Permission
Edit in the module · Only owner, admin
MCP tool
media_planner_automation_updateOn the full surface; on the compact one, mb_execute_operation with id: "media_planner.automation.update".

Declared cost: up to 1 reads and 1 writes per call (they count against the daily quota).

Parameters

auto_syncobjectbodyoptional

The scheduled cost sync of every account's plans.

auto_archiveobjectbodyoptional

The archiving of finished plans.

Response

settingsobject

The automations as they are now.

changedboolean

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

Errors

Example

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

Try it with your test API key

With a test API key the request always goes to your practice organization: example data you can reset.

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

WriteSince 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.

Instructions for agents

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.

Scope
media_planner:write
Permission
Edit in the module · Only owner, admin
MCP tool
media_planner_automation_runOn the full surface; on the compact one, mb_execute_operation with id: "media_planner.automation.run".

Declared cost: up to 1 reads and 2 writes per call (they count against the daily quota). Touches an external platform (cloud_run): it counts against the external operations quota.

Parameters

typeenumbodyrequired

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

Values: auto_sync, auto_archive

Response

run_idstring

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

statusenum

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

Values: pending, failed

Errors

Example

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"
}'

Try it with your test API key

With a test API key the request always goes to your practice organization: example data you can reset. In the practice organization this operation is not simulated (it reaches another platform): it answers 409 sandbox_external_unavailable.

GET/v1/media-planner/automation/runs

List the runs of the media plan automations

media_planner.automation.runs.list

ReadIdempotentSince 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.

Scope
media_planner:read
Permission
View the module
MCP tool
media_planner_automation_runs_listOn the full surface; on the compact one, mb_execute_operation with id: "media_planner.automation.runs.list".

Declared cost: up to 202 reads and 0 writes per call (they count against the daily quota).

Parameters

limitintegerqueryoptional

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

Default: 50

cursorstringqueryoptional

next_cursor of the previous page of this same list.

Response

dataarray<object>
has_moreboolean
next_cursorstring

Errors

Example

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

Try it with your test API key

With a test API key the request always goes to your practice organization: example data you can reset.

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

ReadIdempotentSince 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).

Scope
media_planner:read
Permission
View the module
MCP tool
media_planner_automation_runs_getOn the full surface; on the compact one, mb_execute_operation with id: "media_planner.automation.runs.get".

Declared cost: up to 1 reads and 0 writes per call (they count against the daily quota).

Parameters

run_idstringpathrequired

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

Response

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.

Errors

Example

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

Try it with your test API key

With a test API key the request always goes to your practice organization: example data you can reset.

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