Menu

Referência da API · CRM

Pipelines

crm · pipelines · 6 operações

GET/v1/crm/pipelines

List pipelines with their stages

crm.pipelines.list

LeituraIdempotenteDesde 2026-11-01

Lists the sales pipelines of the organization, in order, each with its stages (id, name, probability, won stage), lost reasons, seller access (always present: mode all when every seller sees it) and who created it. Use it first whenever you need a pipeline_id or a stage_id for another operation; stage ids are per pipeline. Does not include deal counts (see crm.pipelines.stage_counts).

Escopo
crm:read
Permissão
Ver o módulo
Tool do MCP
crm_pipelines_listNa superfície completa; na compacta, mb_execute_operation com id: "crm.pipelines.list".

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

Parâmetros

Sem parâmetros.

Resposta

dataarray<object>

Erros

Exemplo

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

Get one pipeline

crm.pipelines.get

LeituraIdempotenteDesde 2026-11-01

Returns a single pipeline with its stages and lost reasons. Use crm.pipelines.list when you do not know the id.

Escopo
crm:read
Permissão
Ver o módulo
Tool do MCP
crm_pipelines_getNa superfície completa; na compacta, mb_execute_operation com id: "crm.pipelines.get".

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

Parâmetros

pipeline_idstringrotaobrigatório

The pipeline, by id (crm.pipelines.list).

Resposta

idstring
org_idstring
namestring
currencystring

ISO 4217 code of the pipeline's deals by default.

stagesarray<object>
is_defaultboolean
created_atnumber
updated_atnumber
descriptionstring | null
lost_reasonsarray<object>
is_archivedboolean
ordernumber
accessobject

Which sellers see the pipeline (mode all when every seller does).

created_by_idstring | null

Who created it: a member's user id (members.members.list), or an AI position's ai-… id.

created_by_namestring | null

The name of who created it, resolved when the record is read.

Erros

Exemplo

curl "https://api.mb-suite.com/v1/crm/pipelines/{pipeline_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/crm/pipelines/{pipeline_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY"
GET/v1/crm/pipelines/{pipeline_id}/stage-counts

Count deals per stage of a pipeline

crm.pipelines.stage_counts

LeituraIdempotenteDesde 2026-11-01

Returns how many deals sit in each stage of a pipeline (stage id → count), using aggregation counts, without reading the deals. It counts every deal that points at the stage whatever its state (open, won, lost, archived, merged away): it is the check the stage editor runs before deleting a stage, not a funnel picture. For live deals use crm.analytics.summary or crm.deals.list.

Escopo
crm:read
Permissão
Ver o módulo
Tool do MCP
crm_pipelines_stage_countsNa superfície completa; na compacta, mb_execute_operation com id: "crm.pipelines.stage_counts".

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

Parâmetros

pipeline_idstringrotaobrigatório

The pipeline, by id (crm.pipelines.list).

Resposta

countsobject

Erros

Exemplo

curl "https://api.mb-suite.com/v1/crm/pipelines/{pipeline_id}/stage-counts" \
  -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/crm/pipelines/{pipeline_id}/stage-counts" \
  -H "Authorization: Bearer $MB_TEST_KEY"
POST/v1/crm/pipelines

Create a pipeline

crm.pipelines.create

EscritaDesde 2026-11-01

Creates a sales pipeline with at least two stages (each with id, name, order, color, probability and rotting days; at most one won stage), optional lost reasons, default currency and seller access. Setting is_default moves the default flag from the other pipelines. Requires the manage_pipelines permission (CRM admins).

Escopo
crm:write
Permissão
Editar no módulo · Ação do CRM: manage_pipelines
Tool do MCP
crm_pipelines_createNa superfície completa; na compacta, mb_execute_operation com id: "crm.pipelines.create".

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

Parâmetros

namestringcorpoobrigatório

The pipeline's name.

currencystringcorpoobrigatório

ISO 4217 code of the pipeline's deals by default (USD, ARS…).

stagesarray<object>corpoobrigatório

Its stages, 2 to 30, in order.

descriptionstringcorpoopcional

A line about what the pipeline is for.

lost_reasonsarray<object>corpoopcional

Its lost reasons.

is_defaultbooleancorpoopcional

true makes it the default pipeline (the others lose the flag); the first pipeline is the default anyway.

accessobjectcorpoopcional

Which sellers see the pipeline (all by default).

Resposta

