Menu

Referência da API · Client Portal

Convites

client_portal · invitations · 5 operações

GET/v1/client-portal/invitations

List the portal invitations

client_portal.invitations.list

LeituraIdempotenteDesde 2026-11-01

Lists the invitations to this workspace's client portal, newest first, paginated by cursor (limit up to 200). status: pending (default: sent and still valid for its 30 days), accepted (the client registered: accepted_by_uid is their client id), cancelled, expired (pending past its 30 days; client_portal.invitations.resend revives it) or all. With pending or expired a page can hold fewer than limit items: keep paging while has_more. Each invitation: email, display_name, the accounts and sections the client will get, status, who invited and when, expires_at. It never returns the registration link. Only owners and admins.

Escopo
client_portal:read
Permissão
Ver o módulo · Só owner, admin
Tool do MCP
client_portal_invitations_listNa superfície completa; na compacta, mb_execute_operation com id: "client_portal.invitations.list".

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

Parâmetros

limitintegerqueryopcional

How many items this page brings at most (see the maximum and the default in the schema).

Padrão: 50

cursorstringqueryopcional

The next_cursor of the previous page, exactly as it came (only for the same list and filters); without it, the first page.

statusenumqueryopcional

pending (default: sent and still valid), accepted (the client registered), cancelled, expired (pending past its 30 days) or all.

Valores: pending, accepted, cancelled, expired, all · Padrão: "pending"

Resposta

dataarray<object>
has_moreboolean
next_cursorstring

Erros

Exemplo

curl "https://api.mb-suite.com/v1/client-portal/invitations" \
  -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/client-portal/invitations" \
  -H "Authorization: Bearer $MB_TEST_KEY"
GET/v1/client-portal/invitations/{invitation_id}

Get a portal invitation

client_portal.invitations.get

LeituraIdempotenteDesde 2026-11-01

