Menu

Referência da API · CRM

Arquivamento em cascata

crm · archive_cascade · 3 operações

POST/v1/crm/archive-cascade/preview

Preview an archive with linked records

crm.archive_cascade.preview

LeituraIdempotenteDesde 2026-11-01

Dry run of crm.archive_cascade.execute for a prospect, person, company or deal (root: { type, id }, or entity_type + entity_id as crm.delete_cascade takes them): returns the root, the linked persons and companies that can be archived with it (archivable: no other active deal or prospect uses them) and the ones that must stay (kept, with the reason: shared_active_deals, shared_active_prospects or too_large). Nothing is written. Pass the ids you choose from archivable as also_archive. Requires the archive permission of the root type (archive_prospect, or edit_deal / edit_person / edit_company).

Escopo
crm:read
Permissão
Editar no módulo
Tool do MCP
crm_archive_cascade_previewNa superfície completa; na compacta, mb_execute_operation com id: "crm.archive_cascade.preview".

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

Parâmetros

rootobjectcorpoopcional

The record to archive (the root): { type, id }. Send this or entity_type + entity_id, not both.

entity_typeenumcorpoopcional

The kind of the root record, as crm.delete_cascade takes it (with entity_id).

Valores: prospect, person, company, deal

entity_idstringcorpoopcional

The root record, by id (with entity_type).

Resposta

rootobject
archivablearray<object>
keptarray<object>

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/crm/archive-cascade/preview" \
  -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/crm/archive-cascade/preview" \
  -H "Authorization: Bearer $MB_TEST_KEY"
POST/v1/crm/archive-cascade

Archive a record with chosen linked records

crm.archive_cascade.execute

EscritaDesde 2026-11-01

Archives a prospect, person, company or deal (root: { type, id }, or entity_type + entity_id) and, optionally, the linked persons and companies listed in also_archive. The plan is rebuilt right before writing: anything not archivable at that moment (not linked to the root, or used by another active deal or prospect) is skipped and counted in skipped. Archiving is a state, not the trash: archived records leave lists, forecasts and reports and come back by unarchiving; nothing is deleted. reason is saved only on a prospect root. It does not emit webhook events. Requires the archive permission of the root type (archive_prospect, or edit_deal / edit_person / edit_company).

Escopo
crm:write
Permissão
Editar no módulo
Tool do MCP
crm_archive_cascade_executeNa superfície completa; na compacta, mb_execute_operation com id: "crm.archive_cascade.execute".

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

Parâmetros

rootobjectcorpoopcional

The record to archive (the root): { type, id }. Send this or entity_type + entity_id, not both.

entity_typeenumcorpoopcional

The kind of the root record, as crm.delete_cascade takes it (with entity_id).

Valores: prospect, person, company, deal

entity_idstringcorpoopcional

The root record, by id (with entity_type).

also_archivearray<object>corpoopcional

The linked persons and companies to archive too, chosen from archivable of crm.archive_cascade.preview (up to 500).

Padrão: []

reasonstringcorpoopcional

Why: saved only when the root is a prospect.

Resposta

archivednumber
skippednumber

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/crm/archive-cascade" \
  -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/crm/archive-cascade" \
  -H "Authorization: Bearer $MB_TEST_KEY"
POST/v1/crm/archive-cascade/bulk

Archive many records with their linked records

crm.archive_cascade.bulk

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

Archives up to 500 roots of one type (prospects, persons, companies or deals: root_type + root_ids, or entity_type + entity_ids) and, with also_archive_persons / also_archive_companies, the persons and companies linked to them that no active record outside the batch uses (computed on the server; linked ids are never sent). A Manager archives any root; a seller only their own and the unassigned ones (one foreign id rejects the whole batch); ids that do not exist are skipped. Archiving is a state, not the trash. It does not emit webhook events. Bulk: outside the screen it requires a dry run (which returns the counts) and a confirm_token.

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
crm:write
Permissão
Editar no módulo
Tool do MCP
crm_archive_cascade_bulkNa superfície completa; na compacta, mb_execute_operation com id: "crm.archive_cascade.bulk".

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

Parâmetros

root_typeenumcorpoopcional

The kind of the root records (with root_ids). Send root_type + root_ids, or entity_type + entity_ids.

Valores: prospect, person, company, deal

root_idsarray<string>corpoopcional

The root records, by id.

entity_typeenumcorpoopcional

The same as root_type, by the name crm.delete_cascade uses.

Valores: prospect, person, company, deal

entity_idsarray<string>corpoopcional

The same as root_ids, by the name crm.delete_cascade uses.

also_archive_personsbooleancorpoopcional

Also archive the linked persons that no active record outside the batch uses.

Padrão: false

also_archive_companiesbooleancorpoopcional

Also archive the linked companies that no active record outside the batch uses.

Padrão: false

reasonstringcorpoopcional

Why: saved only on prospect roots.

Resposta

archivednumber
skippednumber

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/crm/archive-cascade/bulk" \
  -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.

curl -X POST "https://api.mb-suite.com/v1/crm/archive-cascade/bulk" \
  -H "Authorization: Bearer $MB_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "dry_run": true
}'