Menú

Referencia de la API · CRM

Reglas de asignación

crm · assignment_rules · 5 operaciones

GET/v1/crm/assignment-rules

List lead assignment rules

crm.assignment_rules.list

LecturaIdempotenteDesde 2026-11-01

Lists the lead assignment rules, newest first (up to 200): each one's scope (one lead source, one pipeline, or global; a global rule can be limited to prospects or deals with entity_type), method (round_robin, weighted_round_robin, capacity, territory, source, value or manual), participants with their name, weight, capacity and out-of-office flag, territory_ids, special rules, fallback and who gets notified.

Alcance
crm:read
Permiso
Ver el módulo
Tool del MCP
crm_assignment_rules_listEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.assignment_rules.list".

Costo declarado: hasta 200 lecturas y 0 escrituras por llamada (cuentan en el cupo diario).

Parámetros

Sin parámetros.

Respuesta

dataarray<object>

Errores

Ejemplo

curl "https://api.mb-suite.com/v1/crm/assignment-rules" \
  -H "Authorization: Bearer $MB_API_KEY"

Probar con tu API key de prueba

Con una API key de prueba el pedido va siempre a tu organización de práctica: datos de ejemplo que puedes reiniciar.

curl "https://api.mb-suite.com/v1/crm/assignment-rules" \
  -H "Authorization: Bearer $MB_TEST_KEY"
GET/v1/crm/assignment-rules/{rule_id}

Get one lead assignment rule

crm.assignment_rules.get

LecturaIdempotenteDesde 2026-11-01

Returns one assignment rule with its scope, method, participants, territories, special rules, fallback and notification settings. Use crm.assignment_rules.list when you do not know the id.

Alcance
crm:read
Permiso
Ver el módulo
Tool del MCP
crm_assignment_rules_getEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.assignment_rules.get".

Costo declarado: hasta 2 lecturas y 0 escrituras por llamada (cuentan en el cupo diario).

Parámetros

rule_idstringrutarequerido

The rule's id, from crm.assignment_rules.list.

Respuesta

idstring
org_idstring
namestring
methodenum

Valores: round_robin, weighted_round_robin, capacity, territory, source, value, manual

participantsarray<object>
special_rulesarray<object>
fallbackenum

Valores: unassigned, round_robin, notify_admin, specific_user

last_assigned_indexnumber
created_atnumber
updated_atnumber
created_by_idstring
pipeline_idstring | null
source_idstring | null
entity_typeenum | null

Valores: prospect, deal

territory_idsarray<string> | null
fallback_user_idstring | null
notify_ownerboolean
notify_extra_user_idsarray<string> | null

Errores

Ejemplo

curl "https://api.mb-suite.com/v1/crm/assignment-rules/{rule_id}" \
  -H "Authorization: Bearer $MB_API_KEY"

Probar con tu API key de prueba

Con una API key de prueba el pedido va siempre a tu organización de práctica: datos de ejemplo que puedes reiniciar.

curl "https://api.mb-suite.com/v1/crm/assignment-rules/{rule_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY"
POST/v1/crm/assignment-rules

Create a lead assignment rule

crm.assignment_rules.create

EscrituraDesde 2026-11-01

Creates a lead assignment rule: a name; its scope (source_id for one lead source, pipeline_id for one pipeline, or neither for a global rule, which can be limited to prospect or deal with entity_type); the method; participants (user_id from crm.team.list: people with access to the organization or AI agents of the CRM team; the name is filled in by the server; optional weight or max_capacity, is_out_of_office); territory_ids for the territory method (from crm.territories.list); optional special rules, evaluated first by priority; the fallback (unassigned, round_robin, notify_admin, or specific_user with fallback_user_id); and whether to notify the assigned owner (default true) and extra users. Every reference is checked: participant_not_found, fallback_user_required, recipient_without_access, territory_not_found, lead_source_not_found, pipeline_not_found. Requires manage_assignment (owners, admins and CRM admins).

Alcance
crm:write
Permiso
Editar en el módulo · Acción del CRM: manage_assignment
Tool del MCP
crm_assignment_rules_createEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.assignment_rules.create".

Costo declarado: hasta 320 lecturas y 1 escrituras por llamada (cuentan en el cupo diario).

Parámetros

namestringcuerporequerido

The rule's name.

methodenumcuerporequerido

How the owner is chosen: round_robin, weighted_round_robin, capacity, territory (territory_ids), source, value or manual.

Valores: round_robin, weighted_round_robin, capacity, territory, source, value, manual

participantsarray<object>cuerporequerido

Who receives the leads, up to 100.

fallbackenumcuerporequerido

When nobody fits: unassigned, round_robin, notify_admin or specific_user (with fallback_user_id).

Valores: unassigned, round_robin, notify_admin, specific_user

pipeline_idstringcuerpoopcional

Scope: only the leads of this pipeline (crm.pipelines.list).