pipeline_idstring

Erros

Exemplo

curl -X POST "https://api.mb-suite.com/v1/crm/pipelines" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "NAME",
  "currency": "CURRENCY",
  "stages": []
}'

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/pipelines" \
  -H "Authorization: Bearer $MB_TEST_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "NAME",
  "currency": "CURRENCY",
  "stages": []
}'
PATCH/v1/crm/pipelines/{pipeline_id}

Update a pipeline

crm.pipelines.update

EscritaDesde 2026-11-01

Updates a pipeline's name, description, currency, stages, lost reasons, default flag, archived flag or seller access; send the fields at the top level or inside updates (as in crm.deals.update), not both. When the new stage set removes a stage that still has deals, pass stage_reassignments (from → to, never into the won stage); a removed stage must otherwise be empty. The open deals that move take the probability of their new stage unless it was set by hand (the deal's probability_overridden); changing a stage's probability does not change the deals already in it (the forecast weighs them with their stage's). Fields equal to the current ones are not a change: if nothing changes, nothing is written or audited and changed comes back false. Returns the pipeline as saved. Requires manage_pipelines.

Escopo
crm:write
Permissão
Editar no módulo · Ação do CRM: manage_pipelines
Tool do MCP
crm_pipelines_updateNa superfície completa; na compacta, mb_execute_operation com id: "crm.pipelines.update".

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

Parâmetros

pipeline_idstringrotaobrigatório

The pipeline, by id (crm.pipelines.list).

namestringcorpoopcional

The pipeline's name.

descriptionstringcorpoopcional

A line about what the pipeline is for.

currencystringcorpoopcional

ISO 4217 code of the pipeline's deals by default (USD, ARS…).

stagesarray<object>corpoopcional

The whole list of stages (2 to 30): it replaces the current one.

lost_reasonsarray<object>corpoopcional

The whole list of lost reasons: it replaces the current one.

stage_reassignmentsarray<object>corpoopcional

Where the deals of each removed stage go (needed when a removed stage still has deals).

is_defaultbooleancorpoopcional

true makes it the default pipeline (the others lose the flag).

is_archivedbooleancorpoopcional

true archives the pipeline (it leaves the pickers; its deals keep it).

accessobjectcorpoopcional

Which sellers see the pipeline.

updatesobjectcorpoopcional

The same fields, grouped as in the other CRM edits (crm.deals.update…): send them here or at the top level, not both.

Resposta

oktrue
pipelineobject
changedboolean

false when nothing changed: nothing was written and nothing was audited.

Erros

Exemplo

curl -X PATCH "https://api.mb-suite.com/v1/crm/pipelines/{pipeline_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 -X PATCH "https://api.mb-suite.com/v1/crm/pipelines/{pipeline_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY"
DELETE/v1/crm/pipelines/{pipeline_id}

Delete an empty pipeline

crm.pipelines.delete

IrreversívelDesde 2026-11-01

Deletes a pipeline that has no deals (otherwise it fails with pipeline_not_empty: move or delete the deals first). The pipeline goes to the 30-day trash and can be restored. Irreversible outside the trash window; requires manage_pipelines.

Com uma API key, este DELETE roda direto: o registro fica 30 dias na lixeira e a resposta traz o seu trash_item_id. Com um token OAuth, e pelo MCP, pede dry_run → confirm_token.

Escopo
crm:write e «Permitir exclusões» (crm:delete no OAuth)
Permissão
Editar no módulo · Ação do CRM: manage_pipelines
Tool do MCP
crm_pipelines_deleteNa superfície completa; na compacta, mb_execute_operation com id: "crm.pipelines.delete".

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

Parâmetros

pipeline_idstringrotaobrigatório

The pipeline, by id (crm.pipelines.list): it must have no deals (pipeline_not_empty).

Resposta

oktrue
trash_item_idstring

The trash item this deletion left: the item_id of platform.trash.restore (POST /trash/{item_id}/restore). Missing if nothing went to the trash.

trash_item_idsarray<string>

Only when the deletion left more than one copy: all of them, the first being trash_item_id.

trash_expires_atnumber

When the copy leaves the trash for good (epoch ms): 30 days after the deletion.

Erros

Exemplo

curl -X DELETE "https://api.mb-suite.com/v1/crm/pipelines/{pipeline_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 -X DELETE "https://api.mb-suite.com/v1/crm/pipelines/{pipeline_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY"