Menu

Referência da API · Integrações

Fontes de dados

integrations · data_sources · 5 operações

GET/v1/integrations/data-sources

List the accounts linked in Data sources

integrations.data_sources.list

LeituraIdempotenteDesde 2026-11-01

Lists the platform accounts linked to the organization in Data sources: the ad account, analytics property, Search Console site, business profile, page or channel each module reads (filter with platform). Each one has platform, id (the platform's own id: the customer id, property id, site URL…), composite_id (platform:id, the id dashboards and reports use), name, is_default (the first one of its platform is the one modules use when nobody picks), inherited and source_org_id (the account is read with the workspace's connection) and fields (the stored fields: currency, manager account, permission level…). WhatsApp numbers appear under whatsapp_business. Reads only MB Suite: no platform is called. Not paginated. Requires view access to Integrations. With Google Ads, Google Business Profile, LinkedIn, TikTok or YouTube, 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
integrations:read
Permissão
Ver o módulo
Tool do MCP
integrations_data_sources_listNa superfície completa; na compacta, mb_execute_operation com id: "integrations.data_sources.list".

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

Parâmetros

platformenumqueryopcional

Only the linked accounts of this platform.

Valores: google_ads, meta_ads, facebook_page, instagram, tiktok_ads, tiktok, linkedin_ads, linkedin_page, linkedin_profile, google_analytics, google_search_console, google_business_profile, youtube, whatsapp_business

Resposta

dataarray<object>
has_moreboolean
next_cursorstring

Erros

Exemplo

curl "https://api.mb-suite.com/v1/integrations/data-sources" \
  -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/integrations/data-sources" \
  -H "Authorization: Bearer $MB_TEST_KEY"
POST/v1/integrations/data-sources/{platform}

Link a platform account in Data sources

integrations.data_sources.save

EscritaIdempotenteDesde 2026-11-01

Links one account of a platform to the organization so its modules read it (the account the Data sources selector would pick): connection carries the platform's id field and its name. The platform must have an active connection (the organization's own or, for a platform an Account inherits, its workspace's: integrations.credentials.availability): MB Suite stores the link and reads the account later with that connection, so without one it is 409 integration_not_connected and nothing is linked. For Google Analytics, Search Console and Business Profile a new account must be one the connection reaches (400 account_not_in_connection): that check calls Google and spends its external quota; other platforms are not checked against the platform now. Linking an account that is already linked refreshes it (outcome updated); a new one is added (added) or, when the organization keeps one account per platform, replaces the current one (replaced, which unlinks the previous). 409 limit_reached (details.resource connections, details.limit) when no more accounts of that platform can be linked. WhatsApp numbers are chosen in the app, not here. Who can: in a workspace, its owners and admins; in an Account, the workspace's team for the platforms that use the workspace's connection (only those, if the Account pays for itself) and the Account's own owners and admins for the platforms it connects itself (none while it is managed by the workspace). Viewers never. 403 data_sources_forbidden otherwise; 403 demo_read_only in a demo organization. Returns the platform's linked accounts after saving. With Google Ads, Google Business Profile, LinkedIn, TikTok or YouTube, 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
integrations:write
Permissão
Editar no módulo
Tool do MCP
integrations_data_sources_saveNa superfície completa; na compacta, mb_execute_operation com id: "integrations.data_sources.save".

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

Parâmetros

platformenumrotaobrigatório

The platform of the account to link (google_ads, meta_ads, facebook_page, instagram, tiktok_ads, tiktok, linkedin_ads, linkedin_page, linkedin_profile, google_analytics, google_search_console, google_business_profile, youtube).

connectionobjectcorpoobrigatório

The account's fields, keyed by the platform's own id field: google_ads external_customer_id (+ mcc_id, mcc_name, currency); meta_ads ad_account_id (act_…, + currency); facebook_page page_id; instagram ig_user_id and page_id; tiktok_ads advertiser_id (+ currency); tiktok open_id (+ display_name); linkedin_ads account_id (+ currency); linkedin_page organization_id (+ vanity_name); linkedin_profile person_id; google_analytics property_id; google_search_console site_url (+ permission_level); google_business_profile account_id and location_id; youtube channel_id (+ channel_title). name (and label) are the display name. Unknown fields are ignored.

Resposta

outcomeenum

Valores: added, updated, replaced

data_sourcesarray<object>

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/integrations/data-sources/{platform}" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "connection": {}
}'

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.

POST/v1/integrations/data-sources/bulk/assign

Assign workspace accounts to its Accounts

integrations.data_sources.bulk.assign

EscritaEm massa · até 500IdempotenteDesde 2026-11-01

From a workspace, assigns to each of its Accounts an account of the workspace's own connection, or leaves it without one (connection: null), up to 500 changes per call (Bulk assignment in Integrations). Each change is account_id + platform (google_ads, meta_ads, google_analytics, tiktok_ads, google_search_console, google_business_profile, facebook_page, instagram, linkedin_ads, linkedin_page) + connection (the same fields as integrations.data_sources.save). Only Accounts of this workspace whose platform uses the workspace's connection: an Account that pays for itself, an independent one or one where the platform was released keeps its own and that change comes back in failed (platform_not_inherited), like an unknown Account (account_not_found), a platform the workspace has no active connection of (integration_not_connected), a full platform (limit_reached) or, for Google Analytics, Search Console and Business Profile, an account the workspace's connection does not reach (account_not_in_connection; that check calls Google); the rest is saved. Owners and admins of the workspace only; outside the app it needs a dry run (which says which changes apply) and a confirm_token. With Google Business Profile or LinkedIn, 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).

Pede confirmação: primeiro dry_run: true (prévia e confirm_token, válido por 10 minutos e por uma única execução), depois o mesmo corpo com confirm_token. Em algumas poucas, só com certos dados: a descrição diz quando. Por que e como: Prévia e confirmação.

Escopo
integrations:write
Permissão
Editar no módulo · Só owner, admin
Tool do MCP
integrations_data_sources_bulk_assignNa superfície completa; na compacta, mb_execute_operation com id: "integrations.data_sources.bulk.assign".

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

Parâmetros

changesarray<object>corpoobrigatório

The assignments, one per Account and platform (up to 500); each one that cannot be applied comes back in failed with its reason.

Resposta

assignednumber
unassignednumber
failedarray<object>

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/integrations/data-sources/bulk/assign" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "changes": [],
  "dry_run": true
}'

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.