Returns one portal invitation by id: email, display_name, the accounts and sections the client gets on registering, status (pending, accepted, cancelled or expired, computed from expires_at), who invited and when, accepted_at and accepted_by_uid (the new client's id) once accepted. Not found (portal_invitation_not_found) if it is not an invitation of this workspace. It never returns the registration link. Only owners and admins.

Escopo
client_portal:read
Permissão
Ver o módulo · Só owner, admin
Tool do MCP
client_portal_invitations_getNa superfície completa; na compacta, mb_execute_operation com id: "client_portal.invitations.get".

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

Parâmetros

invitation_idstringrotaobrigatório

Portal invitation id, from client_portal.invitations.list.

Resposta

idstring

The invitation id.

emailstring

Who was invited.

display_namestring | null

Their name, if given.

assigned_child_org_idsarray<string>

The Accounts they will see.

enabled_modulesobject
statusenum

pending, accepted, cancelled or expired (a pending one past its 30 days).

Valores: pending, accepted, cancelled, expired

invited_bystring

The user id of who invited them.

invited_by_namestring

Their name.

created_atnumber

When it was created (epoch ms).

expires_atnumber

When it expires (epoch ms): 30 days after it was sent or resent.

accepted_atnumber | null

When it was accepted (epoch ms).

accepted_by_uidstring | null

The user id that accepted it.

cancelled_atnumber | null

When it was cancelled (epoch ms); null for an invitation cancelled before the date was recorded.

Erros

Exemplo

curl "https://api.mb-suite.com/v1/client-portal/invitations/{invitation_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/client-portal/invitations/{invitation_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY"
POST/v1/client-portal/invitations

Invite a client to the portal (sends an email)

client_portal.invitations.create

EscritaDesde 2026-11-01

Invites a person outside the agency to this workspace's client portal and SENDS them an email through Amazon SES with a link to create their account (valid 30 days). They will see the assigned_child_org_ids (accounts of this workspace, at least one; an id from another organization fails with portal_account_invalid) and the sections from module_preset (complete, reports_only or default; default when omitted) adjusted by enabled_modules. The email must have a valid format and cannot be on a platform domain (portal_email_invalid). Fails with portal_not_configured (409) while the portal has no subdomain (client_portal.settings.get shows it) and with portal_invitation_exists (409) when the email already has a pending invitation (resend or cancel that one). Returns the invitation and email_sent: when false the invitation exists but the email did not go out (retry with client_portal.invitations.resend). Not idempotent: every successful call sends an email. Outside the app it runs as a dry run first (it checks the email, the accounts, that the portal is set up and that there is no pending invitation, and says who gets the email) and needs the confirm_token. Fires client_portal.client.invited; client_portal.client.registered fires when the person creates their account. Only owners and admins.

Instruções para agentes

Tell the person the invitation email went to the client (or, if email_sent is false, that it was created but the email failed and can be resent) and that it expires in 30 days. Never ask for or share the registration link: the client uses the one in the email.

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
client_portal:write
Permissão
Editar no módulo · Só owner, admin
Tool do MCP
client_portal_invitations_createNa superfície completa; na compacta, mb_execute_operation com id: "client_portal.invitations.create".
Eventos que pode emitir
client_portal.client.invited

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

Parâmetros

emailstringcorpoobrigatório

The client's email: the invitation is sent there and only an account with this email can accept it. Platform domains (mb-suite.com, mediabros.com…) are not allowed.

assigned_child_org_idsarray<string>corpoobrigatório

Accounts (client organizations of this workspace) the client sees in the portal. At least one; replaces the whole list.

display_namestringcorpoopcional

Optional name for the client; when empty, the email is used until they register.

module_presetenumcorpoopcional

Starting point for the client's sections: complete (all 14), reports_only (monitors, dashboards and reports), default (what a new client gets in the app: everything except social_insights, social_competitors, seo_rankings and seo_site_auditor).

Valores: complete, reports_only, default

enabled_modulesobjectcorpoopcional

Portal sections to turn on (true) or off (false) for this client, applied on top of module_preset (or of the current setting when editing). Keys: monitors, dashboards, reports, paid_insights, paid_media, social_insights, social_media, social_competitors, seo, seo_rankings, seo_site_auditor, ai_chat, apps_ads_visualizer, apps_utm_builder. Overview and Profile are always visible.

Resposta

invitation_idstring
invitationobject
email_sentboolean

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/client-portal/invitations" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "ana@example.com",
  "assigned_child_org_ids": [
    "ASSIGNED_CHILD_ORG_ID"
  ],
  "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.

POST/v1/client-portal/invitations/{invitation_id}/resend

Resend a portal invitation email

client_portal.invitations.resend

EscritaDesde 2026-11-01

Renews a pending or expired invitation for another 30 days and SENDS its email again through Amazon SES, with the portal's current address. An accepted or cancelled invitation cannot be resent (portal_invitation_not_pending, 409); an expired one whose email already has a newer pending invitation fails with portal_invitation_exists. If the email cannot be sent the invitation stays renewed and the call fails with the email provider's error (details.platform ses): 503 external_unavailable or 429 external_rate_limited (retry later: it renews and sends again), 409 external_rejected when the provider refuses the address, or 409 external_outcome_unknown when it did not answer and the email may have gone out (check before resending). Not idempotent: every successful call sends an email. Only owners and admins.

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
client_portal:write
Permissão
Editar no módulo · Só owner, admin
Tool do MCP
client_portal_invitations_resendNa superfície completa; na compacta, mb_execute_operation com id: "client_portal.invitations.resend".

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

Parâmetros

invitation_idstringrotaobrigatório

Portal invitation id, from client_portal.invitations.list.

Resposta

invitationobject
email_senttrue

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/client-portal/invitations/{invitation_id}/resend" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "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.

POST/v1/client-portal/invitations/{invitation_id}/cancel

Cancel a pending portal invitation

client_portal.invitations.cancel

EscritaIdempotenteDesde 2026-11-01

Cancels a pending (or expired) invitation: its registration link stops working at once. It sends nothing. Idempotent: on a cancelled invitation nothing changes (changed=false). An accepted invitation cannot be cancelled (portal_invitation_not_pending, 409): the person is already a client; deactivate them with client_portal.clients.deactivate. To invite the same email again after cancelling, use client_portal.invitations.create. Only owners and admins.

Escopo
client_portal:write
Permissão
Editar no módulo · Só owner, admin
Tool do MCP
client_portal_invitations_cancelNa superfície completa; na compacta, mb_execute_operation com id: "client_portal.invitations.cancel".

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

Parâmetros

invitation_idstringrotaobrigatório

Portal invitation id, from client_portal.invitations.list.

Resposta

invitationobject
changedboolean

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/client-portal/invitations/{invitation_id}/cancel" \
  -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 POST "https://api.mb-suite.com/v1/client-portal/invitations/{invitation_id}/cancel" \
  -H "Authorization: Bearer $MB_TEST_KEY"