Menu

Referência da API · Organização

Lixeira

organizations · trash · 3 operações

GET/v1/trash

List items in the trash

platform.trash.list

LeituraIdempotenteDesde 2026-11-01

Lists what was deleted in the last 30 days and can still be restored, from any module (CRM deals, persons, companies, prospects, activities, pipelines, custom fields; tasks, projects, forms, campaigns and every entity whose delete keeps a copy), newest first. Use it to find something deleted by mistake before restoring it with platform.trash.restore. Only owners and admins can see the trash. Expired and already-restored items are not listed. Filter by module (the module that owns the record: crm, task_management, web_forms…) and/or by entity_type to narrow it. A record that lives under another one (a comment, a keyword, a campaign row of a plan, a reply) says whether that parent is still there: parent_trash_item_id when it is in the trash too (restore that one first), restorable: false with not_restorable_reason parent_gone when it is gone for good. Module: Organization (organizations), even though the id starts with platform.; any valid credential can read it. With Google Ads, 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
organizations:read
Permissão
Ver o módulo · Só owner, admin
Tool do MCP
platform_trash_listNa superfície completa; na compacta, mb_execute_operation com id: "platform.trash.list".

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

Parâmetros

modulestringqueryopcional

Module to filter by (crm, task_management, web_forms, …): the module values the list itself returns.

entity_typestringqueryopcional

Entity type to filter by (deal, person, task, report_template, …): the entity_type values the list itself returns.

limitintegerqueryopcional

How many items this page brings at most.

Padrão: 50

cursorstringqueryopcional

The next_cursor of the previous page, exactly as it came; without it, the first page.

Resposta

dataarray<object>
has_moreboolean

True when more items follow: ask again with next_cursor.

next_cursorstring

Pass it as cursor to get the next page.

Erros

Exemplo

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

Restore an item from the trash

platform.trash.restore

EscritaDesde 2026-11-01

Restores a deleted record from the trash to the place it was deleted from, together with anything a cascade deleted with it. Name it by item_id (the trash_item_id its deletion returned, or the id of platform.trash.list; in REST it goes in the path) or, through the MCP, by entity_type + entity_id (what it was and the id it had: its newest copy in the trash). If the original id is already taken by a newer record, the item is restored with a new id (restored_as_new_id). A person is re-linked to the deals and lists they were removed from, and a label goes back on the records that had it: relinked counts them. When the copy could not keep everything (linked_truncated in platform.trash.list), only part of it comes back and the response says linked_truncated: true. Fails if the item expired, was already restored, or is not restorable (trash_item_not_restorable, details.reason: merged or reference_only), and with 409 before writing anything when bringing it back would clash with what exists now (trash_restore_parent_missing when what it belonged to is gone: details.parent_trash_item_id names the trash item to restore first, and details.parent_restorable: false means it cannot come back, so neither can this one; lead_source_exists when the WhatsApp line of a lead source already has another active source). If the record came back but something after it failed (a linked record or a module side effect), the response says partial: true with how many linked records came back; the item is not reopened and the failure is reported to MB Suite. Owners and admins only; the caller (and the credential) also needs write access to the module the record belongs to. Module: Organization (organizations), even though the id starts with platform.; the credential needs the write scope of the module that owns the record (for example crm:write for a deal). 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 (the permissions guide lists what each platform allows).

Instruções para agentes

After restoring, tell the person the name of what came back and whether it got a new id. Do not try to restore the same item twice.

Escopo
organizations:write
Permissão
Editar no módulo · Só owner, admin
Tool do MCP
platform_trash_restoreNa superfície completa; na compacta, mb_execute_operation com id: "platform.trash.restore".

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

Parâmetros

item_idstringrotaobrigatório

The trash item id: the trash_item_id a deletion returns, or the id platform.trash.list returns. Or send entity_type and entity_id instead.

entity_typestringcorpoopcional

Instead of item_id, with entity_id: what was deleted (deal, person, task…, the entity_type of platform.trash.list). Restores the newest copy of that record.

entity_idstringcorpoopcional

Instead of item_id, with entity_type: the id the record had before it was deleted.

Resposta

item_idstring

The trash item that was restored.

entity_typestring

What came back (deal, person, task…).

restored_idstring

The id it has now: the original one, or a new one when a newer record had taken it.

restored_as_new_idboolean

True when it came back with a new id.

namestring

Its name.

linked_restorednumber

How many records came back with it or got it back: the linked records its deletion took with it, plus the ones counted in relinked.

relinkednumber

How many records that kept existing got it back: for a person, the deals and static lists it was put back in; for a label or a tag, the records that had it (deals, contacts, tasks, articles, credentials, members…); for a management role, the members who had it. Also counted in linked_restored.

partialboolean

True when the record came back but a linked record or a module side effect failed (reported to MB Suite).

linked_truncatedboolean

Only when true: the trash copy did not keep everything the deletion took or took off (the linked_truncated of platform.trash.list), so only part of it came back.

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/trash/{item_id}/restore" \
  -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/trash/{item_id}/restore" \
  -H "Authorization: Bearer $MB_TEST_KEY"
DELETE/v1/trash/{item_id}

Permanently remove an item from the trash

platform.trash.purge

IrreversívelDesde 2026-11-01

Deletes the trash copy for good, before the 30-day window ends, together with what the delete had kept aside for the restore (the items and views of a project, the comments of a task, the stored file of a Media Library item, the knowledge files of an AI agent). Use it only for a legal or privacy request (the data must not be recoverable). Irreversible: there is no copy after this. Owners only; the caller and the credential also need write access to the module the record belongs to, and the credential must allow deletion. Outside the screen it requires a dry run and a confirm_token. Module: Organization (organizations), even though the id starts with platform.; the credential needs the write scope of the module that owns the record (for example crm:write for a deal) and permission to delete.

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
organizations:write e «Permitir exclusões» (organizations:delete no OAuth)
Permissão
Editar no módulo · Só owner
Tool do MCP
platform_trash_purgeNa superfície completa; na compacta, mb_execute_operation com id: "platform.trash.purge".

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

Parâmetros

item_idstringrotaobrigatório

The trash item id, as platform.trash.list returns it (id).

Resposta

item_idstring

The trash item that was removed for good.

Erros

Exemplo

curl -X DELETE "https://api.mb-suite.com/v1/trash/{item_id}" \
  -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 DELETE "https://api.mb-suite.com/v1/trash/{item_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "dry_run": true
}'