source_idstringcuerpoopcional

Scope: only the leads of this lead source (crm.lead_sources.list); more specific than a pipeline.

entity_typeenumcuerpoopcional

Only for a global rule (no source nor pipeline): limit it to prospects or deals.

Valores: prospect, deal

territory_idsarray<string>cuerpoopcional

Territories for the territory method, in order (crm.territories.list).

special_rulesarray<object>cuerpoopcional

Conditions evaluated first, by priority; the first that matches assigns its user or method.

Por defecto: []

fallback_user_idstringcuerpoopcional

The owner when fallback is specific_user: a person with access or an AI agent of the CRM team.

notify_ownerbooleancuerpoopcional

Notify the assigned owner (default true).

notify_extra_user_idsarray<string>cuerpoopcional

Other people notified of each assigned lead, up to 50 (people with access to the organization).

Respuesta

idstring

Errores

Ejemplo

curl -X POST "https://api.mb-suite.com/v1/crm/assignment-rules" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "NAME",
  "method": "round_robin",
  "participants": [],
  "fallback": "unassigned"
}'

Probar con tu API key de prueba

Con una API key de prueba el pedido va siempre a tu organización de práctica: datos de ejemplo que puedes reiniciar.

curl -X POST "https://api.mb-suite.com/v1/crm/assignment-rules" \
  -H "Authorization: Bearer $MB_TEST_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "name": "NAME",
  "method": "round_robin",
  "participants": [],
  "fallback": "unassigned"
}'
PATCH/v1/crm/assignment-rules/{rule_id}

Update a lead assignment rule

crm.assignment_rules.update

EscrituraIdempotenteDesde 2026-11-01

Updates any field of an assignment rule through updates: a field left out does not change, and null clears an optional one (pipeline_id, source_id, entity_type, territory_ids, fallback_user_id, notify_extra_user_ids). Participants and special rules are replaced as a whole; the references sent are checked like at creation. Turning a source or pipeline rule into a global one (no source nor pipeline left) needs confirm_global: true outside the app (rule_scope_widening otherwise): every lead without a more specific rule would follow it. Requires manage_assignment.

Alcance
crm:write
Permiso
Editar en el módulo · Acción del CRM: manage_assignment
Tool del MCP
crm_assignment_rules_updateEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.assignment_rules.update".

Costo declarado: hasta 320 lecturas y 1 escrituras por llamada (cuentan en el cupo diario).

Parámetros

rule_idstringrutarequerido

The rule's id, from crm.assignment_rules.list.

updatesobjectcuerporequerido

The fields to change; what is not sent is kept.

confirm_globalbooleancuerpoopcional

Send true when the change makes the rule global (no source nor pipeline left): outside the app it is refused otherwise, because every lead without a more specific rule would follow it.

Respuesta

oktrue

Errores

Ejemplo

curl -X PATCH "https://api.mb-suite.com/v1/crm/assignment-rules/{rule_id}" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "updates": {}
}'

Probar con tu API key de prueba

Con una API key de prueba el pedido va siempre a tu organización de práctica: datos de ejemplo que puedes reiniciar.

curl -X PATCH "https://api.mb-suite.com/v1/crm/assignment-rules/{rule_id}" \
  -H "Authorization: Bearer $MB_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "updates": {}
}'
POST/v1/crm/assignment-rules/{rule_id}/delete

Delete a lead assignment rule

crm.assignment_rules.delete

IrreversibleIdempotenteDesde 2026-11-01

Deletes an assignment rule for good: rules do not go to the trash, and leads stop being routed through it; the dry run names it and its scope. assignment_rule_not_found when the id does not exist (also in the dry run). Requires manage_assignment.

Pide confirmación: primero dry_run: true (vista previa y confirm_token, que vale 10 minutos y una sola vez), después el mismo cuerpo con confirm_token. En unas pocas, solo con ciertos datos: la descripción dice cuándo. Por qué y cómo: Vista previa y confirmación.

Alcance
crm:write y «Permitir eliminar» (crm:delete en OAuth)
Permiso
Editar en el módulo · Acción del CRM: manage_assignment
Tool del MCP
crm_assignment_rules_deleteEn la superficie completa; en la compacta, mb_execute_operation con id: "crm.assignment_rules.delete".

Costo declarado: hasta 1 lecturas y 1 escrituras por llamada (cuentan en el cupo diario).

Parámetros

rule_idstringrutarequerido

The rule's id, from crm.assignment_rules.list.

Respuesta

oktrue

Errores

Ejemplo

curl -X POST "https://api.mb-suite.com/v1/crm/assignment-rules/{rule_id}/delete" \
  -H "Authorization: Bearer $MB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "dry_run": true
}'

Probar con tu API key de prueba

Con una API key de prueba el pedido va siempre a tu organización de práctica: datos de ejemplo que puedes reiniciar.

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